However, when you wish to write or modify a file using PHP, you need
to use the CGI version of the facility, so that you can perform the operation
using your own account user ID. This allows you to use secure permissions on
writable files.
When using the CGI version of PHP, you can modify files with standard
"owner write" permissions (chmod 644) and write files in directories that have
standard permissions.
We've installed the CGI version of PHP at "/usr/local/bin/php4.cgi". You
can call it from a stub executable in your cgi-bin. Create a text file in your
cgi-bin called "php4.cgi" containing this line "#!/usr/local/bin/php4.cgi".
Chmod it 700, and then you can use a URL similar to:
http://www.hypersurf.com/cgi-bin/php4.cgi/~username/filename.html
In the example above, PHP code in "filename.html" will be processed by PHP.
Substitute the word "username" with your own account user name. This will
allow you to execute PHP commands as your own account ID in the same way that
CGI scripts are executed on our system.