Skip to content

Menu
  • Home
  • Resources
  • Affiliate Marketing
    • Marketing Strategies
    • Building Curiosity to Drive Sales
    • Steps to being Successful in Anything…
  • My Chats With Alex (ChatGPT)
  • How do I create a website?
  • Privacy Policy
  • The Bloggy Bits
Menu

PHP Programming – Enabling Error Reporting

Posted on June 1, 2024June 1, 2024 by Tim Brownlaw

One of many things that can happen in programming is the dreaded – Screen of Nothing…

In the case of developing a PHP website script, the “Nothing” results in a Picture of a Polar Bear Eating a Vanilla Ice Cream in a Snowstorm, or  “A White Screen of Nothing”.

That’s when it the fingers go straight to the head and the scratching begins… Hmmm what have I flummoxed this time?

So the answer is, as in all cases, Yelling at the screen and shouting “Show Me whats wrong!”

Well in the case of PHP, by default, it likes to keep this to itself to some degree and the reason is, if it happens on a live website, we don’t want the world to know. But as we are “Developing” I want it to scream back at me… “This is what’s wrong….” and show me.

So in the case of PHP  ( and all languages in all environments have ways and means of screaming at you… ) we need to enable it.

And it all it takes is a little bit of code.

Enabling Error Reporting

A Google Search on the term “php enable error reporting” results in the following…

ini_set ('display_errors', >'1';
ini_set ('display_startup_errors','1');
error_reporting (E_ALL);

Now this needs to be placed in your code as early in the execution of your script as possible. In fact it should be the very first thing.

Usually you’ll either have a config that is always run either by way of an include statement on your pages.

Either way, it does help. Of course in a Development system you can change these default values so they are active for all of your development sites. Which is a bit safer as you might accidentally upload the above code in your files onto your live site(s) and that’s not good. But at the same time, you might want to have these uploaded in the case something weird is going on when your script is installed on the live server. But make sure to remove them once you have fixed it.

You should go and look up how to change these for your server depending upon it being Apache2 or NGINX etc.

Check your Error Logs.

In the case, somethings not “Leaping out at you” always check your Error Logs.

 

Tim Brownlaw
Tim Brownlaw

I am an avid Website developer and Affiliate Marketer.
I created my First Website back in 2001 using Frontpage (yes that old…) which quickly led me into Hand coding HTML and CSS.
So over time I got a bit handy with custom PHP scripts and MySQL Database Design and not forgetting javascript.
So, If you ever have any questions – except for “what are the winning lotto numbers” I will do my best to help when I can.

 

Make a difference.
Learn and Earn with Affiliate Marketing

A Man being presented with a Gold watch on his retirement from his job

Recent Posts

  • And then along came Facebook
  • Overclocked, Not Overwhelmed:
  • Google’s Free Tools: Convenience vs Privacy
  • Live Events – Wayne Crowes Facebook Marketing
  • Changing My Facebook Profile.

Recent Comments

No comments to show.

Archives

  • October 2025
  • September 2025
  • August 2025
  • July 2025
  • June 2025
  • May 2025
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024

Categories

  • A.I.
  • BuzzAgentsAI
  • ChatGPT
  • Chats With Alex
  • Creating Content
  • Design Tools
  • Domain Name Registration
  • Facebook
  • Facebook Strategy
  • Hosting
  • HTML
  • Marketing
  • Marketing Journey
  • Marketing Platforms
  • Marketing Tools
  • Motivation
  • My Marketing Methods
  • OLSP
  • PHP
  • Programs
  • Resources
  • Uncategorized
  • Wordpress Security
  • Wordpress Tips

©2026 | Built using WordPress and Responsive Blogily theme by Superb
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}