New to PHP - Internel server error

Status
Not open for further replies.

rodrigu5

Member
Messages
58
Reaction score
0
Points
6
I'm trying to switch from my CGI includes to PHP now that CGI has been banned.

At first I'm trying to run a Hello World test at http://www.rodriguezgarcia.com/php/hello.php, just to see if it works, but I get the Internal Server Error screen.

I tried to chmod the file to 777, 755 but still getting the error.

Is there anything I should enable? I can't find anything in cpanel.

Thanks.
 

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
What is the exact code you are trying to execute?
also, a .htaccess might be the cause, check to see if there is one
 
Last edited:

rodrigu5

Member
Messages
58
Reaction score
0
Points
6
The code is:

<html>

<body>



<?php

echo "Hello World";

?>



</body>

</html>


I don't have a .htaccess. What should it contain and where should it be placed?

Thanks
 

diabolo

Community Advocate
Community Support
Messages
1,682
Reaction score
32
Points
48
im going out on a limb here, so anyone more qualified please step in.
check to see if there is a .htaccess in the parent directories, if there is rename it to something different (so that it disables it from being read, but you still retain the file)

your php code looks fine and should work
 

rodrigu5

Member
Messages
58
Reaction score
0
Points
6
I found 2 .htaccess above the folder containing hello.php. I renamed both but I'm still getting the error.
 

Anna

I am just me
Staff member
Messages
11,736
Reaction score
578
Points
113
Your php file should now work properly.

The problem was permission. You had the containing folder set to 777, which is world writable, due to security reasons those will cause an error if their content is to be directly accessed by the browser.

Also I changed the perms on the file itself, in general files should have 644 and folders 755
 
Status
Not open for further replies.
Top