Display errors in CentOS

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PJ688
Forum Newbie
Posts: 5
Joined: Thu Oct 27, 2011 11:50 am

Display errors in CentOS

Post by PJ688 »

Howdy folks! PHP newb here. I have worked with PHP successfully under Windows, but now for my current project I must work off of CentOS 6. I don't know much about Linux at all, and my PHP code isn't displaying any errors at all. I used the find command in the command prompt to find php.ini and found two separate locations the file was being stored. I went into each ini file, set display_errors to on, set error_reporting to E_ALL, and still there are no errors. I have included the code "ini_set('display_errors', 'on');" in my files, and still there are no errors. I am getting very frustrated that I can make no progress on my project. Does anyone have any advice for me?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: Display errors in CentOS

Post by Celauran »

Did you remember to restart Apache after making changes to php.ini?
PJ688
Forum Newbie
Posts: 5
Joined: Thu Oct 27, 2011 11:50 am

Re: Display errors in CentOS

Post by PJ688 »

I did remember, yes.
PJ688
Forum Newbie
Posts: 5
Joined: Thu Oct 27, 2011 11:50 am

Re: Display errors in CentOS

Post by PJ688 »

Shameless bump. Please advise!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Display errors in CentOS

Post by John Cartwright »

Run a script with

Code: Select all

<?php phpinfo(); ?>
This will give you information regarding your PHP, including which php.ini is being used (you likely have 2 as 1 is or Apache, the other is for CLI.) as well as the current error reporting settings.

Check to make sure all the error settings are as you expected, perhaps post the phpinfo() if you are unsure (but do not disclose which server it came from!!).

Also, make sure you are checking your php error logs.
Post Reply