I'm new to PHP and the whole LAMP stack but I've managed to get it up and running on my Ubuntu 10.10 system. Everything seems to be working with the exception of error reposting in the browser which I just can't seem to get working (and which I can't work without!).
I've read a number of article and other threads which indicate that the following values should be applied in the file
display_errors = On
display_startup_errors = On
I've restarted apache2 and even restarted my computer but for the life of me I just can't get it working. I've even tried using
phpinfo() function which reports that these settings are as I've set them so I know it's picking up the correct configuration file but nothing!
Any help would be welcome.
Don't just enable the first occurrence of
display_errors in the php.ini file. Make sure you scroll down to the "real" setting and change it from
The thing is that if you settle with changing (i.e. uncomment + add
= On) by the very first occurrence of
display_errors your changes will be overwritten somewhere on line 480 where it's set to
I had the same problem - solved it by setting
display_errors = On in both
Then restarting Apache:
sudo /etc/init.d/apache2 restart
Hope this helps.
To make it work you should change the following variables in your php.ini:
; display_errors ; Default Value: On ; Development Value: On ; Production Value: Off ; display_startup_errors ; Default Value: On ; Development Value: On ; Production Value: Off ; error_reporting ; Default Value: E_ALL & ~E_NOTICE ; Development Value: E_ALL | E_STRICT ; Production Value: E_ALL & ~E_DEPRECATED ; html_errors ; Default Value: On ; Development Value: On ; Production value: Off ; log_errors ; Default Value: On ; Development Value: On ; Production Value: On
Search for them as they are already defined and put your desired value. Then restart your apache2 server and everything will work fine. Good luck!
After you edit /etc/php5/apache2/php.ini be sure to restart apache.
You can do so by running:
sudo service apache2 restart
display_errors = On
If you have Local Values overriding master values, you won't change its values in php.ini take a look for those variables in a .htaccess or in the virtual-host config file.
... php_admin_value display_errors On php_admin_value error_reporting E_ALL </VirtualHost>
If you edit vhost, restart apache,
$ sudo service apache2 restart
.htaccess edits don't need apache to restart
Follow the below steps,
1). Open your php.ini file via sublime through path /etc/php/7.2/apache2/php.ini 2). find display_errors in that file 3). Un-comment these lines of code display_errors Default Value: On Development Value: On Production Value: Off display_startup_errors Default Value: Off Development Value: On Production Value: Off error_reporting Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED Development Value: E_ALL Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT html_errors Default Value: On Development Value: On Production value: On 4). Save the file and then type the following command in the terminal sudo service apache2 restart your errors are now showing in the browser
phpinfo(); function to see the table of settings on your browser and look for the
Configuration File (php.ini) Path
and edit that file. Your computer can have multiple php.ini files, you want to edit the right one.
display_errors = On,
html_errors = On and
error_reporting = E_ALL inside that file
Look at error_reporting directive in php.ini.
it's should overlap, so it turned off. Try to open in your text editor and find
display_errors and turn it on. It works for me
I was just stuck on the same issue, when I've realized that I was using the open short tag form:
<? echo 'nothing will be print if no open_short_tag option is enabled'; ?>
You have to go to your
/etc/apache2/php.ini file and set the
short_open_tag = Off to
sudo service apache2 restart!
Try adding log_errors = Off and check the error_reporting setting whether it's set high enough.