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.

Internal server error with mysqli and no log entry

Discussion in 'General Discussion' started by Arara, Apr 5, 2011.

  1. Arara

    Arara Registered

    Joined:
    Mar 25, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I have trouble with a new php application. Everytime it queries a simple SELECT with mysqli prepared statements (to be exact it crashes at the bind_result line) i only get an internal server error. Wouldn't be so bad if i could find a line in any of the log-files (including CPanel >> Error Log). How can i enable logging of 500 errors in cpanel/whm?

    Thx for any help
     
    #1 Arara, Apr 5, 2011
    Last edited: Apr 5, 2011
  2. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Errors from a PHP application on one of your sites would not be written to a cPanel log. Instead, they would be written to an Apache log. Try looking in /usr/local/apache/logs/error_log and /usr/local/apache/logs/suphp_log while using a Web browser to access the PHP application.
     
  3. Arara

    Arara Registered

    Joined:
    Mar 25, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Both logs contain nothing useful. In /usr/local/apache/logs/error_log are only old entries which have nothing to do with the page access and /usr/local/apache/logs/suphp_log shows only a line (for the page access) like "[Tue Apr 05 09:16:19 2011] [info] Executing "/path/to/the/script.php" as UID 503, GID 500".
     
  4. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    It appears that the script is executing correctly, and an error is happening while the script is executing. The script's developer would be the best resource for an application-specific error like this, but it is possible that other users may have some helpful suggestions.
     
  5. Arara

    Arara Registered

    Joined:
    Mar 25, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Problem is i am the developer. And i'm out of ideas. I have reduced the script to a minimal version which is almost the same as the examples at php.net. It is also working on a local webserver. If i replace mysqli with the pdo equivalent it works. I have also asked in another forum specialized on php and they say the code is correct. So my last hope was to find a log file with some informations.
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You could enable logging for the application itself to write to an error_log on the account? I'm not entirely certain you will end up with any logging for this otherwise.

    Have you tried executing the script via command line to see if you have any errors there?

    My main wonder about MySQLi and the script is that it might be exceeding some memory limitation. Do you have any RLimitMEM settings in httpd.conf file? Do you have sufficient memory_limit set in /usr/local/lib/php.ini file?

    Code:
    grep -i rlimit /usr/local/apache/conf/httpd.conf
    grep -i memory_limit /usr/local/lib/php.ini
     
  7. Arara

    Arara Registered

    Joined:
    Mar 25, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I will check this. And for the sql handling i switch to the pdo drivers. Seems to have some advantages.
    Thanks for your help.
     
Loading...

Share This Page