PHP errors not showing in browser [Ubuntu 10.10]

I am new to PHP and the entire LAMP stack, but I managed to run it and run it on my Ubuntu 10.10 system. Everything seems to work, except for flashing errors in the browser, which I just can't get to work (and which I can't work without!).

I read a number of articles and other threads that indicate that the following values ​​should be applied in the /etc/php5/apache2/php.ini file:

  • display_errors = On
  • display_startup_errors = On

I restarted apache2 and even restarted the computer, but for life I just can't get it to work. I even tried using the phpinfo() function, which reports that these parameters are set the way I installed them, so I know that it selects the correct configuration file, but nothing!

Any help would be appreciated.

+51
php apache apache2 lamp
Feb 19 '11 at 11:07
source share
11 answers

Don't just include the first occurrence of display_errors in your php.ini file. Make sure you scroll to the β€œreal” setting and change it from Off to On .

The fact is that if you agree to a change (for example, uncomment + add = On ) by the very first occurrence of display_errors , your changes will be overwritten somewhere in line 480, where it is again set to Off .

+52
Nov 24
source share

I had the same problem - it was solved by setting display_errors = On in both php.ini files.

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

Then restart Apache:

 sudo /etc/init.d/apache2 restart 

Hope this helps.

+37
Jan 20 2018-12-12T00:
source share

To do this, you must modify 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 

Find them as they are already defined and enter the desired value. Then restart the apache2 server and everything will work fine. Good luck

+35
Oct 07 '11 at 16:10
source share

After editing / etc / php 5 / apache2 / php.ini, be sure to restart apache.

You can do this by doing:

 sudo service apache2 restart 
+7
Mar 03 '11 at 20:38
source share

If you have local values ​​that override the basic values, you will not change its values ​​in php.ini find these variables in .htaccess or in the virtual host configuration file.

 ... php_admin_value display_errors On php_admin_value error_reporting E_ALL </VirtualHost> 

If you are editing vhost, restart apache,

$ sudo service apache2 restart

.htaccess editing does not require restarting apache

+2
Oct 07 '13 at
source share
  • First you need to find the path to the php.ini file
  • You will find the file at the specified path /etc/php/7.0/apache2/ . If you change the values ​​in the CLI folder or in the CGI folder, this will not work.
  • Make the following changes.

display_errors = On

  1. Restart Apache Server

/etc/init.d/apache2 restart

+2
Feb 27 '17 at 6:05
source share

See the error_reporting directive in php.ini.

0
Feb 19 '11 at 11:08
source share

Use the phpinfo(); function phpinfo(); to see the settings table in your browser and find

The path to the configuration file (php.ini)

and edit this file. Your computer may have several php.ini files, you want to edit the correct one.

Also check display_errors = On , html_errors = On and error_reporting = E_ALL inside this file

Restart Apache.

0
Jul 28 '17 at 3:44 on
source share

I was just stuck in the same problem when I realized that I was using the open short form of the tag:

 <? echo 'nothing will be print if no open_short_tag option is enabled'; ?> 

You need to go to the /etc/apache2/php.ini file and set short_open_tag = Off to On , then sudo service apache2 restart !

Hurrah!

-2
Apr 23 '14 at 17:47
source share

Try adding log_errors = Off and check the error_reporting parameter to see if it is set high enough.

-3
Feb 19 '11 at 11:09
source share

it must overlap, so it turns off. Try to open in a text editor and find display_errors and enable it. It works for me

-3
Jul 09 '15 at 13:38
source share



All Articles