PHP Error Log Path Does Not Match

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

Tagged: 

Viewing 15 posts - 61 through 75 (of 78 total)
  • Author
    Posts
  • #34176
    Thomas
    Participant

    The recommended path is already in the PHP Error Log Location Set To: text box. However the Status next to it says Not Set.

    #34178
    AITpro Admin
    Keymaster

    @ Thomas – It appears that your web host has disabled php error logging in your server’s default php.ini file. You will need to contact your web host support folks and ask them to allow/enable php error logging on your server/website by assisting you with creating either a custom php.ini file or .user.ini file for your website.

    #34187
    Thomas
    Participant

    I don’t have anyone but me that can do it, since I am managing the instance myself.

    What needs to be in the custom php.ini or .user.ini file and where should it be located?

    #34188
    AITpro Admin
    Keymaster

    @ Thomas – Oh ok if you have Dedicated or VPS server then you would need to edit this php.ini file > Loaded Configuration File: /xxx/xxxxxxx/php/etc/php.ini and either add the path to the BPS php error log file directly in your server’s php.ini file or you can create a custom php.ini file or .user.ini file if you would like to do this per site.  The php.ini directives that need to be edited are log_errors and error_log.  See example php.ini directive code below.  You would of course change log_errors to On and either uncomment error_log or add a path > error_log = /path-to-php-error-log-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
    #35401
    David
    Participant

    [Topic has been merged into this relevant Topic]
    Hi there,

    I have just installed BPS Pro on a WordPress multisite and I am getting the following error.

    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.

    For reference, the wordpress site was created with Bitnami Google Cloud server.

    Please could you advise on how to resolve it?

    Many thanks,

    David

    #35403
    AITpro Admin
    Keymaster

    @ David – Go to BPS Pro > P-Security > PHP.ini Options > click the Diagnostic Checks|Recommendations Run Check button. Post this information below that you will see in the Diagnostic Checks window. You can use x’s to hide your hosting account name as shown below.

    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/xxxxxx/html/forum/wp-content/bps-backup/logs/bps_php_error.log
    PHP Error Log Location Set To: /home/content/xxxxxx/html/forum/wp-content/bps-backup/logs/bps_php_error.log
    ini_set PHP Error Log Location Set To: /home/content/xxxxxx/html/forum/wp-content/bps-backup/logs/bps_php_error.log
    
    Server Type: Apache
    Operating System: Linux
    Server API: cgi-fcgi - Your Host Server is using CGI.
    #35404
    David
    Participant

    Hopefully the following is what you are looking for:

    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/xxxx/wordpress/htdocs/wp-content/bps-backup/logs/bps_php_error.log
    ini_set PHP Error Log Location Set To:

    Server Type: Apache
    Operating System: Linux
    Server API: fpm-fcgi CGI Host Server Type

    Zend Engine Version: 3.0.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.

    #35405
    AITpro Admin
    Keymaster

    @ David – 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 or something else (another plugin, code added in wp-config.php file) may be disabling php error logs.

    #35406
    David
    Participant

    Thanks, I amended the content as per your suggestion but it has not resolved the error. For reference, we are using a google virtual machine to host the site. Would this make a difference? Also, is there a way to check if anything is blocking the error log?

    For reference, the log is now as follows:

    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/xxxx/wordpress/htdocs/wp-content/bps-backup/logs/bps_php_error.log
    ini_set PHP Error Log Location Set To: /xxx/xxxxxxx/xxxx/wordpress/htdocs/wp-content/bps-backup/logs/bps_php_error.log

    Server Type: Apache
    Operating System: Linux
    Server API: fpm-fcgi CGI Host Server Type

    Zend Engine Version: 3.0.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.

    #35407
    AITpro Admin
    Keymaster

    @ David – Yes, it is very possible that Google Cloud virtual machines do not allow PHP error logging.  You would need to check with them about that.  I’ll do some google searches as well to see if I can find any info about this.

    #35408
    AITpro Admin
    Keymaster

    @ David – I came across this info on GitHub about creating a Custom php.ini file and editing the error_log directive path > https://github.com/GoogleCloudPlatform/php-docker/issues/40.  So you may not be able to use the BPS Pro ini_set() function code in the WordPress wp-config.php file to set a php error log path.  I do not know that much about Google Cloud servers so I may be wrong about that.

     

    #35409
    David
    Participant

    Thanks for looking into this. I found this guide, which discusses changing log permissions.

    https://cloud.google.com/appengine/docs/standard/php/runtime#PHP_Disabled_functions

    Furthermore, I found the following text in the php.ini file related to error logs. Would any of this be causing the problems?

    ; The following are all the settings which are different in either the production
    ; or development versions of the INIs with respect to PHP's default behavior.
    ; Please see the actual settings later in the document for more details as to why
    ; we recommend these changes in PHP's behavior.
    ; log_errors
    ;   Default Value: Off
    ;   Development Value: On
    ;   Production Value: On
    And
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; Error handling and logging ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; This directive informs PHP of which errors, warnings and notices you would like
    ; it to take action for. The recommended way of setting values for this
    ; directive is through the use of the error level constants and bitwise
    ; operators. The error level constants are below here for convenience as well as
    ; some common settings and their meanings.
    ; By default, PHP is set to take action on all errors, notices and warnings EXCEPT
    ; those related to E_NOTICE and E_STRICT, which together cover best practices and
    ; recommended coding standards in PHP. For performance reasons, this is the
    ; recommend error reporting setting. Your production server shouldn't be wasting
    ; resources complaining about best practices and coding standards. That's what
    ; development servers and development settings are for.
    ; Note: The php.ini-development file has this setting as E_ALL. This
    ; means it pretty much reports everything which is exactly what you want during
    ; development and early testing.
    ;
    ; Error Level Constants:
    ; E_ALL             - All errors and warnings (includes E_STRICT as of PHP 5.4.0)
    ; E_ERROR           - fatal run-time errors
    ; E_RECOVERABLE_ERROR  - almost fatal run-time errors
    ; E_WARNING         - run-time warnings (non-fatal errors)
    ; E_PARSE           - compile-time parse errors
    ; E_NOTICE          - run-time notices (these are warnings which often result
    ;                     from a bug in your code, but it's possible that it was
    ;                     intentional (e.g., using an uninitialized variable and
    ;                     relying on the fact it is automatically initialized to an
    ;                     empty string)
    ; E_STRICT          - run-time notices, enable to have PHP suggest changes
    ;                     to your code which will ensure the best interoperability
    ;                     and forward compatibility of your code
    ; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
    ; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
    ;                     initial startup
    ; E_COMPILE_ERROR   - fatal compile-time errors
    ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
    ; E_USER_ERROR      - user-generated error message
    ; E_USER_WARNING    - user-generated warning message
    ; E_USER_NOTICE     - user-generated notice message
    ; E_DEPRECATED      - warn about code that will not work in future versions
    ;                     of PHP
    ; E_USER_DEPRECATED - user-generated deprecation warnings
    ;
    ; Common Values:
    ;   E_ALL (Show all errors, warnings and notices including coding standards.)
    ;   E_ALL & ~E_NOTICE  (Show all errors, except for notices)
    ;   E_ALL & ~E_NOTICE & ~E_STRICT  (Show all errors, except for notices and coding standards warnings.)
    ;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
    ; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
    ; Development Value: E_ALL
    ; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT
    ; http://php.net/error-reporting
    error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
    ; This directive controls whether or not and where PHP will output errors,
    ; notices and warnings too. Error output is very useful during development, but
    ; it could be very dangerous in production environments. Depending on the code
    ; which is triggering the error, sensitive information could potentially leak
    ; out of your application such as database usernames and passwords or worse.
    ; For production environments, we recommend logging errors rather than
    ; sending them to STDOUT.
    ; Possible Values:
    ;   Off = Do not display any errors
    ;   stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
    ;   On or stdout = Display errors to STDOUT
    ; Default Value: On
    ; Development Value: On
    ; Production Value: Off
    ; http://php.net/display-errors
    display_errors = Off
    ; The display of errors which occur during PHP's startup sequence are handled
    ; separately from display_errors. PHP's default behavior is to suppress those
    ; errors from clients. Turning the display of startup errors on can be useful in
    ; debugging configuration problems. We strongly recommend you
    ; set this to 'off' for production servers.
    ; Default Value: Off
    ; Development Value: On
    ; Production Value: Off
    ; http://php.net/display-startup-errors
    display_startup_errors = Off
    ; Besides displaying errors, PHP can also log errors to locations such as a
    ; server-specific log, STDERR, or a location specified by the error_log
    ; directive found below. While errors should not be displayed on productions
    ; servers they should still be monitored and logging is a great way to do that.
    ; Default Value: Off
    ; Development Value: On
    ; Production Value: On
    ; http://php.net/log-errors
    log_errors = On
    ; Set maximum length of log_errors. In error_log information about the source is
    ; added. The default is 1024 and 0 allows to not apply any maximum length at all.
    ; http://php.net/log-errors-max-len
    log_errors_max_len = 1024
    ; Do not log repeated messages. Repeated errors must occur in same file on same
    ; line unless ignore_repeated_source is set true.
    ; http://php.net/ignore-repeated-errors
    ignore_repeated_errors = Off
    ; Ignore source of message when ignoring repeated messages. When this setting
    ; is On you will not log errors with repeated messages from different files or
    ; source lines.
    ; http://php.net/ignore-repeated-source
    ignore_repeated_source = Off
    ; If this parameter is set to Off, then memory leaks will not be shown (on
    ; stdout or in the log). This has only effect in a debug compile, and if
    ; error reporting includes E_WARNING in the allowed list
    ; http://php.net/report-memleaks
    report_memleaks = On
    ; This setting is on by default.
    ;report_zend_debug = 0
    ; Store the last error/warning message in $php_errormsg (boolean). Setting this value
    ; to On can assist in debugging and is appropriate for development servers. It should
    ; however be disabled on production servers.
    ; Default Value: Off
    ; Development Value: On
    ; Production Value: Off
    ; http://php.net/track-errors
    track_errors = Off
    ; Turn off normal error reporting and emit XML-RPC error XML
    ; http://php.net/xmlrpc-errors
    ;xmlrpc_errors = 0
    ; An XML-RPC faultCode
    ;xmlrpc_error_number = 0
    ; When PHP displays or logs an error, it has the capability of formatting the
    ; error message as HTML for easier reading. This directive controls whether
    ; the error message is formatted as HTML or not.
    ; Note: This directive is hardcoded to Off for the CLI SAPI
    ; Default Value: On
    ; Development Value: On
    ; Production value: On
    ; http://php.net/html-errors
    html_errors = On
    ; If html_errors is set to On *and* docref_root is not empty, then PHP
    ; produces clickable error messages that direct to a page describing the error
    ; or function causing the error in detail.
    ; You can download a copy of the PHP manual from http://php.net/docs
    ; and change docref_root to the base URL of your local copy including the
    ; leading '/'. You must also specify the file extension being used including
    ; the dot. PHP's default behavior is to leave these settings empty, in which
    ; case no links to documentation are generated.
    ; Note: Never use this feature for production boxes.
    ; http://php.net/docref-root
    ; Examples
    ;docref_root = "/phpmanual/"
    ; http://php.net/docref-ext
    ;docref_ext = .html
    ; String to output before an error message. PHP's default behavior is to leave
    ; this setting blank.
    ; http://php.net/error-prepend-string
    ; Example:
    ;error_prepend_string = ""
    ; String to output after an error message. PHP's default behavior is to leave
    ; this setting blank.
    ; http://php.net/error-append-string
    ; Example:
    ;error_append_string = ""
    ; Log errors to specified file. PHP's default behavior is to leave this value
    ; empty.
    ; http://php.net/error-log
    ; Example:
    ;error_log = php_errors.log
    ; Log errors to syslog (Event Log on Windows).
    ;error_log = syslog
    ;windows.show_crt_warning
    ; Default value: 0
    ; Development value: 0
    ; Production value: 0
    ; Disable logging through FastCGI connection. PHP's default behavior is to enable
    ; this feature.
    ;fastcgi.logging = 0
    #35411
    AITpro Admin
    Keymaster

    @ David – Try this.  Edit the php.ini file and change ;error_log = php_errors.log to: error_log = /xxx/xxxxxxx/xxxx/wordpress/htdocs/wp-content/bps-backup/logs/bps_php_error.log and reboot your server. Note: remove/delete the semi-colon in front of the error_log directive.

    #35413
    David
    Participant

    Thanks very much – that fixed the problem.

    All the best – David

    #37026
    Walter Tengler
    Participant

    [Topic has been merged into this relevant Topic]

    Hello,

    need some help with this error 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.”

    Never had it on my other installs.

    thanks

    walter

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