php开启与关闭错误提示
在php中开启与关闭错误提示的方法有几种一种可以直接在程序中使用相关函数来开户,另一种我们可以使用php.ini中配置参数来控制,下面小编来给各位同学介绍一下。
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/apache2 目录下。
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 |
5. 重启Apache,就OK了。
重启命令: :
代码如下 | 复制代码 |
sudo /etc/init.d/apache2 restart |

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

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

Validator can be created by adding the following two lines in the controller.
