PHP 相关问题


将php.ini中displayerrors = off 设置为 displayerrors = on,表示将错误信息输出到用户端,

再将errorreporting设置为errorreporting = EALL & ~ENOTICE 表示将输出错误类型设置为输出所有的错误,除了提示。

2.Parse error: syntax error, unexpected '}'错误修复

将php.ini中的shortopentag = Off 设置成 shortopentag = On 就OK了!

shortopentag 解释:

This directive determines whether or not PHP will recognize code between tags as PHP source which should be processed as such. It's been recommended for several years that you not use the short tag "short cut" and instead to use the full tag combination. With the wide spread use of XML and use of these tags by other languages, the server can become easily confused and end up parsing the wrong code in the wrong context. But because this short cut has been a feature for such a long time, it's currently still supported for backwards compatibility, but we recommend you don't use them. Default Value: On Development Value: Off Production Value: Off