Beginner PHP Tutorial – 14 – Error Reporting

All my videos –
Support my tutorials –
Forum –

Bucky Roberts –
Facebook –
GitHub –
Google+ –
LinkedIn –
Reddit –
Twitter –

38 thoughts on “Beginner PHP Tutorial – 14 – Error Reporting

  1. So I'm using the MAMP localhost package and I went to the php.ini file for php 7.0. The error_reporting statement by default was set equal to E_ALL but I still wasn't getting the errors printed on the page. I noticed that the print errors statement that's right below the error_reporting statement was set to Off. I set this to On and restarted the servers but errors are still not displayed. What's going on here?

  2. A Database Error Occurred

    Unable to connect to your database server using the provided settings.

    Filename: C:xampphtdocsFusionCMS-mastersystemdatabaseDB_driver.php

    Line Number: 124

  3. In 2015 im not getting a blank page im getting  Parse error: syntax error, unexpected '$var2' (T_VARIABLE), expecting ',' or ';' in C:xampphtdocsseriesfirstfileerrorreporting.php on line 5

  4. So is this one of the reasons why mature developers hate php? That what was written only 3 years ago is already deprecated? I can't find the error_reporting variable in my file, except in this line: error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT, which I suppose substitutes what he's saying. Moreoever, error reporting is ON by default on xampp now :/ So, yeah, slightly discouraging, to say the least if I try to think about the more complicated stuff which might have become deprecated in the mean time.

    The new version, yes, has this set up, but you shouldn't just skip to the text tutorial, this is valuable information! If you want to ever change this setting but don't know how you'll have to go through the process of finding out how, but if you stay on this video until the end you'll have this information in your brain already!

  6. php has two different string handlers – the single quote one is literal – whatever's in the string gets dumped into the variable. The double quote one is processed first. It can do tricks. It's cleverer than the single quote handler but a fair bit slower.

  7. Do you always use single quotes when assigning a string to a variable? is that a PHP thing? or just your quick way of typing for the tutorial?

  8. I'm using WAMP and can't seem to turn off error reporting. I set error_reporting to zero, and that didn't work. I then tried to google and find an answer, setting error_reporting to "E_ALL & ~E_NOTICE," which didn't work either.

  9. NOTE: If you're using Linux you're php.ini file is located in /etc/php5/apache2/php.ini

    Additionally you would need to restart apache in order to see your error, so you would put the following in the terminal.
    sudo /etc/init.d/apache2 restart

  10. What I can see in my setup (LAMP) is that outside content does indeed display without any error but in your case it didn't because of the missing line terminator in the $var line.

    Thanks for all these tutorials 🙂

  11. My verison of XAMPP dosent come with error_reporting in php.ini, well at least not with the same config options, heres what i have:

    error_reporting = E_ALL | E_STRICT

Leave a Reply

Your email address will not be published. Required fields are marked *