Disable Error Reporting Php Ubuntu
Contents |
ago mjwittering Like me you maybe using an Ubuntu computer running Apache, MySQL and PHP to develop websites. When disable error reporting php ini developing it is important to see error messages to debug your
Disable Php Error Reporting Htaccess
code. On occasion I have installed PHP on to Ubuntu computers and by default errors are not how to stop error reporting in php displayed. As this is not a production web server I updated the php.ini file to display errors. In this post I explain how I updated the php.ini
Ubuntu Php Display Errors
to display error messages and aid debugging. Open php.ini Start by opening a new terminal window to open the php.ini file. Modifying the php.ini will allow you to tunes the setting to enable more descriptive error messages, logging, and better performance. Enter the following command to begin editing php.ini. This will require the sudo command and turn on error reporting php ubuntu therefore administrator privileges. sudo nano /etc/php5/apache2/php.ini Display Errors Now scroll down through the file until you find the following line. display_errors = Off Once you have found the display_errors line replace the parameter 'Off' with 'On'. Once you have made the swap save the file and then exit the editor. display_errors = On Restart Apache Now that you have made the change to the php.ini file you need to restart the Apache web server to effect the change. To do this enter the command below into your terminal window to restart the service. Once the service has restarted you will be able to see error message in your PHP scripts instead of blank white pages. sudo /etc/init.d/apache2 restart Links How To Display PHP Errors In My Script Code When Display_errors Is Disabled wallpaperama.com Ubuntu Tips: How do you display PHP error messages? by mjwittering is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Ask Ubuntu BitBucket Delicious DigitalOcean Dribbble Facebook Flickr LinkedIn Twitter
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn
Apache Display Errors
more about Stack Overflow the company Business Learn more about hiring developers or
Php Error Reporting Not Working
posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer apache php error log site for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and http://matthewwittering.com/blog/ubuntu-tips/php-error-messages.html rise to the top Change php error reporting to hide warnings for specific site only [Debian|Ubuntu] up vote 3 down vote favorite 1 Imagine a couple of sites-enabled available from /etc/apache2/sites-available. (Only Debian-based distros work like this.) Is it possible to mute warning messages from php scripts from a specific site, without touching the actual htdocs? Normally there are a couple of solutions to achieve someting related: Add an http://serverfault.com/questions/509559/change-php-error-reporting-to-hide-warnings-for-specific-site-only-debianubunt error_reporting() directive e.g. error_reporting(E_ERROR); to the scripts executed. Set php_flags in .htaccess files like so: php_flag display_errors off Use ini_set inside scripts: ini_set('display_errors', 'Off'); ini_set('display_startup_errors', 'Off'); error_reporting(0); Prepend @ to functions that throw warnings or errors. Change php.ini to actually say error_reporting = E_ALL ^ E_WARNING display_errors = 1 However, these all mean touching the htdocs or having the change applied globally. Imagine the htdocs are mounted read-only. How would I suppress warnings (or notices) for certain sites only? I am assuming Debian/Ubuntu has a2ensite specific configurations for a reason and I am hoping I can alter those. There is a log_level directive in the example 'site available' configuration, but this handles the amount of messages logged. Not the messages output by the php scripts. Manually adding sections in php.ini or apache2.conf or httpd.conf will also work. If it is possible. See also: http://www.php.net/manual/en/function.error-reporting.php apache-2.2 ubuntu php share|improve this question edited Feb 25 '15 at 5:13 masegaloeh 14.1k72566 asked May 21 '13 at 13:54 Redsandro 2201211 add a comment| 3 Answers 3 active oldest votes up vote 8 down vote accepted If you have access to the apache vhost configurations, of course you can also use php_flag directives inside a Virtual Host in the
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about http://stackoverflow.com/questions/25027634/i-cant-disable-php-errors hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up I can't disable PHP errors up vote 5 down vote favorite So what's going on is I tried ini_set('display_errors', 'Off'); error_reporting(0); Right below