I have moved some code from development to production and it was not working so I am trying to debug but for the life of me, I cannot get access to the errors to find out what is wrong.

I have tried setting error_reporting, display_errors, log_errors in the Plesk dashboard, php.ini, .htaccess, CodeIngniter's index.php bootstrap, and the function I am calling and I still don't get any errors displayed.

The server is a VPS Red Hat/CentOS setup with Plesk using Apache. The website is built upon CodeIgniter and Doctrine.

Have I missed anything?

  • The logs for apache on CentOS are in /var/log/httpd – Bruno9779 Jun 19 '14 at 17:15
  • I think, that you don't want to Apache show the errors. Apache just works. You want to PHP to show errors. So you ask wrong question. Therefore all 3 answers are pointless. – David Ferenczy Rogožan Jun 19 '14 at 17:22
  • @Bruno9779 there is no /var/log/httpd, just /var/log/apache2 – BeaverusIV Jun 22 '14 at 21:04
  • Well then, did you take a look? If Apache is spitting out 500, the reason will likely be documented in error_log. – Daniel B Jun 22 '14 at 21:17
  • Yes, it does not log them. – BeaverusIV Jun 22 '14 at 22:35

Restart Apache Server and check

/sbin/service httpd restart
| improve this answer | |
  • I've already restarted Apache a half dozen times. – BeaverusIV Jun 19 '14 at 9:46
  • I guess, that problem isn't in Apache, but in CodeIgniter application instead. He describes it pretty clearly, but he have chosen wrong question title. – David Ferenczy Rogožan Jun 19 '14 at 17:33

Do which apache, for plesk apache is in my guess would be in /usr/local/psa/

| improve this answer | |
  • which apache2 returns /usr/sbin/apache2. There is no apache, http, httpd – BeaverusIV Jun 22 '14 at 21:12

Your are basically asking the wrong question.

Right question is not how to get error message from the Apache, but how to get error message from the CodeIgniter / PHP.

I don't know the CodeIgniter, but similar frameworks works this way: it detects, if it's running on the localhost (development) machine or on the server (production machine). If it's running on development machine, it enables error reporting, otherwise it disables it. So it overwrites your setting wherever it is (php.ini, .htaccess etc.).

Therefore you should check how to enable error reporting on production machine in CodeIgniter or how to manually set environment to "development" on production machine in CodeIgniter instead.

Check for example this question on StackOverflow. There is exactly what I have described. Maybe it would be enough to (temporarily) set the environment to "development".

Don't forget to set it back to "production" when you'll solve your problem! (or don't forget to disable error reporting depending on what you'll do)

| improve this answer | |
  • I have, and that is what I meant by index.php bootstrap. I've written it more clear that is CodeIgniter. – BeaverusIV Jun 22 '14 at 21:06
  • You have what? Did you set your environment to "development"? – David Ferenczy Rogožan Jun 22 '14 at 21:10
  • Yes, and set the error_reporting and such – BeaverusIV Jun 22 '14 at 22:34
  • You shouldn't have to set error_reporting manually, because it'll be done by CodeIgniter according to current environment. Maybe you have set the encironment just before environment detection, so it was overwritten by CodeIgniter. – David Ferenczy Rogožan Jun 23 '14 at 10:44
  • error_reporting is how you set it, refer to stackoverflow.com/a/7371046/218312 – BeaverusIV Jun 23 '14 at 23:25

I figured out what was wrong. I managed to find more logs deep in Plesk, I have no idea where they are on the filesystem but they pointed me to processes timing out.

Plesk uses Nginx with fastcgi which was timing out and throwing the error through Apache. I increased the timeouts for fastcgi and Nginx which stopped the error showing.

Thanks everyone for your help.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.