PHP Error Log Path Does Not Match

Home Forums BulletProof Security Pro PHP Error Log Path Does Not Match

Tagged: 

Viewing 15 posts - 46 through 60 (of 78 total)
  • Author
    Posts
  • #29738
    armintz
    Participant

    I was instinctively scrolling to the bottom of the page and clicking the “Update File” button instead of the “Set Error Log Location” button just below the path… eeek. Sorry for the false alarm. Error went away after clicking the Set Error Log Location button.

    #29739
    AITpro Admin
    Keymaster

    Ok Great!  Thanks for letting me know you got it working.

    #30610
    protection
    Participant

    [Topic has been merged into this relevant Topic]
    I migrated my site to a new host, and am getting the following:

    PHP Error Log Path Does Not Match
    The PHP Error Log Location Set To: folder path does not match the Error Log Path Seen by Server: folder path.
    Click Here to go to the PHP Error Log page and click the Htaccess Protected Secure PHP Error Log Read Me button for troubleshooting steps.

    When I click the link for ‘click here’, it shows a difference in paths between PHP Error Log Location Set To: and Error Log Path Seen by Server:. I tried pressing the ‘set error log location’ button, but that didn’t help.

    I then went to P-Security and ran a diagnostics, and came up with this:

    PHP Version: 5.6.22
    PHP|php.ini Handler: A PHP|php.ini Handler was Not found in your Root .htaccess file.
    
    Configuration File (php.ini) Path: Click the View PHPINFO button on the PHP Info Viewer page to get this path.
    Loaded Configuration File: /opt/alt/php56/etc/php.ini
    
    php.ini, php5.ini & .user.ini File Search Results: (Displays the file paths below if files were found)
    A Custom php.ini file was found: /home/xxxxxxxxxxx/public_html/wp-content/bps-backup/autorestore/root-files/php.ini
    A Custom php5.ini file was found: /home/xxxxxxxxxx/public_html/wp-content/bps-backup/autorestore/root-files/php5.ini
    
    disable_functions: The ini_set function is Not Disabled
    
    wp-config.php File: The wp-config.php file was found in the website root folder.
    
    Error Log Path Seen by Server: /home/content/xx/xxxxxxxxx/html/wp-content/bps-backup/logs/bps_php_error.log
    PHP Error Log Location Set To: /home/xxxxxxxxxxx/public_html/wp-content/bps-backup/logs/bps_php_error.log
    ini_set PHP Error Log Location Set To: /home/xxxxxxxx/public_html/wp-content/bps-backup/logs/bps_php_error.log
    
    Website Root Folder: http://www.skipthedrive.com
    WP ABSPATH: /home/xxxxxxxxxxx/public_html/
    Host by Address: ip-107-180-40-110.ip.secureserver.net
    DNS Name Server: ns17.domaincontrol.com
    
    Server Type: Apache/2.4.23
    Operating System: Linux
    Server API: cgi-fcgi CGI Host Server Type
    
    Zend Engine Version: 2.6.0
    Zend Guard Loader: A Zend Extension is Not Loaded
    FastCGI: Unable to detect whether FastCGI is in use. Check your web host control panel to see if FastCGI is in use.
    
    -------------------------------------------------------------
    
    Shared Hosting Recommendations:
    For first time installations of BPS Pro it is recommended that you use the ini_set Options to quickly setup your PHP Error Log file and location. If you would like to create a custom php.ini file for your website see this Forum Topic: Custom php.ini File Setup
    
    -------------------------------------------------------------
    
    VPS or Dedicated Hosting Recommendations:
    For first time installations of BPS Pro it is recommended that you use the ini_set Options to quickly setup your PHP Error Log file and location. You can then create a custom php.ini file, which you can upload to replace the Servers php.ini file for your website at a later time if you would like. You can create/use either a custom php.ini file or the ini_set Options method or both at the same time. If you have created a custom php.ini file and you also use ini_set Options then your ini_set Options settings will take precedence over your custom php.ini file settings.
    
    If a custom php.ini file was found in the php.ini, php5.ini & .user.ini File Search Results: then delete that file. For VPS or Dedicated Hosting you have full access to that Servers php.ini file (Loaded Configuration File:), and you will be uploading your custom php.ini file and replacing the Servers php.ini file with your custom php.ini file instead of creating the custom php.ini file under your website folders. Click HERE for the custom php.ini setup steps for VPS and Dedicated hosting

    Any ideas?

    #30612
    AITpro Admin
    Keymaster

    @ protection – Do the steps below to add your new php error log path for your new host server.  Also very important:  php.ini files are NOT transferrable/usable on different web hosts.  php.ini files are unique/specific to each web host server.  So if your php.ini files are old php.ini file from your old host then you need to delete them.  You also need to delete any php/php.ini handler htaccess code in BPS Custom Code if you have old php/php.ini handler htaccess code from your old host in Custom Code. php/php.ini handler htaccess code is also unique/specific to each web host and cannot be used on different web hosts.

    1. Go to the P-Security > ini_Set Options page > change the path to the php error log file from: /home/xxxxxxxx/public_html/wp-content/bps-backup/logs/bps_php_error.log to: /home/content/xx/xxxxxxxxx/html/wp-content/bps-backup/logs/bps_php_error.log

    2. Click the Save|Enable Options button.

    #30621
    protection
    Participant

    Thanks for your help, I’m back up and running 🙂

    Here is some info for others who might run into this problem:

    I did not have any php.ini files on my root, but did have custom code for php/php.ini handlers. Though there was nothing there that represented any kind of path info, I copied that custom code into a file and saved it. I then deleted that custom code, saved it, and activated it. At this point I was still getting an error. Up above you asked that I do the following:

    1. Go to the P-Security > ini_Set Options page > change the path to the php error log file from: /home/xxxxxxxx/public_html/wp-content/bps-backup/logs/bps_php_error.log to: /home/content/xx/xxxxxxxxx/html/wp-content/bps-backup/logs/bps_php_error.log

    2. Click the Save|Enable Options button.

    This is actually setting the error log path to be the OLD path, but I did it anyway. I then noticed that the PHP Error Log Location Set To: and Error Log Path Seen by Server: were now both being set to the old path. I went ahead back to P-Security > ini_Set Options page and changed it to the new path, then went to P-Security -> PHP Error Log, set the PHP Error Log Location Set To: path to be the new path, and saved it. Voila! They were both now pointing to the new path. I went ahead and tested that it worked by selecting the Test Error Log button, and it worked fine.

    I went ahead and re-added my custom php/php.ini handler code, as I don’t see how there will be any problems with it. So far no errors. I hope this helps!

    #30623
    AITpro Admin
    Keymaster

    I went ahead and re-added my custom php/php.ini handler code, as I don’t see how there will be any problems with it. So far no errors.

    You need to ask your web host if your php/php.ini handler code is correct/valid for your host server. Send them the php/php.ini handler htaccess code and ask them if it is correct/valid for your host server. Some host servers crash when you use php/php.ini handler code that is for another web host. Other web hosts just ignore the incorrect/invalid php/php.ini handler code that is for another web host and the php/php.ini handler htaccess code does not work on the current web host you are on.

    #30624
    protection
    Participant

    Will ask them, thanks!

    #30625
    protection
    Participant

    Bummer…

    So I proved I was able to write to the PHP error log file when clicking Test Error Log, and I have the paths for PHP Error Log Location Set To: and Error Log Path Seen by Server: the same. However, it seems that an error_log file is written to the directory for which the PHP script failed. In other words, it’s not writing the PHP error/warning to:

    /home/xxxxxxxxx/public_html/wp-content/bps-backup/logs/bps_php_error.log`

    For example, if I have a PHP script on the root directory and it fails, it will create an error_log file there. I also tried this with no php/php.ini handler custom code.

    Here’s another wrinkle in this problem – I have some folders outside of WP that I’m worried will have the error_log written there as opposed to the path I have set up in BPS. I’d like all PHP errors to go to one log file. Would you recommend I set up php.ini to include the following:

    error_log =/home/xxxxxxxxx/public_html/wp-content/bps-backup/logs/bps_php_error.log

    #30626
    AITpro Admin
    Keymaster

    @ protection – Yep, that is a PHP server php.ini configuration setting that creates default error_log files in each folder where a script generates errors.  I think that happens when the error_log directive is set to blank/nothing.  error_log = “”.  You will need to edit your custom php.ini file and change the php.ini configuration directive setting for the error_log directive path to the path you want to use for all php error logging.

    #30627
    protection
    Participant

    Perfect, thanks again! Your plugin rocks and so does your promptness for support 🙂

    #32836
    Pablo Parrado
    Participant

    I have the php error message PHP Error Log Path Does Not Match BUT they do match!?
    Here is my diagnostics results:

    PHP Version: 5.6.30
    PHP|php.ini Handler: A PHP|php.ini Handler was Not found in your Root .htaccess file.
    
    Configuration File (php.ini) Path: Click the View PHPINFO button on the PHP Info Viewer page to get this path.
    Loaded Configuration File: /usr/local/php5.6/etc/php.ini
    
    php.ini, php5.ini & .user.ini File Search Results: (Displays the file paths below if files were found)
    A Custom php.ini file was found: /home/mydomain/www/wp-content/bps-backup/autorestore/root-files/php.ini
    A Custom php.ini file was found: /home/mydomain/www/php.ini
    
    disable_functions: The ini_set function is Not Disabled
    
    wp-config.php File: The wp-config.php file was found in the website root folder.
    
    Error Log Path Seen by Server:
    PHP Error Log Location Set To: /home/mydomain/www/wp-content/bps-backup/logs/bps_php_error.log
    ini_set PHP Error Log Location Set To: /home/mydomain/www/wp-content/bps-backup/logs/bps_php_error.log
    #32837
    AITpro Admin
    Keymaster

    @ Pablo Parrado – Try clicking the P-Security > PHP Error Log > Set Error Log Location button.  If that does not fix the problem then send me a WP Administrator login to this site to:  info at ait-pro dot com.  Also try clicking the Delete Log button.  We are seeing a few issues with PHP Error logging.  So they may have something to do with using i18n timestamps that we changed in BPS Pro 12.8 for the Log timestamps.  It is not confirmed yet if there is actually a problem, but if there is a problem then the problem would have something to do with certain i18n timestamp formats.  We will need to go back to the previous logging timestamp method if there is actually a problem.

    #32840
    AITpro Admin
    Keymaster

    @ Pablo Parrado – I figured out what is going on and it just so happens this same problem is happening with 3 different people on 3 different web hosts and has nothing to do with BPS Pro, but the thing in common is that you and all the other people are using a PHP server version that is disabling php error logging by default. PHP 5.6.30. So what that means is that all of these web hosts are getting the same PHP server version build, which is disabling php error logging by default in the server’s php.ini file. See the server’s php.ini directive settings below. You do have a custom php.ini file on your website, but it is not being recognized by your php server. So what you need to do is contact your web host and ask them how to enable your custom php.ini file for your website. This is not one size fits all thing. You will need to Turn Off AutoRestore and unlock your Root htaccess file while your host is working on your website. I assume your web host has php.ini handler htaccess code that they will need to add to your Root htaccess file. If so, then you will also need to add your web host’s php.ini handler htaccess code to BPS Custom Code in this Custom Code text box: 1. CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE. Once again this is not a one size fits all thing that we can assist you with. So you will need your web host’s specific code from your web host in order to get your custom php.ini file to be recognized and loaded by your particular web host. Once your custom php.ini file is being recognized and loaded by your host server, you can then turn on php error logging in your custom php.ini file.

    ; Log errors into a log file (server-specific log, stderr, or error_log (below))
    ; As stated above, you're strongly advised to use error logging in place of
    ; error displaying on production web sites.
    log_errors = Off
    
    ; Log errors to specified file.
    ;error_log = filename
    #34168
    Thomas
    Participant

    Hi,

    I am not sure how to clear up this message from the BPS PRO display status:

    PHP Error Log Path Does Not Match
    The PHP Error Log Location Set To: folder path does not match the Error Log Path Seen by Server: folder path.
    Click Here to go to the PHP Error Log page and click the Htaccess Protected Secure PHP Error Log Read Me button for troubleshooting steps.

    Below is what I get after running the Diagnostic Checks|Recommendations:

    PHP Version: 7.0.18
    PHP|php.ini Handler: A PHP|php.ini Handler was Not found in your Root .htaccess file.
    
    Configuration File (php.ini) Path: Click the View PHPINFO button on the PHP Info Viewer page to get this path.
    Loaded Configuration File: /xxx/xxxxxxx/php/etc/php.ini
    
    php.ini, php5.ini & .user.ini File Search Results: (Displays the file paths below if files were found)
    A Custom php.ini file was found: /xxx/xxxxxxx/apps/wordpress/htdocs/wp-content/plugins/bulletproof-security/admin/php/php.ini
    
    disable_functions: The ini_set function is Not Disabled
    
    wp-config.php File: The wp-config.php file was found in the website root folder.
    
    Error Log Path Seen by Server:
    PHP Error Log Location Set To: /xxx/xxxxxxx/apps/wordpress/htdocs/wp-content/bps-backup/logs/bps_php_error.log
    ini_set PHP Error Log Location Set To:
    
    

     

    #34171
    AITpro Admin
    Keymaster

    @ Thomas – The “ini_set PHP Error Log Location Set To:” setting shows a blank value.  Go to the P-Security > ini_set Options tab page > copy and paste the “ini_set PHP Error Log Location (Recommended): ” path displayed to you on the PHP Error Log tab page > into the ini_set Options > ini_set PHP Error Log Location Set To: text box > click the Save|Enable Options button.  Let me know if this works or not.  Your server settings may be disabling php error logs.

Viewing 15 posts - 46 through 60 (of 78 total)
  • You must be logged in to reply to this topic.