PHP中显示出错提示方法介绍

php.ini配置

php.ini配置中与此相关的有两个配置变量,下面是这两个变量及其默认值,以下是引用片段:

display_errors = Off

error_reporting = E_ALL & ~E_NOTICE

display_errors 变量的目的很明显 —— 它告诉PHP是否显示错误。默认值是 Off。现在我们的目的是显示错误提示,那么:

display_errors = On

E_ALL,这个设置会显示从不良编码实践到无害提示到出错的所有信息,E_ALL 对于开发过程来说有点太细,因为它连变量未初始化也显示提示,而这一点正是PHP“高级”的一个特征。幸好,error_reporting的默认值是“E_ALL & ~E_NOTICE”,这样就只看到错误和不良编码了,对程序无不利的提示则不会显示。

修改php.ini后需要重新启动Apache,这样才可以在apache中生效,当然你如果只在命令行下测试程序,是不需要这一步的。

显示值,宏定义:

1 E_ERROR

2 E_WARNING

4 E_PARSE

8 E_NOTICE

16 E_CORE_ERROR

32 E_CORE_WARNING

64 E_COMPILE_ERROR

128 E_COMPILE_WARNING

256 E_USER_ERROR

512 E_USER_WARNING

1024 E_USER_NOTICE

6143 E_ALL

2048 E_STRICT

4096 E_RECOVERABLE_ERROR

波比源码 – 精品源码模版分享 | www.bobi11.com
1. 本站所有资源来源于用户上传和网络,如有侵权请邮件联系站长!
2. 分享目的仅供大家学习和交流,您必须在下载后24小时内删除!
3. 不得使用于非法商业用途,不得违反国家法律。否则后果自负!
4. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
5. 如有链接无法下载、失效或广告,请联系管理员处理!
6. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
7. 本站源码并不保证全部能正常使用,仅供有技术基础的人学习研究,请谨慎下载
8. 如遇到加密压缩包,请使用WINRAR解压,如遇到无法解压的请联系管理员!

波比源码 » PHP中显示出错提示方法介绍

173 评论

  1. purchase modafinil online diamox 250mg usa order generic acetazolamide

  2. order provera 10mg pills cheap microzide periactin 4mg price

  3. order lopressor 100mg pill atenolol 50mg us levitra 10mg without prescription

  4. order generic losartan buy nexium pills buy topiramate for sale

  5. imitrex order imitrex usa order dutasteride without prescription

  6. simvastatin 10mg over the counter brand simvastatin finasteride 5mg pills

  7. buy ceftin 500mg without prescription order careprost online buy methocarbamol 500mg generic

  8. purchase tiotropium bromide terazosin brand buy hytrin online cheap

  9. real money games money slots blackjack poker online

  10. lanoxin pill micardis usa molnunat 200mg generic

  11. order fosamax 35mg online ibuprofen uk order ibuprofen 600mg sale

  12. order tadalafil 40mg pill online ed pills best pill for ed

  13. buy modafinil 100mg generic zestril 2.5mg oral metoprolol 100mg over the counter

  14. penn state thesis thesis length lord of the flies thesis statement

  15. avlosulfon 100 mg cost dapsone uk order tenormin 100mg for sale

  16. uroxatral 10 mg sale trazodone cost buy diltiazem online

  17. buy generic cialis cialis 40mg cheap buy erectile dysfunction medication

  18. buy ivermectin 12 mg order stromectol isotretinoin online order

  19. buy generic ipratropium zyvox online order linezolid 600 mg for sale

  20. quetiapine dose range seroquel benzo side effects of seroquel withdrawal

  21. order tadalafil pill cheap cialis pill buy sildenafil without prescription

  22. omeprazole generic for prilosec effects of prilosec omeprazole 20 mg capsule delayed release

  23. purchase careprost without prescription trazodone 50mg usa desyrel 100mg cheap

发表评论

Hi, 如果你对这款模板有疑问,可以跟我联系哦!

联系站长
赞助VIP 享更多特权,建议使用 QQ 登录
喜欢我嘛?喜欢就按“ctrl+D”收藏我吧!♡