Monday, March 17, 2014

How to display errors on PHP website (using UwAmp and XAMPP)

-----

How to display errors on PHP website (using UwAmp and XAMPP)

INTRODUCTION

PHP configuration is set in php.ini. You can easily find and set configuration properties using UwAmp GUI interface.

STEPS

1) Run UwAmp 2.2.1 Control Panel.
2) Click PHP Config.
Click PHP Setting tab.
Change the value to On.
Click OK.
Server will automatically restart.
3) In UwAmp Control Panel, click www folder button.
Copy-paste index.php as displayerror1.php
4) Edit displayerror1.php as follows:
<?php
echo $foo
echo $foo;
?>
5) Browse http://localhost .
You should get error message:
Parse error: syntax error, unexpected T_ECHO, expecting ',' or ';' in C:\UwAmp\www\displayerror1.php on line 3
6)
Repeat Step 2. This time set the display error value to Off.
Repeat Step 3 to 5.
Observe the outcome.

FURTHER EXERCISES



1) Copy the codes from http://alanstorm.com/php_error_reporting and test on your server.

No comments:

Post a Comment