Hi, i have php running as cgi; I tried running php as a module not as cgi to be able to use eaccelerator; and I keep getting permission files on the scripts that need to acess textfiles for configuration; what could be the problem?
Hi, i have php running as cgi; I tried running php as a module not as cgi to be able to use eaccelerator; and I keep getting permission files on the scripts that need to acess textfiles for configuration; what could be the problem?
Originally Posted by morphina
can you explain more .. or rather clearly.
cPanel Certified Specialist
http://www.admin-ahead.com
https://ticketforge.com
AIM: tux image Skype: admin-ahead
I think the problem is that PHP running as a module runs as nobody, but with CGI it runs as the correct user. So the permissions errors are from the files being owned by the user rather than PHP and using something like 644 as the permissions. CHMODding the files to 666 should fix the problems, or enabling suexec.
sure, sorry if it was a bit unclear.
I Have php running as CGI, http://www.lasnite.com/test.php <-- phpinfo
I have some php scripts for my website that require access to read and write to text files, such as featured pictures, etc..., when I run php as an apache module php gives out errors saying it cannot access these files. but the scripts actually do work; it runs php well, it just wont read or write to these files... it does it fine when php is in CGI mode...
sorry, suexec has also been enabled and the problem sill persists; WHM enabled it by default... i'll try chmodding to 666, should I chmod the text files to view the featured pics, or the php script reading and writing t othese files?
Last edited by morphina; 01-15-2006 at 11:48 PM.
The files that you want to read, but with suexec enabled it shouldn't be a problem. Suexec runs PHP as the user of the directory which means 644 should be sufficient for permissions. I think there are a couple places you have to turn suexec on to actually have it fully enabled. Try changing the files that you need to write to 666 to see if PHP as a module can then read/write them.
Warning: fopen(/home/morphina/public_html/boston/gallerygain/albums/Villareal111205/photos.dat.lock): failed to open stream: Permission denied in /home/morphina/public_html/boston/gallerygain/platform/fs_unix.php on line 55
I still get the errors even after chmodding the files to 666
I seem to be making a slight confusing statement. When I say suexec I'm referring to php_suexec not suexec for CGI. That might make a slight difference. As far as I know WHM doesn't default to using php_suexec, which means that you would need to use 666 for permissions for files accessed by PHP running as a module.
Do you know what user PHP is running as, and also what user and group owns the files you're trying to read?
yes it mislead me to thin we wre talking about suexec for cgi, you meant php_suexec; apache is runing as nobody and no, php_suexec is not enabled, should I do that? the user that owns those files is morphina and has its own group, which is how I think cpanel creates it. when as an apache module, the websites load fine, its just having trouble with those particular files for some reason...
As far as I know, the permissions should be 644 and 755 if you want them read/execute
it wont do it :S, it also happens with teh configuration file for mambo since it needs to write to it, i noticed it has no trouble reading from it, its always when its oging to write to it...
has anyone ever seen this problem before?
i tried settting the permissions to 666 and nothign works :S; is there a cacheing extension that works when php is in cgi mode?
php_suexec should fix it.
where do I read about php_suexec? and is it possible to enable it and disable it upon wish will?, i guess what im asking is whre can I read abotu how to enable it :P
Search the forums there are several good threads on it.
It seems to me any cPanel server not running php_suexec, expecially in a shared hosting environment, is far more vulnerable to exploit![]()
hmm, i read about phpsuexec and it seems that phpsuexec will only run while php is in cgi mode wont it? which defeats th epurpose of me trying to run it as a module cuase i wanna get that good ol' eaccelerator up and running![]()