Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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.

error logs after migrating to php 7.1

Discussion in 'General Discussion' started by baronn, Dec 27, 2017.

  1. baronn

    baronn Member

    Joined:
    Dec 27, 2017
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    manchester
    cPanel Access Level:
    Root Administrator
    Hello everyone.

    Hoping that someone can point me in the right direction here.

    I have a vps and full root access. Running the latest version of whm/cpanel: Apache/2.4.29 - CENTOS 6.9 v68.0.21

    So I updated a site to php 7.1. All working beautifully and love the increased performance over php 5.6

    There was a couple of error log files. 1 in public_html and the other under /home/ which I checked (I had to download as file manager wouldn't open them) and they were populating fine.

    Once I updated I figured hey why not delete the contents and re upload empty files and see IF any errors pop up. I used filezilla to do this as file manager wouldn't let me view the contents.

    That was a few days ago. I checked today and its not updated. At first I thought "great there's no errors beautiful!"

    Then whilst testing another part of the site I navigated to see if a url was indeed showing a 403 error which it was. Inadvertently I ran into a 500 error (it was navigating to the wp-settings.php url of my wordpress install) all that's working as expected.

    I then popped over to see my error log files, one in public_html and other under /home/ again they were empty..

    There's another folder under /home/ called /logs/ so I looked in there and there is a file called (domain)php error logs. I checked that (which file manager allowed me to view) and it showed the 500 error I experienced earlier.

    SO,
    1. would/should that error have popped up in my other log files in there locations?
    2. is it normal for the 500 error not to have entered those 2 log files? and only the one under folder /logs/ ?
    3. are there any settings that I should have enabled once moved to php7.1? (looked at other threads and no definitive answer)

    I have another site on this vps and that's still on older php (5.6) and that's populating those error logs without issues (under /home/ and public_html as well as the one in /logs/).

    So its got me concerned that I may not be able to address any issues by using those logs that are now empty.

    Yes I can view the one in /logs/ and yes I have full root access to box so can view the raw files BUT I want to address anything that I have missed i.e. settings as well as getting those error log file to work again. I also have someone monitor those log files (the public_html and /home/ ones) who just have FTP access and its good from that point as I don't need to provide additional access for what they do.

    Hope all the above makes sense and looking forward to your expert replies.

    Thanks.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello @baronn,

    The "500" and "403" error codes relate to Apache, and thus will appear in your Apache domain access logs (the ones you can see under the logs directory). The "error_log" files within your account's home directory (or any directories beneath it with PHP scripts) will only include PHP error messages. To verify PHP error logging is working as intended, you could intentionally produce a PHP error with a PHP script installed in the public_html directory. EX:

    How to intentionally cause a fatal error in PHP script?

    Thank you.
     
    baronn likes this.
  3. baronn

    baronn Member

    Joined:
    Dec 27, 2017
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    manchester
    cPanel Access Level:
    Root Administrator
    @cPanelMichael

    thanks for the reply. I tested what you sent by looking at creating intentionally creating an error. So i folloed the guide on link prvided. Created 2 files just in case:

    File no 1 was: myerrors.php which included:
    <?php trigger_error("Oops!", E_USER_ERROR); ?>

    File no2 was myerrors1.php which included:
    <?php noSuchFunction(); ?>

    I navigated to both of the files in turn and each time i got a blank page (expected result).

    I then went and checked my error log files. the one in the home directory in this location: /home/(domainname)/logs/ has this log file:domain_co_uk.php.error.log and that indeed has logged those 2 errors:

    [28-Dec-2017 12:18:40 UTC] PHP Fatal error: Oops! in /home/domain/public_html/myerror.php on line 1
    [28-Dec-2017 12:21:41 UTC] PHP Fatal error: Uncaught Error: Call to undefined function noSuchFunction() in /home/domain/public_html/myerror1.php:1
    Stack trace:
    #0 {main}
    thrown in /home/domain/public_html/myerror1.php on line 1

    BUT the 2 files my original question relates to which are located here:

    /home/domain_name/error_log and
    /home/domain_name/public_html/error_log

    Those 2 files in those locations have not recorded the errors. Again before moving to php7.1 they were working fine and both files were recording errors.

    As I stated, after moving to php7.1 I downloaded the error_log files (as file manager wouldn't show me them) viewed them in notepad++, deleted the contents and re uploaded them to the same locations. Both the files have the 0777 permissions set.

    Don't understand why they are now not recording any errors...
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The permissions on those files should be set to 0644. If the issue persists after updating the permissions, feel free to open a support ticket using the link in my signature so we can take a closer look.

    Thank you.
     
  5. baronn

    baronn Member

    Joined:
    Dec 27, 2017
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    manchester
    cPanel Access Level:
    Root Administrator
    i corrected the permissions and they are still not populating. Thanks will open a ticket...
     
Loading...

Share This Page