Support » Plugin: Wordfence Security - Firewall & Malware Scan » Cannot complete full scan after upgraded to the latest version 6.3.8

  • Resolved adamngai


    Hi all, I am using free version of wordfence, in a result for the past scanning is fine until I have updated to the new version of wordfence…

    Error message as below;

    [May 06 11:26:23] Error writing value for wfsd_engine (MySQLi error: [2006] MySQL server has gone away)
    [May 06 11:26:23] Warning: Error while sending QUERY packet. PID=699506 in /home/xxxxx/public_html/ on line 1877

    I checked the wp-db.php, I can’t see what’s the missing part…

    * Internal function to perform the mysql_query() call.
    * @since 3.9.0
    * @access private
    * @see wpdb::query()
    * @param string $query The query to run.
    private function _do_query( $query ) {
    if ( defined( ‘SAVEQUERIES’ ) && SAVEQUERIES ) {

    if ( ! empty( $this->dbh ) && $this->use_mysqli ) {
    $this->result = mysqli_query( $this->dbh, $query );
    } elseif ( ! empty( $this->dbh ) ) {
    $this->result = mysql_query( $query, $this->dbh );

    if ( defined( ‘SAVEQUERIES’ ) && SAVEQUERIES ) {
    $this->queries[] = array( $query, $this->timer_stop(), $this->get_caller() );

    I have disable the database before I deactive and remove the plugin, reinstall wordfence again and input the same API and Token backup, scan as fresh but still failed… Seek for your review how can I solve the scanning error?

    Thanks in advance!

    • This topic was modified 2 years, 7 months ago by adamngai. Reason: reinstalled but failed
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @adamngai,

    This error indicates that the MySQL server timed out or received a packet that was too large or incorrect, and subsequently closed the connection.
    You can find a detailed explanation in the MySQL documentation.

    If you have access to that information, could you please check the values associated with the wait_timeout and max_allowed_packet parameters in your MySQL configuration file (my.cnf)

    I would also suggest you look into the MySQL error log file on your server in order to gather more information on what’s happening.

    Alternatively, you could try and increase the mysql.connect_timeout in your php.ini file.

    Hi @wfyann, I do not have access to mysql server, I tried to look the file (php.ini) but I couldn’t find mysql.connect_timeout… Any other way to solve it?

    Btw the following is some enhanced setting which I have done 3 weeks ago, and no issue with wf 6.3.7, only happen the stall issue after upgraded to 6.3.8… Btw I am using php7.1.3 and wp 4.7.4

    ; Resource Limits ;

    ; Maximum execution time of each script, in seconds
    ; Note: This directive is hardcoded to 0 for the CLI SAPI
    max_execution_time = 300

    ; Maximum amount of time each script may spend parsing request data. It’s a good
    ; idea to limit this time on productions servers in order to eliminate unexpectedly
    ; long running scripts.
    ; Note: This directive is hardcoded to -1 for the CLI SAPI
    ; Default Value: -1 (Unlimited)
    ; Development Value: 60 (60 seconds)
    ; Production Value: 60 (60 seconds)
    max_input_time = 120
    ; Maximum input variable nesting level
    ;max_input_nesting_level = 64

    ; How many GET/POST/COOKIE input variables may be accepted
    ; max_input_vars = 1000

    ; Maximum amount of memory a script may consume (128MB)
    memory_limit = 512M

    Hi @adamngai,

    I suppose that if it isn’t explicitly set in the php.ini file, the default value (60) will be used for mysql.connect_timeout.

    However, before you add this directive to your php.ini file, may I suggest you first try and adjust the Maximum execution time for each scan stage parameter?

    Hello adamngai!

    I hope we were successful in helping you resolve your issue with Wordfence! Since we have not heard back from you in the past 2 weeks I will now be marking this support thread as resolved. However, if we still haven’t resolved your issue please reach out to us as we would be more than happy to further assist you!

    Thanks and have a great day!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cannot complete full scan after upgraded to the latest version 6.3.8’ is closed to new replies.