Enable the php error prompt of lamp under ubuntu
The default lamp mode under ubuntu does not have php syntax error prompt. If you want to enable it, you need to modify a few places:
1. Open the php.ini file.
This file is in the /etc/php5/apache2 directory. You need to modify the permissions of this file to write.
<ol> <li><span><span>sudo chmod 777 /etc/php5/apache2/php.ini </span></span></li> <li><span> </span></li> </ol>
2. Search and modify the following line, change the Off value to On
<ol> <li><span><span></span><span>display_errors</span><span> = </span><span>Off</span><span> </span></span></li> <li><span> </span></li> </ol>
3. Search for the following line
<ol> <li><span><span></span><span>error_reporting</span><span> = </span><span>E_ALL</span><span> & ~E_NOTICE </span></span></li> <li><span> </span></li> </ol>
or search:
<ol> <li><span><span></span><span>error_reporting</span><span> = </span><span>E_ALL</span><span> & ~E_DEPRECATED </span></span></li> <li><span> </span></li> </ol>
and modify it to
<ol> <li><span><span></span><span>error_reporting</span><span> = </span><span>E_ALL</span><span> | E_STRICT </span></span></li> <li><span> </span></li> </ol>
4. Modify Apache’s httpd.conf,
this file In the /etc/apache2/ directory, this is a blank file. This file also needs to be modified with permissions.
<ol> <li><span><span>sudo chmod 777 /etc/apache2/ httpd.conf </span></span></li> <li><span> </span></li> </ol>
Add the following two lines:
<ol> <li><span><span>php_flag display_errors on </span></span></li> <li><span> </span></li> <li><span>php_value error_reporting 2039 </span></li> <li><span> </span></li> </ol>
5. Restart Apache and it will be OK.
Restart command:
<ol> <li><span><span>sudo /etc/init.d/apache2 restart </span></span></li> <li><span> </span></li> </ol>
ok! The error message is successfully enabled! The above is how to turn on the PHP error prompt of LAMP under Ubuntu.
The above introduces the PHP error prompt when turning on lamp under Ubuntu, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.