0

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?

6
  • The logs for apache on CentOS are in /var/log/httpd
    – Bruno9779
    Jun 19, 2014 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. Jun 19, 2014 at 17:22
  • @Bruno9779 there is no /var/log/httpd, just /var/log/apache2
    – BeaverusIV
    Jun 22, 2014 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, 2014 at 21:17
  • Yes, it does not log them.
    – BeaverusIV
    Jun 22, 2014 at 22:35

4 Answers 4

0

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

1
  • which apache2 returns /usr/sbin/apache2. There is no apache, http, httpd
    – BeaverusIV
    Jun 22, 2014 at 21:12
0

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)

8
  • I have, and that is what I meant by index.php bootstrap. I've written it more clear that is CodeIgniter.
    – BeaverusIV
    Jun 22, 2014 at 21:06
  • You have what? Did you set your environment to "development"? Jun 22, 2014 at 21:10
  • Yes, and set the error_reporting and such
    – BeaverusIV
    Jun 22, 2014 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. Jun 23, 2014 at 10:44
  • error_reporting is how you set it, refer to stackoverflow.com/a/7371046/218312
    – BeaverusIV
    Jun 23, 2014 at 23:25
0

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.

-1

Restart Apache Server and check

/sbin/service httpd restart
2
  • I've already restarted Apache a half dozen times.
    – BeaverusIV
    Jun 19, 2014 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. Jun 19, 2014 at 17:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .