Title: PHP Parse error
Last modified: May 25, 2018

---

# PHP Parse error

 *  Resolved [worldless](https://wordpress.org/support/users/worldless/)
 * (@worldless)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/php-parse-error-21/)
 * I had some similar PHP issues on 22-May-2018 ten days after the first one:
 * > > [22-May-2018 20:31:26 UTC] PHP Parse error: syntax error, unexpected end 
   > > of file in /public_html/wp-content/plugins/sucuri-scanner/src/fileinfo.lib.
   > > php on line 251
   > Line 251 : `&& $filterby === 'directory'`
   >     ```
   >                         /* check only directories */
   >                         if ($fifo->isDir()
   >                             && $filterby === 'directory'
   >                             && !$this->ignoreFolder($filepath)
   >                         ) {
   >                             $files[] = $filepath;
   >                             continue;
   >                         }
   >                     } catch (RuntimeException $e) {
   >                         SucuriScanEvent::reportCriticalEvent($e->getMessage());
   >                     }
   >     ```
   > 
 * > > [22-May-2018 20:31:27 UTC] PHP Parse error: syntax error, unexpected end 
   > > of file, expecting function (T_FUNCTION) in /public_html/wp-content/plugins/
   > > sucuri-scanner/src/hardening.lib.php on line 78
   > Line 78 doesn’t exit anymore and seems to have been updated but I guess it 
   > was referring to line 85 or so :
   > `public static function hardenDirectory($directory = '')`

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [worldless](https://wordpress.org/support/users/worldless/)
 * (@worldless)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/php-parse-error-21/#post-10323451)
 * I had another error on the same date. thought this might be related :
 * > [22-May-2018 23:06:18 UTC] PHP Warning: Error while sending QUERY packet. PID
   > =19030 in /public_html/wp-includes/wp-db.php on line 1924
 *  [yorman](https://wordpress.org/support/users/yorman/)
 * (@yorman)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/php-parse-error-21/#post-10325398)
 * Hello [@worldless](https://wordpress.org/support/users/worldless/) the errors
   from the first comment are produced by the PHP interpreter when the file is not
   fully read. There is no bug in the code that would cause this problem. I believe
   your web server, for some reason, was not able to read the entire file and when
   it passed it to the PHP interpreter the code was incomplete, that’s why it says_“[…]
   unexpected end of file”_.
 * The second error is not produced by this plugin. That error is talking about 
   packet loss in a SQL query. The plugin doesn’t make use of the database at all.
   You may want to investigate how much data is your website requesting from the
   data and/or increase the value of your `max_allowed_packet` setting.
 * I think both errors are produced by a misconfiguration of some settings in your
   web server and database engine. I encourage you to pass this information to your
   hosting provider and see if they can do something to help.
 *  Thread Starter [worldless](https://wordpress.org/support/users/worldless/)
 * (@worldless)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/php-parse-error-21/#post-10328645)
 * Thanks yorman for the info,
    So it’s a server side error, huh ? ok. I thought
   it was another one of those plugin issues that’s why I reported it. if it was
   a temporary error then I guess I’ll let it go for now.
 * I’ll mark this as resolved but I have a question out of curiosity:
 * Sucuri suggested to have directory listing (and some other options) disabled 
   in .htaccess using the following code:
 * `Options -Indexes`
 * and because the errors are related to directory, I was wondering to know if this
   might have something to do with the issue.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP Parse error’ is closed to new replies.

 * ![](https://ps.w.org/sucuri-scanner/assets/icon-256x256.png?rev=2875755)
 * [Sucuri Security - Auditing, Malware Scanner and Security Hardening](https://wordpress.org/plugins/sucuri-scanner/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/sucuri-scanner/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/sucuri-scanner/)
 * [Active Topics](https://wordpress.org/support/plugin/sucuri-scanner/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sucuri-scanner/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sucuri-scanner/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [worldless](https://wordpress.org/support/users/worldless/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/php-parse-error-21/#post-10328645)
 * Status: resolved