PHP: syntax error, unexpected '&' in /etc/php5/cli/php.ini on line 107

假如想象 提交于 2019-12-31 07:26:12

问题


I have recently upgraded PHP 5.5.* to PHP 5.6.13.

I need to display all the errors in PHP scripts if there are any. So I have uncommented the following code in /etc/php5/cli/php.ini

error_reporting
   Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
   Development Value: E_ALL
   Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT

And it is showing the the error "unexpected '&' on line no 107".

I know there is something wrong with in my code and the nothing is displaying in browser while executing it.


回答1:


You shouldn't be uncommenting that, its informational.

If you want all errors comment those lines back out, and look around line 445.

Set error_reporting = E_ALL

If you want to see strict mode errors then set error_reporting = E_ALL & ~E_STRICT

Make sure you restart your web server after.

One additional note, make sure you only do this for your development system. You don't want to be spitting out notices and warnings (or even displaying php errors) on a production server.



来源:https://stackoverflow.com/questions/32901337/php-syntax-error-unexpected-in-etc-php5-cli-php-ini-on-line-107

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!