php开启与关闭错误提示,php开启错误提示
php开启与关闭错误提示,php开启错误提示
windows系统开关php错误提示
如果不具备修改php.ini的权限,可以将如下代码加入php文件中:
代码如下 复制代码
ini_set("display_errors", "On");
error_reporting(E_ALL | E_STRICT);
当然,如果能够修改php.ini的话,如下即可:
代码如下 复制代码
找到display_errors = On 修改为 display_errors = off
注意:如果你已经把PHP.ini文件复制到windows目录下,那么必须同时把c:windows/php.ini里的display_errors = On 修改为display_errors = off
PHP .ini中display_errors = Off失效的解决
在linux系统中开启与关闭错误提示方法差不多,不过我还是具体给大家介绍一下
linux系统下
1. 打开php.ini文件。
以我的ubuntu为例,这个文件在: /etc/php5/a(www.111cn.net)pache2 目录下。
2. 搜索并修改下行,把Off值改成On
代码如下 复制代码
display_errors = Off
3. 搜索下行
代码如下 复制代码
error_reporting = E_ALL & ~E_NOTICE
或者搜索:
error_reporting = E_ALL & ~E_DEPRECATED
修改为
error_reporting = E_ALL | E_STRICT
4. 修改Apache的 httpd.conf,
以我的 Ubuntu 为例, 这个文件在:/etc/apache2/ 目录下,这是一个空白文件。
添加以下两行:
代码如下 复制代码
php_flag display_errors on
php_value error_reporting 2039
5. 重启Apache,就OK了。
重启命令: :
代码如下 复制代码
sudo /etc/init.d/apache2 restart
from:http://www.111cn.net/phper/php/53795.htm
php.ini
里面设置display_errors = On 开启错误提示,error_reporting = E_ALL & ~E_NOTICE 设置错误等级。也可以在php文件中
ini_set('display_errors', 1);//设置开启错误提示
error_reporting('E_ALL & ~E_NOTICE ');//错误等级提示
1、
可能你php.ini文件找错位置了,通过输出phpinfo()函数,获取 Loaded Configuration File 对应的文件,修改这个文件
2、
程序中可能设置了 error_reporting(0);
将这段代码注视掉
参考资料:www.phper163.com

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

In PHP8, match expressions are a new control structure that returns different results based on the value of the expression. 1) It is similar to a switch statement, but returns a value instead of an execution statement block. 2) The match expression is strictly compared (===), which improves security. 3) It avoids possible break omissions in switch statements and enhances the simplicity and readability of the code.

In PHP, you can effectively prevent CSRF attacks by using unpredictable tokens. Specific methods include: 1. Generate and embed CSRF tokens in the form; 2. Verify the validity of the token when processing the request.

In PHP, the final keyword is used to prevent classes from being inherited and methods being overwritten. 1) When marking the class as final, the class cannot be inherited. 2) When marking the method as final, the method cannot be rewritten by the subclass. Using final keywords ensures the stability and security of your code.

Solving the problem of slow Photoshop startup requires a multi-pronged approach, including: upgrading hardware (memory, solid-state drive, CPU); uninstalling outdated or incompatible plug-ins; cleaning up system garbage and excessive background programs regularly; closing irrelevant programs with caution; avoiding opening a large number of files during startup.

How to implement Windows-like in front-end development...

How to distinguish between closing tabs and closing entire browser using JavaScript on your browser? During the daily use of the browser, users may...

The... (splat) operator in PHP is used to unpack function parameters and arrays, improving code simplicity and efficiency. 1) Function parameter unpacking: Pass the array element as a parameter to the function. 2) Array unpacking: Unpack an array into another array or as a function parameter.
