On my previous server and on some other hosts, I was able to write to files (for example with PHP) without having to chmod the files first.
Now I cannot, and files are required to be chmoded properly so I can write to them.
I cannot even touch() a file with PHP.
Is there any way to have this permissions removed?
I don’t want to chmod the all thing, all I want is to change the configurations so I can fwrite() or file_put_contents() normally.
I’s a dedicated un-managed server, so basically any advanced configurations can be done.
Thank you in advance!<br><br>Post edited by: =IceBurn=, at: 2008/12/30 13:55
You’ll want to switch to suexec execution of PHP scripts.
Hi Joe and thank you for your reply.
You mean I have run PHP as CGI?
You can use suexec with CGI or FastCGI (the latter of which offers similar speed benefits to mod_php).
To change those settings for all new Virtual Servers, look in System Settings -> Server Templates -> Default Template -> Apache Website.
To change it for an existing Virtual Server, look in Server Configuration -> Website Options (choose "Run CGI scripts as the domain owner").
Thank you for your reply!
Can you please verify if these settings are correct:
/etc/php5/cli/php.ini=Configuration for mod_php
/etc/php5/cli/php.ini=Configuration for scripts run via CGI
/etc/php5/cli/php.ini=Configuration for command-line scripts
I think they are not, can you point me in the right direction?
One more thing, if I chmod chmod -R ug+rw the users directory, will that be insecure? Is this a good work around?
Thank you very much for your help!