错误解析错误:语法错误,意外的T_STRING,期待T_CONSTANT_ENCAPSED_STRING
问题描述:
我收到此错误:
解析错误:语法错误,意外的 T_STRING,在第 14 行的 [wordpress 目录]/wp-content/themes/[my-theme]/functions.php 中需要 T_CONSTANT_ENCAPSED_STRING 或 '('"
"Parse error: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in [wordpress dir]/wp-content/themes/[my-theme]/functions.php on line 14"
第 14 行只是一个简单的 use
命令...
And line 14 is just a simple use
command...
第 13-15 行:
add_action('headway_setup_child_theme', array('HeadwaySchematic', 'init'), 1);
use mfbcapthememobilebrowsertheme;
require_once 'mobilebrowsertheme.php';
这是在客户的网站上,它在我的测试网站上运行良好......不确定是什么导致了这个错误.
This is on a client's site and it works just fine on my test site....Not sure what would cause this error.
答
确保他们运行的是 PHP 5.3 或更高版本.如果他们运行的是早期版本,他们将不支持命名空间.
Make sure they are running PHP 5.3 or later. If they are running an earlier version they won't have support for namespaces.