note 35567 deleted from tutorial.firstpage by nlopess
| From: | nlopess@php.net | Date: | Fri, 09 Apr 2004 14:23:09 +0000 |
| Subject: | note 35567 deleted from tutorial.firstpage by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-67887@lists.php.net to get a copy of this message | ||
Note Submitter: sprater@servicom2000.com
----
Concerning Unix permissions of PHP files: as the earlier commentator noted, they need to be
readable by the Unix user or group that owns the webserver process. The command "chmod 644
<file>.php" will do this.
But the mode "644" makes the file readable for *any user* on the Unix system. Many PHP
programs (if not most) contain sensitive database connection information, such as username and
password. As a security precaution, if the PHP script I write performs a database connection with
embedded user and password info, then I change the mode to readonly for owner, and make the owner
the same as the webserver process owner. If my webserver runs as user "nobody", then:
chown nobody file.php
chmod 600 file.php
You'll need superuser privileges to do a chown.