Jump to content

Going quietly nuts: 500 error


Recommended Posts

I have a complex web application that loads fragments into DIVs using Ajax.  All works except...

On the development server a php file loads and executes fine.  I uploaded it to the production server and I get a 500 error and a blank page (naturally).  The permissions are correct as a 2nd fragment that lives in the same directory loads and executes fine and the permissions on the one that doesn't are 644 (as are the permissions on the file that does work).

The script in question is "mileage.php". 

Works on the development server, not on the production server.

AFAIK, the scripts are identical, I reuploaded it with no joy.

I use firebug and the console just says:

 

GET http://192.168.10.101/MP2010-v2/admin/mileage.php

 

500 Internal Server Error 172ms

"NetworkError: 500 Internal Server Error - http://192.168.10.101/MP2010-v2/admin/mileage.php"

 

 

Any suggestions on how to debug this ?

 

bill

Link to comment
Share on other sites

You are probably either getting a fatal php parse error (usually caused by using short-open tags in your code) or you are getting a fatal php runtime error.

 

Set error_reporting to E_ALL and either set display_errors to ON (causes errors to be sent to the browser) or set log_errors to ON (causes errors to be sent to the error log file.) For a fatal parse error in your main file, you will need to set those settings either in the master php.ini, in a local php.ini (when php is running as a cgi application) or in a .htaccess file (when php is running as an Apache Module.) For all other errors, you can set those settings in the code in your main file.

Link to comment
Share on other sites

Having output_buffering on in the php.ini or using output buffering in your script will hide any php errors that are output to the browser if you are doing a header() redirect on the page. The 500 error could have been in response to the page that redirected to, not the original page request.

Link to comment
Share on other sites

from php.ini on both systems, error reporting is 22527

and output buffering is 4096.

 

I do not do a header redirect, this is an AJAX fragment that is loaded into a div.

 

The first two lines of the script are:

 

session_start ();

error_reporting(E_ALL);

 

Any other ideas of why no error is reported ?  The error (in the apache log) was that a called procedure did not exist and that was the correct problem.

 

bill

Link to comment
Share on other sites

Is display_errors ON?

 

If you browse directly to the URL being requested by the ajax, do you get the error displayed?

 

Unless your ajax code literally puts everything that comes back with the http response into the HTML of the page, the browser won't render anything and you won't see any php produced errors.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.