The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Recompiled PHP - various permission denied errors after...

Discussion in 'General Discussion' started by [O-CuK]Marci, Aug 20, 2007.

  1. [O-CuK]Marci

    [O-CuK]Marci Active Member

    Joined:
    Jun 3, 2004
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Recompiled PHP the other day via WHM to include FreeType2 support to help reduce spammer signups on vBulletin-based forums hosted on our server... am beginning to regret it.

    All appeared to go without a hitch... however, things seem to be running oddly.

    For instance, see bottom of page here: http://www.mmra.org.uk/aboutus.php
    vBulletin forums hosted - none of users can upload files, get's similar permission denied errors.
    VirtuaNews (www.over-clock.com frontend) won't allow me to add or edit any news posts without similar permission denied errors...

    Code:
    Sorry, Unable to write to static/aboutus_1.php file, you must ensure that this file has the correct permissions set for writing to it. Your last actions have been record sucessfully so do not refresh the page if it was adding something you did. You must submit something to the site unchanged after you have set the file permissions and this will write the pages again.
    It basically appears scripts can't write to folders within their user's account, when previously they could...

    What have I missed???
     
  2. jayh38

    jayh38 Well-Known Member

    Joined:
    Mar 3, 2006
    Messages:
    1,215
    Likes Received:
    0
    Trophy Points:
    36
    Did you happen to compile with phpsuexec ? If so, that would be the trouble. You would need to set ownership to the account holder instead of 'nobody' and a permission no higher than 0755.

    Ahh, just looked at your link. Apparently you did not enable fopen. By default, the new compile will disable it in php 5.

    In php.ini you would need to set this option:
    allow_url_fopen = On
     
    #2 jayh38, Aug 20, 2007
    Last edited: Aug 20, 2007
  3. [O-CuK]Marci

    [O-CuK]Marci Active Member

    Joined:
    Jun 3, 2004
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    /usr/lib/php.ini
    /scripts/php.ini

    ??

    Issue isn't just fopen that I can work out... that's just that one particular script.

    Definitely made sure I didn't do that... phpsuexec wasn't ticked.
     
    #3 [O-CuK]Marci, Aug 20, 2007
    Last edited: Aug 20, 2007
  4. [O-CuK]Marci

    [O-CuK]Marci Active Member

    Joined:
    Jun 3, 2004
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Added "allow_url_fopen..." to /usr/lib/php.ini, rebooted server... no change. All errors still present.

    Not using php5... using php4.4.7
     
    #4 [O-CuK]Marci, Aug 20, 2007
    Last edited: Aug 20, 2007
  5. koolcards

    koolcards Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Tampa, Fl
    Not sure about your 'permission denied' error but typically its either /usr/local/lib/php.ini on cPanel machines or /usr/local/lib/php.ini with Zend installed.


    Login via SSH and type:

    php -i | grep php.ini

    That will show you all the php.ini file locations on the machine.
     
  6. [O-CuK]Marci

    [O-CuK]Marci Active Member

    Joined:
    Jun 3, 2004
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    The above presents me with:

    Code:
    golem# php -i|grep php.ini
    <tr><td class="e">Configuration File (php.ini) Path </td><td class="v">/usr/local/Zend/etc/php.ini </td></tr>
    
    However "locate php.ini" presents me with...

    Code:
    golem# locate php.ini
    /scripts/php.ini
    /usr/lib/php.ini
    /usr/local/Zend/etc/php.ini
    /usr/local/lib/php.ini
    /usr/local/lib/php.ini-zend_optimizer.bak
    /usr/local/lib/php.ini.new
    /usr/ports/lang/php4/files/patch-php.ini-dist
    /usr/ports/lang/php4/files/patch-php.ini-recommended
    /usr/ports/lang/php5/files/patch-php.ini-dist
    /usr/ports/lang/php5/files/patch-php.ini-recommended
     
  7. koolcards

    koolcards Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Tampa, Fl
    should be your active one, with /usr/local/lib/php.ini sym linked to it.

    Code:
    <?php phpinfo(); ?>
    file in the affected web site will confirm which it's using
     
    #7 koolcards, Aug 20, 2007
    Last edited: Aug 20, 2007
  8. [O-CuK]Marci

    [O-CuK]Marci Active Member

    Joined:
    Jun 3, 2004
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Have just checked - yep that's the one I added the fopen line into - made no difference to anything I'm afraid...
     
  9. koolcards

    koolcards Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Tampa, Fl
    As I said, I'm not sure about your error :eek: but there have been a couple posts regarding removing your session from /tmp as well as problems with the /tmp directory itself that might bear on the subject.
     
  10. [O-CuK]Marci

    [O-CuK]Marci Active Member

    Joined:
    Jun 3, 2004
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Have had this issue before when PHP was recompiled... all came down to ownership and permissions more than anything else... I just can't remember what it was :confused:
     
  11. koolcards

    koolcards Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Tampa, Fl
    How about your php,info file. Is it showing everything you need in the "Configure Command" section? Something left out of the compile?

    Sorry, no real suggestions for you :eek:

    Hey, your link is working now

    http://www.mmra.org.uk/aboutus.php
     
  12. [O-CuK]Marci

    [O-CuK]Marci Active Member

    Joined:
    Jun 3, 2004
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    yup... thanks to a Debian guru! (Ta Maulkin!!)

    Code:
    chgrp -R nobody [directory]
    chmod -R g+w [directory]
     
  13. koolcards

    koolcards Well-Known Member

    Joined:
    Oct 8, 2003
    Messages:
    146
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Tampa, Fl
    Your recompile changed the directory permissions and file ownership? Guess that why it was telling apache 'permission denied'. :cool:

    Glad it works ;)
     
Loading...

Share This Page