Error Reporting
One of the most amazing features in php is how it shows errors to the developer, you might think of it as a GPS which tells you exactly where you have to go
; Line Number, character and the error itself..CHARM!
Through the whole previous 2 years, I didn’t use error reporting at all, because it was off by default on my localhost - I use Fedora with Apache, php and MySQL installed as my localhost,, I even installed phpMyAdmin
. -. I didn’t even mind to set it on, may be because I didn’t right that HUGE script that I may search for an error in and get lost. I have to tell that this really enhances your skills a bit, because you become more into code trying to figure out the semi-colon that you forgot and it terminated the script with a blank screen. Anyway, today I thought about giving it a try so I had to do it manually so you should do the following:
$ su - - then enter the root's password and press enter - # vi /etc/php.ini
Search for “Error handling” (type /Error handling and press enter in vi), this is where the error handling and logging configuration block starts. Try to find the statement where it says:
;error_reporting = E_ALL
If it had a semi-colon (;) in the beginning, just remove it, if there where no semi-colons - the common situation - , go to the next step.
Next, search for “display_error” (type /display_errors and press enter in vi), mostly you will find this equals Off so you will find it saying:
display_errors = Off
Change the “Off” to “On”, save the configuration file ( Shift+ZZ in vi) and issue the following command to restart the web server service:
# service httpd restart
If you had any problems, please report them here. ![]()


Fedora has diplay_errors set to Off by default? Strange, localhost’s shouldn’t have that by default. I believe servers should, not localhosts.
The errors aren’t always that charming, trust me. Take for example missing a } after a condition or a loop. eb2a abelny law la2et where you made your mistake with the eror_reporting =D I’ve come to believe you really need to pay close attention to your syntax as you code PHP.
Ironically, Java’s error reporting is far more convenient, technical, and useful.
(lol, I’m flooding your blog =D)
and one more thing..
I advice you to change your error_reporting to:
error_reporting = E_ALL | E_STRICT ; everything PHP has to offer
It gives you better view of your code : )
keep on
nice idea, thanks for the tip
ana ma5atesh bali enno mosh bey include el notices aslan

yeah, you are right kamasheto… bas bardo enta mashoftish el java lama betedeek exception fel sa7aab keda fe enterprise application. eb2a 2abelni law 3ereft el error fe anhy file aslan
I was actually told about something similar to this sometime ago, I’m not sure why though, the compiler gives you the line numbers of the traceback of all the calls that triggered the error.
I guess I have to wait and see then =D
Ya 7abebe yabne … 7ases beek
Once I had the same problem … kan youm 7-12-2007 and I didn’t figure out what’s wrong .. I switched windows .. el mawdou3 kan urgent gedan ..
One day after,I switched back and fixed it; I returned back to fedora -sa3etha- then I installed XAMP wraya7t dma3′e
And now on ubuntu I’m using XAMP it has no problems with error reporting and new frameworks have “error reporting” level customization based on production phase “development-online-test .. etc” ..
with very nice extensions, utilities and examples ..
And you can over-ride if you want -using application configuration files- so I don’t use server “shared” configuration files or I rarely do ..
Plus XAMP is shipped
Anyway, it’s your choice after all
@Java & Kamasheto ..
May be Soliman meant that when you are working in huge Enterprise applications where application dependencies are sooo many error reporting isn’t going to be that efficient .. right ?
salam