cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution
New

Shared hosting vs VPS cPanel PHP error log

Hi,

 

I am moving from a shared hosting package to a VPS with cPanel.

 

In my shared hosting environment with GoDaddy the system always saved a file called error_log in a directory where a php file was run that may have a problem such as undefined variable and so on. This was a great help in developing.

 

However, I cannot see how to turn this on with my Linux based cPanel environment. I have edited the ini settings for each php version using the MultiPHP INI editor but still I cannot see the error_log file.

 

This is the code I entered:

 

display_errors = Off
error_reporting = E_ALL & ~E_NOTICE
log_errors = On
error_log = error.log

 

Can anyone advise what I need to do?

 

Thanks

3 REPLIES 3
Super User I
Super User I

Re: Shared hosting vs VPS cPanel PHP error log


@TheTub wrote:

Hi,

 

I am moving from a shared hosting package to a VPS with cPanel.

 

In my shared hosting environment with GoDaddy the system always saved a file called error_log in a directory where a php file was run that may have a problem such as undefined variable and so on. This was a great help in developing.

 

However, I cannot see how to turn this on with my Linux based cPanel environment. I have edited the ini settings for each php version using the MultiPHP INI editor but still I cannot see the error_log file.

 

This is the code I entered:

 

display_errors = Off
error_reporting = E_ALL & ~E_NOTICE
log_errors = On
error_log = error.log

 

Can anyone advise what I need to do?

 

Thanks


@TheTub Did you create a file called php_error.log? Here are the instructions from Godaddy: https://www.godaddy.com/help/setting-up-custom-defined-php-error-logs-in-cpanel-9212

---

New

Re: Shared hosting vs VPS cPanel PHP error log

Hi,

 

Thanks for the pointer. I tried what the article suggested. But after waiting a couple of days for it to be active (the article says a few hours) I can still see no entries in the php_error.log file created in the public_html directory.

 

Going back to my original post, the really great thing about the error_log file created using the shared hosting is that it is created even if there is no file called error_log and it appears in the directory where the errant file resides. This is really useful to me and I would love to have the same function with my VPS cPanel hosting.

 

Cheers

 

TT

New
Solution

Re: Shared hosting vs VPS cPanel PHP error log

Solved.

 

In case this helps anyone else here is the simple thing I had misunderstood.

 

In the ini file, the line

error_reporting = E_ALL & ~E_NOTICE

means report all errors EXCEPT notices. I was after the notices to help with finding errors in my php code.

So all I needed to do was replace with

error_reporting = E_ALL

Thanks

TT