
php中的Error等级分成16类,用一个16位的数值表示这16种集合元素.下面是从php.ini中截取的:
; Error Level Constants: ; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) ; E_ERROR - fatal run-time errors ; E_RECOVERABLE_ERROR - almost fatal run-time errors ; E_WARNING - run-time warnings (non-fatal errors) ; E_PARSE - compile-time parse errors ; E_NOTICE - run-time notices (these are warnings which often result ; from a bug in your code, but it's possible that it was ; intentional (e.g., using an uninitialized variable and ; relying on the fact it is automatically initialized to an ; empty string) ; E_STRICT - run-time notices, enable to have PHP suggest changes ; to your code which will ensure the best interoperability ; and forward compatibility of your code ; E_CORE_ERROR - fatal errors that occur during PHP's initial startup ; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's ; initial startup ; E_COMPILE_ERROR - fatal compile-time errors ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) ; E_USER_ERROR - user-generated error message ; E_USER_WARNING - user-generated warning message ; E_USER_NOTICE - user-generated notice message ; E_DEPRECATED - warn about code that will not work in future versions ; of PHP ; E_USER_DEPRECATED - user-generated deprecation warnings ; ; Common Values: ; E_ALL (Show all errors, warnings and notices including coding standards.) ; E_ALL & ~E_NOTICE (Show all errors, except for notices) ; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) ; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
第一种方法:更改php.ini
PHP有好多php.ini文件,在根目录下搜索php.ini,会看到
那么应该配置哪一个呢?那就查看一下(有三种查看方式):
写一个haha.php
<?php phpinfo(); ?>
把它移到/var/www/html下,在浏览器打开之.
或者打开终端,输入php -f haha.php
或者不建文件,直接php -r <?php phpinfo(); ?>
可见,apache启动的时候只调用了/etc/php5/apache/下的设置文件
找到
发现好几个off,所以要打开之.编辑/etc/php5/apache2/php.ini
第二种方法:更改apache
Add the follow words in /etc/apache2/apache2.conf