• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

file permissions, apache usergroup, CGI vs module

J

JeremyB

Guest
Hello There,

I have some questions regarding file permissions, the apache user, and CGI vs Module PHP.

I orginally posted by question on the sitepoint forums here:
http://www.sitepoint.com/forums/showthread.php?p=4330898&posted=1#post4330898

After making some progress there, I've come here to ask some more plesk-specific questions.

Here is my problem. I have a php script that read and writes a text file. On my old server (shared hosting), PHP ran as a CGI and there no problems reading and writing the file. On my new server, I have PHP configured as a module with PHP safemode off. All of the permissions are the same as on my old server. However, now, the only way I can write to this file is if I allow world write permissions, which I can't do for security reasons.

I can fix this by running PHP as a fastCGI as a opposed to a module, but is that slower? If so I would like to find another way to ensure that apache can read and write this file via my PHP script. Could I add the apache user to the same group as my ftp user (who owns all the files in my web directory), and then change everything to be group writable? If so, how should I do this? What is the best way for me to solve this? Using fastCGI seems like the easiest solution, but if running PHP as a module is considerably faster or more secure, I would prefer to do that.

Thanks!
Jeremy
 
Back
Top