PHP:语法错误,意外的“&"在第107行的/etc/php5/cli/php.ini中 [英] PHP: syntax error, unexpected '&' in /etc/php5/cli/php.ini on line 107

查看:268
本文介绍了PHP:语法错误,意外的“&"在第107行的/etc/php5/cli/php.ini中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将PHP 5.5.*升级到PHP 5.6.13.

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

如果有任何错误,我需要显示PHP脚本中的所有错误.所以我没有注释/etc/php5/cli/php.ini中的以下代码

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

它显示错误意外的&"在第107行".

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.

推荐答案

您不应该取消对此的评论,它具有参考意义.

You shouldn't be uncommenting that, its informational.

如果您希望所有错误都将这些行注释掉,然后环顾一下第445行.

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

设置error_reporting = E_ALL

如果要查看严格模式错误,请设置error_reporting = E_ALL & ~E_STRICT

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

确保之后重新启动Web服务器.

Make sure you restart your web server after.

请注意,请确保仅针对您的开发系统执行此操作.您不想在生产服务器上吐出通知和警告(甚至显示php错误).

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.

这篇关于PHP:语法错误,意外的“&"在第107行的/etc/php5/cli/php.ini中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆