Internal server error with mysqli and no log entry

Arara

Registered
Mar 25, 2011
4
0
51
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
 
Last edited:

JaredR.

Well-Known Member
Feb 25, 2010
1,834
23
143
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.
 

Arara

Registered
Mar 25, 2011
4
0
51
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".
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
23
143
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.
 

Arara

Registered
Mar 25, 2011
4
0
51
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.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
38
248
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
 

Arara

Registered
Mar 25, 2011
4
0
51
I will check this. And for the sql handling i switch to the pdo drivers. Seems to have some advantages.
Thanks for your help.