Simple php script fails

Status
Not open for further replies.

Lonesome61

New Member
Messages
7
Reaction score
0
Points
0
I will admit to being a TOTAL novice at php :eek4:, but the tutorials I've found don't seem to help much when a simple script like this one fails:
<html>
<body>

<?php
echo "Hello World";
?>

</body>
</html>

I'm no novice to programming, but my expertise is in VBA and Access and php and the web server world are alien to me still. Still, this is clearly not an error in my programming, but in configuration. What do I need to do to get php to work?
:dunno:
The error displayed is:
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@enthaus.x10hosting.com and inform them of the time the error occurred [@4:00 pm PDT on 4/24/08], and anything you might have done that may have caused the error [Simply attempted to preview the page using Expression Web].
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8b mod_mono/1.2.6 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Server at enthaus.x10hosting.com Port 80
 

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
That code that you posted should work fine.

Is the file that you are talking about a .php file, it must be otherwise the server will not execute this code.

404. error is more interesting, it means that the page was not found, check to see that the file is in the correct location.

If none of those options solves your problems, then please post back with the location of the script on your website.
 

woiwky

New Member
Messages
390
Reaction score
0
Points
0
The 500 error is the strange part. The 404 is just the server saying that it couldn't find the file which should be loaded when a 500 error occurs, so that doesn't really have anything to do with it.

Regardless, I highly doubt it's the file which is causing this itself. I would suggest looking in your error log file and posting the relevant error here. I believe that either something is wrong with the permissions, or the .htaccess file was modified incorrectly. But it could be something else, of course.
 

adam4813

New Member
Messages
24
Reaction score
0
Points
0
Is the page located on the servers here or is it just on your hard drive and your making it in expression web?

If its on the server try to load it again. If its on your hard drive Expression Web doesn't know how to execute .php files.
 

Lonesome61

New Member
Messages
7
Reaction score
0
Points
0
The file (which I'd named .php and .phtml as well as simply .html) was located in the cgi-bin directory on the server. It doesn't like being there, I guess. Removed from that directory, which I erroneously thought would be a good place to put it since it was just a test of some code, it works fine. I've got a lot to learn about php and the wide world of web...
 

tnl2k7

Banned
Messages
3,131
Reaction score
0
Points
0
Hello,

The cgi-bin directory is for cgi scripts. It won't be able to execute PHP scripts.

-Luke.
 

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
This issue has been solved (I received a message from the Lonesome61). If you have any more question then please start a new thread.

* Closed *
 
Status
Not open for further replies.
Top