DavidGS Posted December 21, 2007 Share Posted December 21, 2007 OK, so I want to be able to run my own PHP files in Firefox without having to upload them to a web-server. I downloaded and installed Apache HTTP server 2.2.6, PHP5 and FastCGI 2.4.6. I configured PHP5 to work with Apache by editing the Apache config file (httpd.config) and adding the following lines: Alias /fcgi-bin/ "c:/Program Files/PHP/" FastCgiServer "c:/Program Files/PHP/php.exe" -processes 5 AddType application/x-httpd-fastphp .php Action application/x-httpd-fastphp /fcgi-bin/php.exe I included to the FastCGI extension with Apache by adding this line to the LoadModule section of the Apache config file: LoadModule fastcgi_module modules/mod_fastcgi-2.4.6-AP22.dll I used the "Test Configuration" program to check the config file and it said there were no errors. Apache is set up for localhost as I will only use it to test websites on my computer. I created a PHP file to test "hello.php", all it does is echo "Hello" on the screen. I know it works because I uploaded to a free web-server and it executes. However, whenever I try and execute the file through Firefox by accessing it through http://localhost/hello.php (the file is in the proper directory), I get an error message: Forbidden You don't have permission to access /fcgi-bin/php.exe/hello.php on this server. How could I be forbidden from accessing my own PHP files when I can access all the other files on http://localhost/ without problems? Quote Link to comment https://forums.phpfreaks.com/topic/82680-solved-cant-access-my-php-files-through-apache/ Share on other sites More sharing options...
chigley Posted December 21, 2007 Share Posted December 21, 2007 You'd be better installing WAMP, which gets it all going nicely for you Quote Link to comment https://forums.phpfreaks.com/topic/82680-solved-cant-access-my-php-files-through-apache/#findComment-420517 Share on other sites More sharing options...
ChadNomad Posted December 21, 2007 Share Posted December 21, 2007 On Windows don't paths use backslashes (\)? Just a thought... Quote Link to comment https://forums.phpfreaks.com/topic/82680-solved-cant-access-my-php-files-through-apache/#findComment-420518 Share on other sites More sharing options...
DavidGS Posted December 21, 2007 Author Share Posted December 21, 2007 On Windows don't paths use backslashes (\)? Just a thought... This is http:// which always uses forward slashes. When navigating through Windows Explorer you use backslashes. Quote Link to comment https://forums.phpfreaks.com/topic/82680-solved-cant-access-my-php-files-through-apache/#findComment-420522 Share on other sites More sharing options...
DavidGS Posted December 21, 2007 Author Share Posted December 21, 2007 You'd be better installing WAMP, which gets it all going nicely for you Yeah it'd be nicer to have them all managed at once rather than have to set them up all manually. It's just the PHP book I am reading explains how to set them up manually to work with each other. No luck. Thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/82680-solved-cant-access-my-php-files-through-apache/#findComment-420523 Share on other sites More sharing options...
ChadNomad Posted December 21, 2007 Share Posted December 21, 2007 On Windows don't paths use backslashes (\)? Just a thought... This is http:// which always uses forward slashes. When navigating through Windows Explorer you use backslashes. That's to do with the web client, not the web server. It may not make a difference but surely it's worth a try? I use XAMPP for Windows but learning to install PHP/Apache could be good experience for the future! Quote Link to comment https://forums.phpfreaks.com/topic/82680-solved-cant-access-my-php-files-through-apache/#findComment-420525 Share on other sites More sharing options...
DavidGS Posted December 21, 2007 Author Share Posted December 21, 2007 On Windows don't paths use backslashes (\)? Just a thought... This is http:// which always uses forward slashes. When navigating through Windows Explorer you use backslashes. That's to do with the web client, not the web server. It may not make a difference but surely it's worth a try? I use XAMPP for Windows but learning to install PHP/Apache could be good experience for the future! I get a "Server not found" error from Firefox when I change it to a backslash. Quote Link to comment https://forums.phpfreaks.com/topic/82680-solved-cant-access-my-php-files-through-apache/#findComment-420526 Share on other sites More sharing options...
chigley Posted December 21, 2007 Share Posted December 21, 2007 On Windows don't paths use backslashes (\)? Just a thought... This is http:// which always uses forward slashes. When navigating through Windows Explorer you use backslashes. That's to do with the web client, not the web server. It may not make a difference but surely it's worth a try? I use XAMPP for Windows but learning to install PHP/Apache could be good experience for the future! I get a "Server not found" error from Firefox when I change it to a backslash. I think he means in the config files Quote Link to comment https://forums.phpfreaks.com/topic/82680-solved-cant-access-my-php-files-through-apache/#findComment-420527 Share on other sites More sharing options...
ChadNomad Posted December 21, 2007 Share Posted December 21, 2007 I didn't mean in your browser I meant in your config. I stand corrected anyway, Apache uses forward slashes. Ignore me! Quote Link to comment https://forums.phpfreaks.com/topic/82680-solved-cant-access-my-php-files-through-apache/#findComment-420528 Share on other sites More sharing options...
PFMaBiSmAd Posted December 21, 2007 Share Posted December 21, 2007 I would say that the cgi installation instructions you used are out of date. In php5, php-cgi.exe is the cgi/fastcgi program and php.exe is the command line interpreter (CLI.) Quote Link to comment https://forums.phpfreaks.com/topic/82680-solved-cant-access-my-php-files-through-apache/#findComment-420533 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.