toasty Posted September 9, 2006 Share Posted September 9, 2006 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 ErrorThe 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 https://forums.phpfreaks.com/topic/20241-problems-running-php-files-in-certain-directories/ Share on other sites More sharing options...
onlyican Posted September 10, 2006 Share Posted September 10, 2006 500 errors (Internal Service Error) are normally down to configuration Is the cgi-bin set up correctly? Link to comment https://forums.phpfreaks.com/topic/20241-problems-running-php-files-in-certain-directories/#findComment-89136 Share on other sites More sharing options...
toasty Posted September 10, 2006 Author Share Posted September 10, 2006 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 https://forums.phpfreaks.com/topic/20241-problems-running-php-files-in-certain-directories/#findComment-89146 Share on other sites More sharing options...
onlyican Posted September 10, 2006 Share Posted September 10, 2006 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'sDo you have anohter .HTACCESS file in that folder? (You shouldn't)If notPost ur HTACCESS file from the rootIf YesPost Both Link to comment https://forums.phpfreaks.com/topic/20241-problems-running-php-files-in-certain-directories/#findComment-89270 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.