Darkwaldo Posted October 5, 2007 Share Posted October 5, 2007 I am trying to create an apache, PHP, and MySQL operating environment on my computer; however, I am having trouble loading the PHP test page. When I try to access http://localhost/ I am prompted to download "application/x-httpd-php". I know this line of code was edited when I attempted to install PHP, but I do not know what is causing my browser to act that way. Just so you know, I included the .php extension at the end of the application/x-httpd-php when I edited the code. Does anyone know what is causing this to happen? If my ISP doesn't currently allow me to host a website from my own computer, will that prevent me from testing PHP on my computer? Quote Link to comment https://forums.phpfreaks.com/topic/72000-php-installation-problem-when-i-access-localhost-i-am-prompted-to-download/ Share on other sites More sharing options...
wildteen88 Posted October 5, 2007 Share Posted October 5, 2007 Did you restart Apache when made the changes to the httpd.conf? Also how have you configured Apache to handle PHP (Module or CGI)? Quote Link to comment https://forums.phpfreaks.com/topic/72000-php-installation-problem-when-i-access-localhost-i-am-prompted-to-download/#findComment-362709 Share on other sites More sharing options...
Darkwaldo Posted October 5, 2007 Author Share Posted October 5, 2007 Did you restart Apache when made the changes to the httpd.conf? Also how have you configured Apache to handle PHP (Module or CGI)? Thank you for your reply. I did restart my computer; however, I am not sure how apache was configured. How do I find out? Quote Link to comment https://forums.phpfreaks.com/topic/72000-php-installation-problem-when-i-access-localhost-i-am-prompted-to-download/#findComment-362826 Share on other sites More sharing options...
wildteen88 Posted October 5, 2007 Share Posted October 5, 2007 Well how did you install PHP? Surely you must know what you have added to the httpd.conf when you installed PHP? Quote Link to comment https://forums.phpfreaks.com/topic/72000-php-installation-problem-when-i-access-localhost-i-am-prompted-to-download/#findComment-362860 Share on other sites More sharing options...
Darkwaldo Posted October 5, 2007 Author Share Posted October 5, 2007 Is this what you are talking about? LoadModule php5_module c:/php5/php5apache2.dll This is the only line of code the instructions stated I should alter, as far as modules are concerned. Quote Link to comment https://forums.phpfreaks.com/topic/72000-php-installation-problem-when-i-access-localhost-i-am-prompted-to-download/#findComment-362894 Share on other sites More sharing options...
wildteen88 Posted October 5, 2007 Share Posted October 5, 2007 What version of Apache do you have installed? if its Apache2.2.x then the loadModule line should be: LoadModule php5_module c:/php5/php5apache2_2.dll Make sure you have PHP5.2.x installed in order to get this module. Apache2.2.x changed the way how it handles modules. Apache2.0.x modules are not compatible with Apache2.2.x. php5apache2.dll is for use with Apache 2.0.x Quote Link to comment https://forums.phpfreaks.com/topic/72000-php-installation-problem-when-i-access-localhost-i-am-prompted-to-download/#findComment-362899 Share on other sites More sharing options...
Darkwaldo Posted October 5, 2007 Author Share Posted October 5, 2007 I'm currently using Apache 2.0.59, so i don't think that is the problem. Do you have any other ideas? Quote Link to comment https://forums.phpfreaks.com/topic/72000-php-installation-problem-when-i-access-localhost-i-am-prompted-to-download/#findComment-362932 Share on other sites More sharing options...
Darkwaldo Posted October 5, 2007 Author Share Posted October 5, 2007 One other thing, after contacting my ISPs tech support, I found out that my ISP does not allow webhosting from my computer. Will that prevent me from setting up a test environment? Quote Link to comment https://forums.phpfreaks.com/topic/72000-php-installation-problem-when-i-access-localhost-i-am-prompted-to-download/#findComment-362937 Share on other sites More sharing options...
wildteen88 Posted October 6, 2007 Share Posted October 6, 2007 One other thing, after contacting my ISPs tech support, I found out that my ISP does not allow webhosting from my computer. Will that prevent me from setting up a test environment? This should not prevent you from accessing localhost (which is an alias to 127.0.0.1). 127.0.0.1 is an internal ip address (or loopback address). My ISP does not condone hosting websites from my computer however I can still use Apache locally. From the problem you are having I'd assume its a configuration issue can you attach your httpd.conf file here. Quote Link to comment https://forums.phpfreaks.com/topic/72000-php-installation-problem-when-i-access-localhost-i-am-prompted-to-download/#findComment-363300 Share on other sites More sharing options...
Darkwaldo Posted October 6, 2007 Author Share Posted October 6, 2007 Yep, here you go. [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/72000-php-installation-problem-when-i-access-localhost-i-am-prompted-to-download/#findComment-363377 Share on other sites More sharing options...
wildteen88 Posted October 6, 2007 Share Posted October 6, 2007 Well your configuration works fine here. I'm not sure what the problem might be. Try restoring the httpd.conf to its default settings when Apache was installed, there should be a backup copy of the httpd.conf stored in the conf folder. Look for a file called something like http-default.conf. Rename that backup file to httpd.conf (delete/rename the existing httpd.conf). Restart apache and test a simple html file. If the html file works fine then start by adding in the PHP config lines one by one. Making sure to save the httpd.conf and restart Apache each time. Quote Link to comment https://forums.phpfreaks.com/topic/72000-php-installation-problem-when-i-access-localhost-i-am-prompted-to-download/#findComment-363427 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.