Centos Error 500 Internal Server Error

Hi All,

I am trying to troubleshoot an error that I am getting on our web server.  Our PHP does a SQL query and is supposed to create a table with the results.  

If I print the SQL query (print "sql=".$sql."<br/>";) from the PHP page then everything works.  If I remark out the print then I get an Internal Server Error.  It doesn't make since that it works if I print the query

I am not sure where the logs but I did enable PHP error logging (/var/log/error_php.log) and nothing is being logged.  

Thank you for all of your help in advance
thomasm1948Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dan CraciunIT ConsultantCommented:
500 is a server error. Should be in the apache logs.

HTH,
Dan
0
thomasm1948Author Commented:
I am unable to find the apache logs for centos.  I tried locate and cannot seem to find them
0
Dan CraciunIT ConsultantCommented:
/var/log/httpd/

To find the error log, you can use
grep ErrorLog /etc/httpd/conf/httpd.conf
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

thomasm1948Author Commented:
ok I think I found them in /etc/httpd/logs

What should I be looking for
0
Dan CraciunIT ConsultantCommented:
Look in error_log. That's where all the errors are recorded.
0
thomasm1948Author Commented:
Ok, I just to recreated the issue and there is nothing logged for the the 500 error
0
thomasm1948Author Commented:
OK i was being impatient and it did log it.  This is what I am getting

[Mon Sep 28 15:12:15 2015] [warn] mod_fcgid: process 27722 graceful kill fail, sending SIGKILL
[Mon Sep 28 15:12:21 2015] [notice] mod_fcgid: process /var/www/vhosts/mysite.com/httpdocs/index.php(27722) exit(communication error), get stop signal 9

I am not to sure what this means
0
Dan CraciunIT ConsultantCommented:
Put this at the beginning of your script:
error_reporting(E_ALL);

Then see if you get the errors printed in that page.
0
Dan CraciunIT ConsultantCommented:
You might have a problem with the resources.
FastCGI dies badly when out of RAM or out of time.

Can you post the phpinfo() output (masking whatever private info you need)?
0
thomasm1948Author Commented:
That's weird....I placed that in my code and now it works as it should.

I wonder why it would start working.  I know that the script is kind of slow being that it loops through the results and creates individual tables for each results.  So I increased the time out for both the php.ini and httpd.conf files but even then it was not working
0
Dan CraciunIT ConsultantCommented:
You might want to refactor your code to make it run faster or increase the timeouts a lot, or you'll get those errors unexpectedly  (for ex when background jobs run and slow down your server).
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
thomasm1948Author Commented:
Excellent thank you for all of your help
0
Dan CraciunIT ConsultantCommented:
You're welcome.

Glad I could help!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.