Help - Search - Members - Calendar
Full Version: php is giving me 500 error
Forums > Resource Center > Webmasters' Corner
Maccabee
Im not sure why, but the php isnt working on my site. the other php page son my site are working but this page isnt if I name it index.html it works but not index.php. It shows the 500 error. But php displays html just like html pages do.

So whats wrong? its at josephbcohen.com. Ill be trying to fix it.
Maccabee
bump. Its working on my localhost but not on my server. Is it my servers fault?
mipadi
QUOTE(jcp @ Aug 29 2009, 09:36 PM) *
bump. Its working on my localhost but not on my server. Is it my servers fault?

Probably help if showed the error or the code for your script. I went to your URL but all I saw was a blank page.
Maccabee
I have set an index.php. I havnt gotten any errors. The reason it is blank is because I made a custom 500 error page then deleted it. Ill show you a screenshot of the file directory when i get back to my computer.
Maccabee
click to enlarge

ill change the 500 error page so you can see.
do you know how to get the default one? I believe a 500 error is something about a server issue.
mipadi
QUOTE(jcp @ Aug 29 2009, 11:33 PM) *
I have set an index.php. I havnt gotten any errors. The reason it is blank is because I made a custom 500 error page then deleted it. Ill show you a screenshot of the file directory when i get back to my computer.

An HTTP 500 error indicates a server-side error. You got that because there was something wrong with your PHP script.
Maccabee
Should I show you the index.php code and the includes?
Well i will...

index.php:
CODE
<?php $title = "Joseph Cohen";
$description = "The website of Freelancer, Joseph Cohen.";
$keywords = "Joseph, Cohen, Joseph Cohen, Freelance, web, graphic, design, programming, social, jewsih, teenager";
include("includes/header.php");
?>
<center><br><br><br><img src="images/splash.png">
<br><a style="cursor:default;" href="#"><img border="0" src="images/noenter.png"></a></center>

<?php include("includes/footer.php"); ?>


header.php:
CODE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<title><?php echo $title; ?></title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<meta name="description" content="<?php echo $description ?>" />

<meta name="keywords" content="<?php echo $keywords ?>" />

<link rel="shortcut icon" href="/images/favicon.ico" />

<link rel="stylesheet" type="text/css" href="/stylesheet.css" />

</head>

<body>


footer.php:
CODE
</body></html>
tcunningham
500 is an Internal Server Error, have you made an .htaccess file? Are your error pages noted in that, since I don't think you can just add them the same way you do for normal site pages. I've never used php but maybe this info has to be the first thing on the index.php page...

CODE
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Maccabee
There is an .htaccess file.

Any other takers?
allvanishing
Check what the .htaccess contains. It might be set to show that page.
Maccabee
its just blank.
medic
Was the script working before hand?

If other PHP pages are working correctly then it's more than likely not a server side error in general. Did you do any updating to the script that would have caused this issue? Also, check with BlueHost to see if they did any PHP updates to your server.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.