While working on Ubuntu, by default PHP error messages are disabled and while developing web application we need to enable debugging mode to better understand the error instead of blank screen.
Following are the step to solve this:
Step – 1:
Open terminal and type the following command to open the php.ini file
1 |
sudo nano /etc/php5/apache2/php.ini |
Step – 2:
Find the following line
1 |
display_errors = Off |
and replace with following line
1 |
display_errors = On |
Step – 3:
Now restart the Apache so that the new changes will take effect, enter the following command in your terminal
1 |
sudo /etc/init.d/apache2 restart |
now, you will be able to see PHP error messages in your PHP scripts.
Happy Coding!