Journal ceejayoz's Journal: PHP and File Permissions 12
Hey Linux pros...
I have a PHP script that goes into my POP account directory and pulls e-mails out of it, parses them, and adds them to a mySQL db.
However...
My mail server (courier) creates those files with permissions of 0600 - meaning PHP can't read them without me manually CHMOD'ing them to 0644 (defeats the point of this script getting them in the first place).
so...
I need one of the following...
a) a shell script to CHOMD all files in that directory to 0644, which I'd put as a cron job every minute or so
b) some way of making courier save with 0644 permissions as default, instead of 0600
c) some way of getting PHP to run as the user (ceejay) instead of its default (nobody)
Anyone got ideas?
Re: (Score:1)
Re:or... (Score:2)
I am an idiot.
How did I not think of that?
Re: (Score:1)
Well (Score:2)
I wouldn't have the PHP process run as you but having it run as its own user instead of "nobody" has some merit. In general I prefer to run processes and subsystems under their own userids rather than grouping them all under single uid. If for no other reason than it can limit the damage caused by a bug or malicious user/process. It also permits somewhat finer grained access controls, for example you can make sure th
From PHP.NET (Score:1)
another idea (Score:1)
Re: (Score:2)