Forum Moderators: coopster

Message Too Old, No Replies

php not working on all directories

php difficulties

         

cbitsoft

7:34 am on Apr 29, 2005 (gmt 0)

10+ Year Member


I have php set up on my server; I set it up some time ago now. It seems to be working because I have one directory on it which has a php site and this works OK. However, I have tried to run php scripts from other directories without success! I always get the "File Not Found" error on the browser, although if the permissions are changed to scripts only for the directory I get the "HTTP 403.1 Forbidden: Execute Access Forbidden" message which would seem to suggest that the server is trying to run the file. As I mentioned it is now some time ago since I set up the php installation and cannot really remember everything I learnt about php at the time. I need to sort this problem out as soon as I can and I am certain that there is probably a simple solution to it. I would therefore be grateful for any suggestions as to why I may be unable to run scripts in any directory other that the one in which the php website is installed regardless of permission settings on the directories. Many thanks.

mag1

9:53 am on Apr 29, 2005 (gmt 0)

10+ Year Member



I think the problem might be that PHP will only run on the directory that you have the php file in or a sub directory of that directory e.g. if your working php file is in directory C:\PHP php will only work in that directory or a sub directory of it like C:\PHP\Sub

kazecoder

11:57 am on Apr 29, 2005 (gmt 0)

10+ Year Member



Mag1 is on the nose. I run Apache, PHP, and MySQL with Windows OS and since the http.conf file for Apache is configured with PHP you must have the php file in the htdocs directory.

However, I believe you can configure atleast in windows to be able to put the php file anywhere and have php.exe interpret it. I guess it depends of what OS and setup you have.

cbitsoft

4:06 pm on Apr 29, 2005 (gmt 0)

10+ Year Member



Hi,

Thanks for the suggestions. I have now sorted the problem. I found that in the Directory properties I had to create a defaull application and then supply the path to php.exe in the properties for the .php document type. Thanks again for your your suggestions.