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.

easyapache and php - server error

Discussion in 'EasyApache' started by Final-Solution, Jan 29, 2008.

  1. Final-Solution

    Final-Solution Well-Known Member

    Joined:
    Jul 14, 2002
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    I just upgraded by using the easyapache script to the latest versions of apache and php with SuPHP, now some scripts are giving me a 500 internal server error, but some (horde email, some scripts on some websites) are working normally . . has this happened to anyone else?

    it seems like scripts in home/me/public_html/ aren't working but the ones in home/me/public_html/scripts/ are . .

    I'd think if PHP was broken it wouldn't be working anywhere :/ Should I just downgrade back to PHP4.4?
     
    #1 Final-Solution, Jan 29, 2008
    Last edited: Jan 29, 2008
  2. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    500 Internal errors are normally the result of incorrect permissions more than anything - after installing suPHP, rather than PHP itself.

    Check your apache error_log and suPHP.log in your apache directory. Normally /usr/local/apache/logs - post some lines from there if you have troubles working it out.

    Edit: Also check your .htaccess files - you can't set PHP variables with this file any more, you'll have to switch to using php.ini in the user directory. Have any .htaccess files? Post some lines from that too please :)
     
  3. Final-Solution

    Final-Solution Well-Known Member

    Joined:
    Jul 14, 2002
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    I've got about a half hour of free time a day to work on this until the weekend, thanks for any help!

    .htaccess
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http://user.org/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://user.org$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.user.org/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.user.org$ [NC]
    RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]


    from suphp_log

    [Wed Jan 30 16:56:35 2008] [info] Executing "/home/user/public_html/shop/catalog/index.php" as UID 32054, GID 32055
    (giving the error Fatal error: Call to undefined function mysql_connect() in /home/local148/public_html/shop/catalog/includes/functions/database.php on line 19)
    [Wed Jan 30 17:03:25 2008] [warn] File "/home/user/public_html/bbs/index.php" is writeable by group
    [Wed Jan 30 17:03:24 2008] [info] Executing "/home/user/public_html/gb/addentry.php" as UID 32011, GID 519
    (this URL gives "Fatal error: Call to undefined function mysql_connect() in /home/user/public_html/gb/lib/mysql.class.php on line 30")
    [Wed Jan 30 17:05:22 2008] [info] Executing "/home/user/public_html/index.php" as UID 32010, GID 511
     
  4. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    Looks like you need to use easyapache again to recompile PHP with mysql support?

    You compiled PHP4? Reason I ask if that PHP5 dies more gracefully (shows an error on your screen rather than your log) in some cases where PHP4 did not.
     
  5. Final-Solution

    Final-Solution Well-Known Member

    Joined:
    Jul 14, 2002
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    6
    Before I had no php4, but I reran easyapache with php4, the php files are working, and the mysql error is gone, but it's been replaced with Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.

    I checked /usr/lib/php.ini and register_globals is set to On . . I guess I gotta tattoo "if it aint broke don't fix it" on my forehead

    here is the .htaccess

    <Directory "/usr/local/apache/htdocs">
    AllowOverride Options
    </Directory>

    <IfModule mod_setenvif.c>
    <IfDefine SSL>
    SetEnvIf User-Agent ".*MSIE.*" \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0
    </IfDefine>
    </IfModule>

    <IfModule mod_php4.c>
    php_value session.use_trans_sid 0
    php_value register_globals 1
    </IfModule>

    (update: I think I got it working, had to turn on register_globals in /usr/php4/lib/php.ini)
     
    #5 Final-Solution, Jan 31, 2008
    Last edited: Jan 31, 2008
  6. darren.nolan

    darren.nolan Well-Known Member

    Joined:
    Oct 4, 2007
    Messages:
    259
    Likes Received:
    0
    Trophy Points:
    16
    remove the PHP flags in the .htaccess file - suPHP doesn't like you using that. Create a php.ini file in the directory instead with those flags (without the <IfModule> tags).

    Edit: That enables register_globals on everyone's account, not normally such a good idea.... But using a php.ini file in the directory with the PHP script will make this option only happen for that user. Cheers
     
Loading...

Share This Page