【发布时间】:2014-04-06 12:01:02
【问题描述】:
我正在开发的 WordPress 主题有问题,需要您的帮助。 当我尝试在单独的文件中移动我的函数时,我得到一个奇怪的 PHP 错误。 所以当我改变这个时:
//file: functions.php
function function1(){
...
}
require_once('functions/other_functions.php');
到这里:
//file: functions.php
require_once('functions/the_functions.php');
require_once('functions/other_functions.php');
//file: functions/the_functions.php
<?php
function function1(){
...
}
?>
我得到一个错误说:
解析错误:语法错误,意外的 T_STRING in 第 1 行的函数/the_functions.php
此错误仅在空文件或此文件时停止
//file: functions/the_functions.php
<?php
?>
该错误仅出现在具有 Light 服务器和 PHP 5.3.28 的基于 Linux 的服务器上,并且在以下情况下完美运行: 带有 Apache PHP 5.4.16 的 Windows 服务器,以及带有 Apache 和 PHP 5.3.10 的 Linux 服务器
【问题讨论】:
-
function1(){正在尝试调用函数 1。你会想要function function1() { ... }
标签: php wordpress wordpress-theming entity-relationship lighttpd