2
votes

I'm facing a big problem with my current Magento Shop. When I create an invoice through the backend I'm getting an 500 internal server error (after a long loading process). The server logs dont show anything, I looked into /var/log/apache2/error.log and theres nothing related. The error didnt show up on my dev machine, but since I moved the shop to our live server it occurs all the time.

What I tried so far:

  • Checked the file and folder permissions
  • Enabled Mage::setIsDeveloperMode(true); and ini_set('display_errors', 1);
    Still no errors or logs
  • Deleted local.xml and generated a new one
  • Increased memory limit
  • Increased max execution time
  • Cleared cache
  • Checked .htaccess file, everything seems fine
  • Ran a script to check if everything matches the Magento requirements

This is starting to keep my busy for a couple of days now... and I dont know where to start, because the server doesnt even output an error in the logs. How can I force the server to log the error in the according file?

Do you have any other ideas what I can try to get rid of the error?

Attached also my php.ini file, maybe that helps.

PHP.ini http://pastebin.com/9BWQRHTu

PHP Version and OS: PHP Version 5.3.2-1ubuntu4.21

Env: Virtual Private Server

2
Can you see errors if you load a simple test script that triggers an error or warning?Álvaro González
yes if I enable Mage::setIsDeveloperMode(true); and ini_set('display_errors', 1);Kevin Goedecke

2 Answers

1
votes
  1. Increase memory_limit from 128M to 256M or 512M.
  2. Clear browser cache and cookies. Do you encounter the same "500 server error" in other browser?
  3. You said the loading process is long - measure the exact time couple of times and if the time is the same, which is set in php.ini, increase the max_execution_time
  4. Find why is it taking so long to create an invoice using a debugger - most probably some module you have installed has a problem, like infinite loop, or it might trigger an action, which takes a lot of time, for example, reindexes everything each time. Creating an invoice shouldn't take so long and it is a problem in code - not in server settings probably.
1
votes

I looked into the wrong error_log file, as I'm using Plesk the correct error_log file was located in /var/www/vhosts/xxx.com/statistics/logs/ and not in /var/log/apache2/

The error in there was

[Mon Nov 04 14:37:13 2013] [warn] [client xxx] mod_fcgid: read data timeout in 45 seconds, referer

This lead me to the fcgid.conf (etc/apache2/mods-available/fcgid.conf) where I had to increase the following values:

FcgidIdleTimeout 3600
FcgidProcessLifeTime 7200
FcgidMaxProcesses 64
FcgidMaxProcessesPerClass 8
FcgidMinProcessesPerClass 0
FcgidConnectTimeout 300
FcgidIOTimeout 180
FcgidInitialEnv RAILS_ENV production
FcgidIdleScanInterval 10