[php] PHP errors NOT being displayed in the browser [Ubuntu 10.10]

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 /etc/php5/apache2/php.ini:

  • 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.

This question is related to php apache apache2 lamp ubuntu-10.10

The answer is

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 Off to On.

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 Off again.

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


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

  1. First you need to find the path to the php.ini file
  2. You will find the file in the specified path /etc/php/7.0/apache2/. If you are changing the values in the CLI folder or the CGI folder it will not work.
  3. Make the following changes

display_errors = On

  1. Restart you apache server

/etc/init.d/apache2 restart

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

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 

2). find display_errors in that file

3). Un-comment these lines of code
      Default Value: On
      Development Value: On
      Production Value: Off

      Default Value: Off
      Development Value: On
      Production Value: Off

      Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
      Development Value: E_ALL
      Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT

      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

Use the 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.

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

Restart Apache.

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 On, then sudo service apache2 restart!


Try adding log_errors = Off and check the error_reporting setting whether it's set high enough.

Questions with php tag:

I am receiving warning in Facebook Application using PHP SDK Pass PDO prepared statement to variables Parse error: syntax error, unexpected [ Preg_match backtrack error Removing "http://" from a string How do I hide the PHP explode delimiter from submitted form results? Problems with installation of Google App Engine SDK for php in OS X Laravel 4 with Sentry 2 add user to a group on Registration php & mysql query not echoing in html with tags? How do I show a message in the foreach loop? Target class controller does not exist - Laravel 8 Message: Trying to access array offset on value of type null Array and string offset access syntax with curly braces is deprecated Visual Studio Code PHP Intelephense Keep Showing Not Necessary Error How to fix "set SameSite cookie to none" warning? The POST method is not supported for this route. Supported methods: GET, HEAD. Laravel Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac What does double question mark (??) operator mean in PHP Post request in Laravel - Error - 419 Sorry, your session/ 419 your page has expired PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client php mysqli_connect: authentication method unknown to the client [caching_sha2_password] Converting a POSTMAN request to Curl Composer require runs out of memory. PHP Fatal error: Allowed memory size of 1610612736 bytes exhausted Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required Issue in installing php7.2-mcrypt Xampp localhost/dashboard How can I run specific migration in laravel How to change PHP version used by composer Laravel 5 show ErrorException file_put_contents failed to open stream: No such file or directory Artisan migrate could not find driver phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO) Ajax LARAVEL 419 POST error Laravel 5.5 ajax call 419 (unknown status) laravel 5.5 The page has expired due to inactivity. Please refresh and try again "The page has expired due to inactivity" - Laravel 5.5 How to increment a letter N times per iteration and store in an array? Can't install laravel installer via composer Only on Firefox "Loading failed for the <script> with source" Is there way to use two PHP versions in XAMPP? How to prevent page from reloading after form submit - JQuery laravel Eloquent ORM delete() method No Application Encryption Key Has Been Specified General error: 1364 Field 'user_id' doesn't have a default value How to logout and redirect to login page using Laravel 5.4? How to uninstall an older PHP version from centOS7 How to Install Font Awesome in Laravel Mix PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers Laravel - htmlspecialchars() expects parameter 1 to be string, object given How to downgrade php from 7.1.1 to 5.6 in xampp 7.1.1?

Questions with apache tag:

Enable PHP Apache2 Switch php versions on commandline ubuntu 16.04 Laravel: PDOException: could not find driver How to deploy a React App on Apache web server Apache POI error loading XSSFWorkbook class How to enable directory listing in apache web server Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details How to enable php7 module in apache? java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing while starting Apache server on my computer WAMP won't turn green. And the VCRUNTIME140.dll error MySQL error - #1932 - Table 'phpmyadmin.pma user config' doesn't exist in engine SSL error SSL3_GET_SERVER_CERTIFICATE:certificate verify failed resource error in android studio after update: No Resource Found XAMPP keeps showing Dashboard/Welcome Page instead of the Configuration Page Getting a 500 Internal Server Error on Laravel 5+ Ubuntu 14.04 installing apache: no VCRUNTIME140.dll Could not load the Tomcat server configuration How to add Apache HTTP API (legacy) as compile-time dependency to build.grade for Android M? Apache Server (xampp) doesn't run on Windows 10 (Port 80) How to set up file permissions for Laravel? Chrome net::ERR_INCOMPLETE_CHUNKED_ENCODING error How to allow Cross domain request in apache2 Getting Error:JRE_HOME variable is not defined correctly when trying to run startup.bat of Apache-Tomcat Netbeans 8.0.2 The module has not been deployed Only variable references should be returned by reference - Codeigniter laravel the requested url was not found on this server httpd-xampp.conf: How to allow access to an external IP besides localhost? WebSockets and Apache proxy : how to configure mod_proxy_wstunnel? How to force reloading php.ini file? XAMPP: Couldn't start Apache (Windows 10) how to create virtual host on XAMPP phpmyadmin "Not Found" after install on Apache, Ubuntu XAMPP installation on Win 8.1 with UAC Warning Httpd returning 503 Service Unavailable with mod_proxy for Tomcat 8 how to configure apache server to talk to HTTPS backend server? How to fix PHP Warning: PHP Startup: Unable to load dynamic library 'ext\\php_curl.dll'? error running apache after xampp install How to enable local network users to access my WAMP sites? Apache Proxy: No protocol handler was valid OSError - Errno 13 Permission denied Project Links do not work on Wamp Server WAMP Cannot access on local network 403 Forbidden Apache 2.4 - Request exceeded the limit of 10 internal redirects due to probable configuration error How to enable CORS in apache tomcat Apache won't start in wamp Execute PHP script in cron job "End of script output before headers" error in Apache Starting of Tomcat failed from Netbeans Tomcat in Intellij Idea Community Edition

Questions with apache2 tag:

Only variable references should be returned by reference - Codeigniter 413 Request Entity Too Large - File Upload Issue Site does not exist error for a2ensite How to convert .pem into .key? Apache: Restrict access to specific source IP inside virtual host CodeIgniter removing index.php from url Failed Apache2 start, no error log Apache2: 'AH01630: client denied by server configuration' what does it mean "(include_path='.:/usr/share/pear:/usr/share/php')"? How to check is Apache2 is stopped in Ubuntu? Decrypt password created with htpasswd How to run multiple sites on one apache instance htaccess <Directory> deny from all How to reload apache configuration for a site without restarting apache? Apache won't follow symlinks (403 Forbidden) Could not reliably determine the server's fully qualified domain name How to enable loglevel debug on Apache2 server ini_set("memory_limit") in PHP 5.3.3 is not working at all PHP errors NOT being displayed in the browser [Ubuntu 10.10] Configure apache to listen on port other than 80 Correct owner/group/permissions for Apache 2 site files/folders under Mac OS X? .htaccess File Options -Indexes on Subdirectories How to determine if OpenSSL and mod_ssl are installed on Apache2 Windows could not start the Apache2 on Local Computer - problem How can I implement rate limiting with Apache? (requests per second)

Questions with lamp tag:

How to enable SOAP on CentOS What is Options +FollowSymLinks? ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) What is a LAMP stack? How do I change the root directory of an Apache server? PHP errors NOT being displayed in the browser [Ubuntu 10.10] How can I enable cURL for an installed Ubuntu LAMP stack? PDOException “could not find driver” How can one run multiple versions of PHP 5.x on a development LAMP server? How do I convert a PDF document to a preview image in PHP? Why use deflate instead of gzip for text files served by Apache?

Questions with ubuntu-10.10 tag:

How do I run Google Chrome as root? no module named zlib PHP errors NOT being displayed in the browser [Ubuntu 10.10] Missing include "bits/c++config.h" when cross compiling 64 bit program on 32 bit in Ubuntu