turn php error reporting on for one site

dxm

Active Member
Aug 1, 2007
25
0
51
php error reporting is turned off server wide.
However I need to turn the display of errors on for one site.
That site is running php 5 in cgi mode and apache suexec is enabled.
I've been trying all sorts of .htaccess and php.ini combos to no avail.
Can anyone tell me what should work with this combination of php 5 and cgi etc?

thanks
 

MattCurry

Well-Known Member
Aug 18, 2009
275
0
66
Houston, Tx
PHP Error Reporting for one site

Hello,

I do see what you are trying to do, and yes this can be accomplished. In this case you would simply need to edit the users php.ini file and add the following:

display_error = off
log_errors = On
error_log = "error.log"


If your user doesn't have a php.ini file you may have to create one. This will go in the public_html folder for that user.
Please let me know if you have any other questions.

Thank you,
Matthew Curry
 

dxm

Active Member
Aug 1, 2007
25
0
51
Hi,
That seems to be logging to error_log in public_html which is a definitely improvement! However, how can I get errors to show in the browser too?

I ask as I know that the customer will prefer this. Do I need to restart apache when I make changes to this php.ini file by the way?


thanks
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
13
313
Houston, TX
cPanel Access Level
Root Administrator
Hi,
That seems to be logging to error_log in public_html which is a definitely improvement! However, how can I get errors to show in the browser too?

I ask as I know that the customer will prefer this. Do I need to restart apache when I make changes to this php.ini file by the way?


thanks
Be very careful about displaying PHP errors. These can very easily contain sensitive information that you may not want to have publicly displayed.

display_errors = on will enable the display of errors. However, as with anything in PHP and server administration in general, be mindful of the security implications of doing this.
 

dxm

Active Member
Aug 1, 2007
25
0
51
Thanks, unfortunately I'm not seeing syntax errors reported to the browser.
I understand the warning, this is just a temporary measure for debugging purposes.