开发者

how to open display_errors=on in LAMP5

im a php newbie. I just know I can modify php.ini(display_errors=on) in somewhere of开发者_JAVA百科 windows system

but linux also hava(php.ini)? sry, I try and i can't find it, anyone can help me? thx


Just write simple script and check for php.ini path

<?php
phpinfo();
?>

Here is the good tutorial: http://www.php-scripts.com/20050909/8/


<?php phpinfo(); ?> will display (among other things) location of your php.ini file


While developing use the following code at the top of your php files:

ini_set('display_errors', 1);
error_reporting(E_ALL);

When ready for production :

ini_set('display_errors', 0);

This way, you don't need to modify the php.ini.


Within Linux this will normally be:

/etc/php5/apache2/php.ini (if you are using PHP5, and Apache)

/etc/php5/cli/php.ini (if you are using PHP5 running on the command line).

Other common locations are:

/etc/php.ini
/etc/php/apache2/php.ini
/etc/php/cli/php.ini

Best way is to create a PHP File with:

<?php phpinfo(); ?>

and open this file using Apache2/CLI and this will display the php.ini file.

Or add the following to the top of your PHP File:

ini_set('display_errors', 1);
error_reporting(E_ALL);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜