Resolving the 'Parse error: syntax error, unexpected ')' in admin-display.cls.php' After LiteSpeed Cache Update
Content
Several users have reported their websites going offline after an automatic update of the LiteSpeed Cache plugin, displaying a critical error: Parse error: syntax error, unexpected ‘)’ in /wp-content/plugins/litespeed-cache/src/admin-display.cls.php on line 361. This article explains the likely cause and provides steps to resolve the issue.
What Causes This Error?
This parse error is a PHP syntax error. It typically indicates that the plugin files on the server became corrupted during the update process. While the error points to a specific line and character, the root cause is often an incomplete file transfer or a conflict during the auto-update procedure, resulting in a broken file.
How to Fix It
Since the error prevents access to the WordPress admin area, you will need to act on the server level. The following methods are the most common and effective solutions.
Method 1: Reinstall the Plugin Manually (Recommended)
This is the most reliable fix, as confirmed by users in the community.
- Access your server via FTP, SFTP, or your hosting provider's file manager.
- Navigate to the
/wp-content/plugins/directory. - Delete the entire
litespeed-cachefolder. This will remove the corrupted files. Your plugin settings are stored in the database and will be preserved. - Reinstall a fresh copy of the plugin. You can do this in two ways:
- Via WordPress Admin: After deleting the files, visit your website's admin area. It should now be accessible. Go to Plugins > Add New, search for "LiteSpeed Cache," and install it.
- Manually Upload: Download the latest version from the WordPress plugin repository. Extract the ZIP file and upload the new
litespeed-cachefolder to your/wp-content/plugins/directory.
- Once reinstalled, activate the plugin. Your previous settings should still be active.
Method 2: Temporarily Disable the Plugin via File System
If you cannot immediately reinstall the plugin, this method will bring your site back online.
- Access your server via FTP/SFTP or file manager.
- Navigate to the
/wp-content/plugins/directory. - Rename the
litespeed-cachefolder to something likelitespeed-cache-off. This will deactivate the plugin. - Your site should now load. You can then proceed with a clean reinstallation (Method 1) at your convenience.
Preventing Future Occurrences
While automatic updates are convenient, they can sometimes fail. For mission-critical websites, consider implementing a staging environment where you can test plugin updates before applying them to your live site.
If the problem persists across multiple sites after a clean reinstall, it may be helpful to check if your server's PHP version is compatible with the latest version of the LiteSpeed Cache plugin. The plugin team provides information about requirements in their documentation.
Related Support Threads Support
-
Litespeed Parse error: syntax error, unexpected ‘)’https://wordpress.org/support/topic/litespeed-parse-error-syntax-error-unexpected-2/
-
How to Configure Litespeed Cache on Nginx Server (htaccess not present)https://wordpress.org/support/topic/how-to-configure-litespeed-cache-on-nginx-server-htaccess-not-present/
-
Uncaught SyntaxError: Invalid or unexpected tokenhttps://wordpress.org/support/topic/uncaught-syntaxerror-invalid-or-unexpected-token-15/
-
Litespeed Parse error: syntax error, unexpected ‘)’https://wordpress.org/support/topic/litespeed-parse-error-syntax-error-unexpected-3/
-
Missing information on AVIF optimization creditshttps://wordpress.org/support/topic/missing-information-on-avif-optimization-credits/
-
No hit with crawled pageshttps://wordpress.org/support/topic/no-hit-with-crawled-pages/
-
litespeed_purge is not working with wp-cli commandhttps://wordpress.org/support/topic/litespeed_purge-is-not-working-with-wp-cli-command/
-
Crawler port_test_failedhttps://wordpress.org/support/topic/crawler-port_test_failed/
-
ESI shortcodes doesn’t show in default languagehttps://wordpress.org/support/topic/esi-shortcodes-doesnt-show-in-default-language/
-
LiteSpeed Crawler attempts to crawl deleted images from Divi Theme Builder revishttps://wordpress.org/support/topic/litespeed-crawler-attempts-to-crawl-deleted-images-from-divi-theme-builder-revis/
-
Elementor Header / Mobile Menu FOUC Issue with LiteSpeed Cachehttps://wordpress.org/support/topic/elementor-header-mobile-menu-fouc-issue-with-litespeed-cache/
-
ajax search not workhttps://wordpress.org/support/topic/ajax-search-not-work-2/
-
LSCache and language condition not workinghttps://wordpress.org/support/topic/lscache-and-language-condition-not-working/
-
How do I ignore UCSS on the homepage?https://wordpress.org/support/topic/how-do-i-ignore-ucss-on-the-homepage/
-
Facing Render blocking requests Est savings of 3,560 mshttps://wordpress.org/support/topic/facing-render-blocking-requests-est-savings-of-3560-ms/