Jump to content

500 Server Internal Error


hmdrest1

Recommended Posts

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@hmdrest1.heliohost.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

 

 

i've been trying to invoke my php scripts and this is all i see for the last week. It wasn't about connecting to your sql db because i see the same error when i just run <?php echo "something" ?> If i run the same script on my localhost with apache it ran fine. Any idea what's causing this and if i did something wrong?

Link to comment
Share on other sites

Are you using the correct syntax? And make sure that you DO NOT have debugging on in your .htaccess file (it should not contain anything to do with PHP).

 

Also, posting your whole script would be good so I can see if its an error with your script because sometimes they run on apache localhost fine but not on these servers, Ive had this same problem before!

Link to comment
Share on other sites

Check the file permissions. They need to be 644. Odds are you have them set to 664 (Apache does not like php files being writable by the group) since the SFTP upload settings we use default to 664.

 

Our servers have display_errors enabled by default, so if it was the script, php would spit out errors instead of a 500.

Link to comment
Share on other sites

Yeah bad htaccess files will do that. First step for any 500 error is generally to rename .htaccess if it exists so its ignored. File permissions come second, then after that it gets a little more difficult to solve (python files with bad shebang lines, etc.)

Link to comment
Share on other sites

thanks for all the replies. All my php files are on 0664 permission , under public_html.. and I can't find the .htaccess file anywhere on my file manager, even when i used the search box on right upper corner with 'Show Hidden Files' enabled..

@Bailey. I had other more complicated scripts but as soon as i bumped into this i started just testing with a simple script like this:

<?php echo "ok"?> .. and it's 500. I tried to replace all my php script from filezilla once. Do you think i accidentally deleted the htaccess file?

 

i dont know what that file is. and it's the first time i know such a thing exist

Link to comment
Share on other sites

<? echo "You forget the ending"; ?>

 

Dont forget the ";" after every command, perhaps thats why?

 

Or

 

Clear your cache, the old files might be cached.

 

Also, you dont need to know what a .htaccess file is if you dont have one :)

Link to comment
Share on other sites

@ bailey i dont know where the cache is

 

thanks for all the replies. All my php files are on 0664 permission , under public_html..

Change them to 644 and they’ll work.

it worked. but i dont understand why, taking away group write permission has anything to do with script being executable?

 

edit: sorry u just said (Apache does not like php files being writable by the group) . that's one weird thing to know

Edited by hmdrest1
Link to comment
Share on other sites

It’s actually suPHP (the apache module that lets php run as the file owner as opposed to the apache user, which is typically nobody) that doesn’t like it. It poses a security risk for files to be writable by the group, so it refuses to run files that aren’t given proper permissions.

Link to comment
Share on other sites

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.   Paste as plain text instead

  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...