How can I see the errors in my PHP script?

Post Reply
User avatar
Vanderburg
Former staff
Former staff
Posts: 1253
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sat Nov 13, 2010 7:27 am
Location: Dallas, TX

How can I see the errors in my PHP script?

Post by Vanderburg »

display_errors is disabled by default in our php.ini file, but it can be enabled for your server using a .htaccess file.
  1. Create a new text document.
  2. Add the following lines to the file:

    Code: Select all

    php_value error_reporting 7
    php_flag display_errors On
  3. Save the file as ".htaccess".
  4. Using your preferred FTP client, connect to your server's FTP using the credentials listed on the "File Manager" tab in your control panel.
    1. If you aren't sure how to connect, we have a guide for FileZilla posted here: viewtopic.php?t=8044
  5. Upload the file to your website's public folder, overwriting any existing .htaccess file. If an existing .htaccess file is present, make a backup copy before overwriting it.
This will display inline PHP errors on your site. For persistent error logging, see our guide on logging PHP script errors.
Post Reply