My PHP is dumb-Can't display errors

Asked by James Mwaiponya on 2013-05-11

One way to know that a program execution is reaching certain point in code is to introduce an error near the point. I have tried to do this to my local iHRIS but what I am seeing is blank page, no any error message informing of what has happenned.
I have tried to modify the error_reporting configuration directive in php.ini file (/etc/php5/apache2/php.ini ) as many people say if you google but the php is still not displayng errors. Any suggestions are welcome.Thanks

Question information

English Edit question
ihris-manage-malawi Edit question
Juma Lungo Edit question
Solved by:
James Mwaiponya
Last query:
Last reply:

Dear James,
Where do you want this message to appear? On the webpage?
Most of the errors on the webpage are being set on the module config and directed in the PHP code
When a person is saved you have a notice that 'This record has been saved' or if you have double entries you have an error message.
These are set up here and for duplicate records here
and the php code that controls the displays is set here

for the unique values
and for page notices
lines 91 - 92 of this file here

Lines 52, 65 and 73 echo these notices to the terminal and the php5/error.log file which __i think__ is what you are trying to achieve here.

To assist you better, can you point out what specifically you are trying to achieve?

Juma Lungo (jlungo) said : #2

Hello James

   you are using the same computer we were planning to use for iHRIS Malawi Demo, the computer was set to behave like a production server. In production server, we suppress some kind of the errors from being displayed to the users.

Now to see errors, you may use apache erro log file.

open a terminal and issue the command:

tail -f /var/log/apache2/error.log

this command will display all errors.

 hunt for the code that modify your error logo automatically. These are residing on your PHP application and not on the /etc/php5/apache2/php.ini

for example on your iHRIS Malawi import module (see E_USER_ERROR on line 136) of module/import/lib/I2CE_PageImport.php
we suppress errors so that we can upload and process files.


the best way to view errors in a production machine is:
1.0 Open a terminal
2.0 Maximize the terminal window to see it better
3.0 Just one command sir: tail -f /var/log/apache2/error.log
4.0 Run the system
5.0 go terminal to see the errors.

James Mwaiponya (jmwaiponya) said : #3

Hello Dr Lungu,

The question "My PHP is dumb-Can't display errors" refers to development server on my machine not the production server.

James Mwaiponya (jmwaiponya) said : #4

Hello Sovello,

I wanted the message to appear on the web page. I was looking for something like:
Parse error:syntax error, unexpected T_STRING
/home/mundile/Documents/iHRIS/ihris-manage-malawi/4.1/modules/import/lib/I2CE_PageImport.php on line 86
However the answer is still php.ini file. The reason why errors were not displayed after switching display_errors on in the php.ini file was that I was changing coments not the actual directives and also I didn't reatart Apache.

iHRIS handles this gracefully by giving us a user friendly interface. The error is displayed when you hit "Show Details". I think the problem is solved.

Finally I am gratefully for all answers from the team because they have given more insight on how track down errors.