View Full Version : PHP Error log

03-01-2010, 08:58 PM
With 3.0, I was able to set the PHP error logging to a file and review errors and/or debugging information that gets logged there. Is it possible to do so with 4.0? I couldn't find php.ini in the usual place.

03-02-2010, 06:37 AM
I think there is something already set up that does. I was moving a php site the other day and had some problems. An error log was written in main public root that I was able to view. Let go double check that it was not the code it self setting that up. At the time I did not think about it much. :)

03-02-2010, 07:07 AM
I double checked my code and it is not creating the log so it must be a default of the 4.0 system.

03-02-2010, 08:10 AM
I had to make a manual change of my php.ini file on 3.0 and I can't find it on the 4.0 system - nor can I find any access to it vi cPanel.

03-02-2010, 09:45 AM
You don't have access to php.ini in WH 4.0. By default in a WH 4.0 account the error log well be written for you in the directory where the php script that is failing is located. I am running php 5 on the account I tested this on and the file created is named php5_error_log. I assume that if you are running php 4 it would be php4_error_log.

If you want to control the name and location of the file then you need to put this in your php script:

ini_set('error_log', 'php_errors');
The above would put the log in the same directory and it would name it php_errors. You could add a path to the name if you wanted to.