Jump to content

Problems running PHP files in certain directories.


toasty

Recommended Posts

I'm wondering if anyone has had a problem with executing php files whereby they don't run in all directories; and if so if you know of a solution to this.

For instance I ran into this with two seperate files; one pertained to a perl script.  I created a custom .php file located in my /cgi-bin directory and when I tried accessing it from my browser it would spit out:
[quote]Internal Server Error

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

Please contact the server administrator, _________@yahoo.com 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.
Apache/2.0.46 (Red Hat) Server at www.____________.com Port 80[/quote]

I fixed this by placing the .php file in question into a folder that had existing .php files that I knew worked.  After I changed the relative paths in the code it worked fine.  The second problem I ran into was trying to run a .php file from my browser that I had just uploaded into a folder I had just created (permission 777 on folder and file) and I ran into the same "Internal Server Error."  However when I moved the files into my sites root directory it executed without any problems at all.

I'm just wondering if anyone knows if this is a somewhat common problem or if there are ways around it?

Thanks
Link to comment
Share on other sites

I assume the CGI is set up right, I actually just got an email back from support with my site's host and they confirmed that the cgi-bin directory isn't publicly browsable; so that solves the issue regarding the file in that folder.

However, they didn't have anything to say regarding 500 error in the directory I created and just pointed me to see what I could find out online and from www.php.net (because that level of support is outside their scope of responsibility).

So, I'm still trying to figure out why accessing www.mysite.com/folder/file.php didn't work, but www.mysite.com/file.php worked fine.
Link to comment
Share on other sites

So you are saying, you have the SAME file, in the folder "public_html/"(root) and in another folder "public_html/folder/"(folder in root)

If you view the file in the root, it works, if you view the file in the folder (NOT CGI-BIN) it comes up with 500's

Do you have anohter .HTACCESS file in that folder? (You shouldn't)
If not
Post ur HTACCESS file from the root
If Yes
Post Both
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.