Comments starting with '#' are deprecated in Unknown on line 1是因为php-fpm.ini里有#号注释引起的。 不指定

jackxiang 2016-3-8 23:25 | |
总之,这种情况主要还是因为php-fpm.conf或php.ini里有#号引起的,我发现尽管php-fpm.conf里用#号能注释,但是会有影响,
我之前安装的是PHP 5.6.18,在运行程序时往往运行nginx请求出现:Comments starting with '#' are deprecated in Unknown on line 1,
后来我再次安装低版本时默认启动没有问题,再将PHP 5.6.18里的php/etc/php-fpm.conf挪动回来后再启动就发生:Comments starting with '#' are deprecated in Unknown on line ,原来里面有一些以#号的中文注释导致的,如:

结论:尽量别用#号注释,php.conf和php-fpm.conf两个,一个是;注释,别用#号,另一个是尽量别用#号,一个#都不要留更好。

===========================================================================
ErrorException [ 8192 ]: Comments starting with '#' are deprecated in Unknown on line 1

find /usr/local/php/ -name "*.ini" -exec sed -i -re 's/^(\s*)#(.*)/\1;\2/g' {} \;
来自:http://stackoverflow.com/questions/29211550/track-down-php-error-comments-starting-with-are-deprecated-in-unknown-on-li


8192   E_DEPRECATED (integer)   运行时通知。启用后将会对在未来版本中可能无法正常工作的代码给出警告。   since PHP 5.3.0
错误码来自:http://www.jb51.net/article/47793.htm
应该是新版本的PHP出现的一个mysql推荐用mysqlli和pdo提示的问题,把错误关掉,再打开就好了,这块儿可能PHP还是有点问题:
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);//解决Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future:                                                                                                  
ini_set('display_startup_errors', 0);
ini_set('display_errors', 0);



I setup an Ubuntu system with nginx and php, but i noticed a strange error.

Every time i run something php related in the console i get this strange error:

PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0

I googled for some minutes and found why is that happening and how to fix it. The solution is open the file:

vi /etc/php5/cli/conf.d/ming.ini

and replace the “#” in the first line with “;” and that will fix the “warning”.


使用新立得装的PHP,但是每次我在命令行下执行php脚本时都会出如下的警告信息:

PHP Deprecated:  Comments starting with '#' are deprecated in /etc/php5/cli/conf.d/mcrypt.ini on line 1 in Unknown on line 0

上网查了一下,原来是新版本的PHP不赞成用'#'号作为注释符号,需要用分号';'。打开这个文件,把里面的#替换成;号,问题解决!

来自:http://blog.163.com/mity_rui@126/blog/static/109813618201522525339369/
http://www.r00t.gr/how-to-fix-php-deprecated-comments-starting-with-are-deprecated-in-etcphp5cliconf-dming-ini-on-line-1-in-unknown-on-line-0/

作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/8554/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!


最后编辑: jackxiang 编辑于2017-10-19 19:25
评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]