Php Does Not Display Error Messages
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta
Display Error Php
Discuss the workings and policies of this site About Us Learn more php display_errors about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack php.ini error_reporting Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you,
Php Error Types
helping each other. Join them; it only takes a minute: Sign up PHP does not display error messages up vote 28 down vote favorite 11 I installed XAMPP 1.7.4 (with PHP 5.3.5), the problem is PHP does not display any error messages. E.g. if I connect to MYSQL with mysql_connect() without parameters, PHP will not complain about the
Php Hide Errors
required fields. Why is this? How can I configure PHP to display errors? php error-handling share|improve this question edited Jan 15 '14 at 15:40 Álvaro González 81.2k20133201 asked Apr 15 '11 at 18:25 user700792 52441015 add a comment| 5 Answers 5 active oldest votes up vote 49 down vote accepted To turn on errors at the script level, include at the top of your script: ini_set('display_errors', 1); error_reporting(~0); Alternatively, if it is not a production site and simply a development / testing site, you can turn on error reporting in php.ini. Search it for these settings: error_reporting = E_ALL ;error_reporting = E_ERROR display_errors = On ;display_errors = Off share|improve this answer edited Dec 18 '12 at 19:37 community wiki 2 revs, 2 users 91%watcher add a comment| up vote 7 down vote May be the display error is off add in .htaccess file of your application. php_value display_errors on OR use this at the top of your php script ini_set('display_errors',"1"); share|improve this answer answered Apr 15 '11 at 18:26 Shak
and Objects Namespaces Errors Exceptions Generators References Explained Predefined Variables Predefined Exceptions Predefined Interfaces and Classes Context options and parameters Supported Protocols and Wrappers Security Introduction General considerations Installed as CGI binary Installed as an php hide warnings Apache module Session Security Filesystem Security Database Security Error Reporting Using Register Globals
Php Display Error Message On Same Page
User Submitted Data Magic Quotes Hiding PHP Keeping Current Features HTTP authentication with PHP Cookies Sessions Dealing with XForms Handling php error reporting not working file uploads Using remote files Connection handling Persistent Database Connections Safe Mode Command line usage Garbage Collection DTrace Dynamic Tracing Function Reference Affecting PHP's Behaviour Audio Formats Manipulation Authentication Services Command Line http://stackoverflow.com/questions/5680831/php-does-not-display-error-messages Specific Extensions Compression and Archive Extensions Credit Card Processing Cryptography Extensions Database Extensions Date and Time Related Extensions File System Related Extensions Human Language and Character Encoding Support Image Processing and Generation Mail Related Extensions Mathematical Extensions Non-Text MIME Output Process Control Extensions Other Basic Extensions Other Services Search Engine Extensions Server Specific Extensions Session Extensions Text Processing Variable and Type Related Extensions Web http://php.net/manual/en/function.error-reporting.php Services Windows Only Extensions XML Manipulation Keyboard Shortcuts? This help j Next menu item k Previous menu item g p Previous man page g n Next man page G Scroll to bottom g g Scroll to top g h Goto homepage g s Goto search(current page) / Focus search box restore_error_handler » « error_log PHP Manual Function Reference Affecting PHP's Behaviour Error Handling Error Handling Functions Change language: English Brazilian Portuguese Chinese (Simplified) French German Japanese Korean Romanian Russian Spanish Turkish Other Edit Report a Bug error_reporting (PHP 4, PHP 5, PHP 7)error_reporting — Sets which PHP errors are reported Description int error_reporting ([ int $level ] ) The error_reporting() function sets the error_reporting directive at runtime. PHP has many levels of errors, using this function sets that level for the duration (runtime) of your script. If the optional level is not set, error_reporting() will just return the current error reporting level. Parameters level The new error_reporting level. It takes on either a bitmask, or named constants. Using named constants is strongly encouraged to ensure compatibility for future versions. As error levels are added, the range of integers increases, so older
ago mjwittering Like me you maybe using an Ubuntu computer running Apache, MySQL and PHP to develop websites. When http://matthewwittering.com/blog/ubuntu-tips/php-error-messages.html developing it is important to see error messages to debug your code. On occasion I have installed PHP on to Ubuntu computers and by default errors are not 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 display error 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 display error message 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