Project

General

Profile

Bug #391

HTTP Error 500, SuExec and Fcgi Debugging

Added by Daniel Curtis almost 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
Web Server
Target version:
-
Start date:
05/14/2014
Due date:
% Done:

100%

Estimated time:
1.00 h
Spent time:

Description

I have encountered problem where I have been getting error 500 on my webserver. Because the error logs are simply cryptic, general and misleading, or even non-existent, I needed a trick that allowed me to figure out the reason for the errors without relying much on the logs. Here is a short documentation of the method i used:

Emulation of suexec + fcgi:

  • On the command line, switch to the user that is executing the php scripts:
    su - user1
    

this might fail because this user might not have a login shell (login shell set to /bin/false for example); thus you might need to edit /etc/passwd and set a loginshell for this user; lets say /bin/bash. its a good idea to use vipw instead of vi (you need to do this as root).

  • Now cd to the directory where you have your .php files, and try something like this:
    cd /var/www/www.example.com
    cat index.php | /var/www/fcgi/www.example.com/php5-fcgi-starter
    

This should reveal more info about the error that what you are getting (or not getting) in the logs or in the browser. the file output is being piped to is the fcgi php wrapper.

Resources

#1

Updated by Daniel Curtis almost 10 years ago

  • Status changed from New to Closed
  • % Done changed from 30 to 100
#2

Updated by Daniel Curtis about 9 years ago

  • Project changed from 91 to GNU/Linux Administration
  • Category set to Web Server

Also available in: Atom PDF