Title: PHP Parse error: syntax error, unexpected &#8216;?&#8217;, expecting variable (T_VARIABLE)
Last modified: June 22, 2026

---

# PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE)

 *  [SRD75](https://wordpress.org/support/users/srd75/)
 * (@srd75)
 * [5 hours, 50 minutes ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-expecting-variable-t_variable-2/)
 * Hi
 * Our site has a white screen of death.
 * error_log has:
 *     ```wp-block-code
       PHP Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /public_html/wp-includes/compat-utf8.php on line 47
       ```
   
 * I’ve uploaded `WP 7.0` and replaced `wp-admin,` `wp-includes`, and all files 
   in the web root, but the issue remains.
 * I’ve tried different versions of PHP, I’ve tried moving all plugins to temp folders,
   I’ve replaced the Twenty Seventeern theme, the issue remains.
 * This error goes back to 15th of June 2026.
 * Help appreciated.

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

 *  Moderator [Yui](https://wordpress.org/support/users/fierevere/)
 * (@fierevere)
 * 永子
 * [4 hours, 36 minutes ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-expecting-variable-t_variable-2/#post-18944713)
 * are you using PHP 7.4 or greater ?
 *  Thread Starter [SRD75](https://wordpress.org/support/users/srd75/)
 * (@srd75)
 * [4 hours, 31 minutes ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-expecting-variable-t_variable-2/#post-18944723)
 * Hi!
   We’re using PHP 8.5.I tried all versions between PHP 7.4 and 8.5, error remains.
 * I increased the memory limit from 124M to 2G, error remains.
 *  Moderator [Yui](https://wordpress.org/support/users/fierevere/)
 * (@fierevere)
 * 永子
 * [4 hours, 24 minutes ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-expecting-variable-t_variable-2/#post-18944731)
 * Do you have all the required extensions?
   [https://make.wordpress.org/hosting/handbook/server-environment/](https://make.wordpress.org/hosting/handbook/server-environment/)
 * notably: mbstring (with iconv) enabled?
 *  Thread Starter [SRD75](https://wordpress.org/support/users/srd75/)
 * (@srd75)
 * [4 hours, 19 minutes ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-expecting-variable-t_variable-2/#post-18944736)
 * Yes
 * mbstring (with iconv) are enabled.
 * I can’t see a list of required PHP extensions at [https://make.wordpress.org/hosting/handbook/server-environment/](https://make.wordpress.org/hosting/handbook/server-environment/)
    -  This reply was modified 4 hours, 18 minutes ago by [SRD75](https://wordpress.org/support/users/srd75/).
 *  Moderator [Yui](https://wordpress.org/support/users/fierevere/)
 * (@fierevere)
 * 永子
 * [2 hours, 9 minutes ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-expecting-variable-t_variable-2/#post-18944888)
 * [https://make.wordpress.org/hosting/handbook/server-environment/#php-extensions](https://make.wordpress.org/hosting/handbook/server-environment/#php-extensions)
   
   jsonmysqlimbstringcurldomhashxmlgd (+imagick)see also recommended extensions,
   they are often required for proper functionality of plugins and performance issuesAlso
   make sure that HealthCheck does return proper PHP version, or create a phpinfo.
   php file in the root of your site with contents`<?php phpinfo();?>
 * open browser and go to your site/phpinfo.php
 * (you can later delete this file for security reasons)
 * and make sure it returns proper PHP version and extensions listed (running php–
   version and php -i from server command prompt using different SAPI and can be
   completely another version)

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-parse-error-syntax-error-unexpected-expecting-variable-t_variable-2%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [Yui](https://wordpress.org/support/users/fierevere/)
 * Last activity: [2 hours, 9 minutes ago](https://wordpress.org/support/topic/php-parse-error-syntax-error-unexpected-expecting-variable-t_variable-2/#post-18944888)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
