Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 18
  1. #1
    Member
    Join Date
    Aug 2005
    Posts
    13

    Default Permission errors

    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?

  2. #2
    Member linux-image's Avatar
    Join Date
    Jun 2004
    Location
    India
    Posts
    1,185
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by morphina
    I keep getting permission files on the scripts that need to acess textfiles for configuration; what could be the problem?

    can you explain more .. or rather clearly.

  3. #3
    Member
    Join Date
    Jan 2005
    Posts
    22

    Default

    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.

  4. #4
    Member
    Join Date
    Aug 2005
    Posts
    13

    Default

    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.

  5. #5
    Member
    Join Date
    Jan 2005
    Posts
    22

    Default

    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.

  6. #6
    Member
    Join Date
    Aug 2005
    Posts
    13

    Default

    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

  7. #7
    Member
    Join Date
    Jan 2005
    Posts
    22

    Default

    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?

  8. #8
    Member
    Join Date
    Aug 2005
    Posts
    13

    Default

    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...

  9. #9
    Member
    Join Date
    Nov 2005
    Posts
    97

    Default

    As far as I know, the permissions should be 644 and 755 if you want them read/execute

  10. #10
    Member
    Join Date
    Aug 2005
    Posts
    13

    Default

    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...

  11. #11
    Member
    Join Date
    Aug 2005
    Posts
    13

    Default

    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?

  12. #12
    PDM
    PDM is offline
    Member
    Join Date
    Jan 2004
    Location
    Angel Fire, NM
    Posts
    43

    Default

    php_suexec should fix it.

  13. #13
    Member
    Join Date
    Aug 2005
    Posts
    13

    Default

    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

  14. #14
    PDM
    PDM is offline
    Member
    Join Date
    Jan 2004
    Location
    Angel Fire, NM
    Posts
    43

    Default

    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

  15. #15
    Member
    Join Date
    Aug 2005
    Posts
    13

    Default

    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

Similar Threads & Tags
Similar threads

  1. Permission Errors in cPanel
    By DeiseHost in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-19-2008, 02:10 PM
  2. File permission errors
    By Archness in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-14-2007, 03:40 PM
  3. Permission Errors
    By celliott in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 10-07-2006, 02:33 PM
  4. Permission Errors
    By TitaniumHosting in forum cPanel and WHM Discussions
    Replies: 14
    Last Post: 01-14-2005, 08:22 PM
  5. PHP permission errors
    By EMS in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 07-01-2003, 11:54 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube