Question:
Cannot Get Apache and PHP to work together, anyone know why?
David
2008-07-07 21:41:28 UTC
I installed the latest Apache apache_2.2.9-win32-x86-no_ssl-r2.msi and PHP php-5.2.6-win32-installer.msi and checked the Apache config file and it does have the PHP entry at the bottom. I restart the Apache server with no errors, create a test.php in the http directiory with the code "phpinfo();
?>" and pointed the browser to it. I get an error "Unable to connect

Firefox can't establish a connection to the server at localhost.
* The site could be temporarily unavailable or too busy. Try again in a few
moments.

* If you are unable to load any pages, check your computer's network
connection.

* If your computer or network is protected by a firewall or proxy, make sure
that Firefox is permitted to access the Web."
anyone know what's up? How can I get PHP to respond? I know Apache is working because it goes to the page "it works!"
Six answers:
fang
2008-07-07 22:53:44 UTC
forget about installing apache and php separately..



use Xampp. It is an easy to install Apache distribution containing MySQL, PHP and Perl. Look into:

http://www.apachefriends.org/en/xampp.html
Trev
2008-07-07 22:44:35 UTC
open acommand prompt



START >>RUN...

type cmd

then hit enter



In that window that opens, type

php -v

you should get sopmething like this:

PHP 5.2.6(cli) (built: May 31 2007 09:37:22)

Copyright (c) 1997-2007 The PHP Group

Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies



If not then php ain't working! Re-install



If it is then close the window



in your php folder, open php.ini

start at the top and read down

check all the paths to directories and Apache are correct.



read this:

http://uk3.php.net/install





You say yu get the "it works page"



But you also get:

Firefox can't establish a connection to the server at localhost

That means what it says!! Apache is the server, it cannot connect to that, it says.



So I do not understand.



I always install Apache get that working then install php - make sure your phpinfo code page is called something.php

Make sure it is in the htdocs folder.



In you conf folder in Apache2 folder make sure the

httpd.conf file

has this line in it

ServerRoot "C:/Program Files/Apache Group/Apache2"



Make sure this section is set appropriately:

Change this to Listen on specific IP addresses as shown below to

# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)

......... your set up here ......



Then make sure this line is right

LoadFile "C:/Perl/bin/perl58.dll"

and this:

ServerName localhost

and this:

DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"

and these:

# This should be changed to whatever you set DocumentRoot to.



and make sure your path to php is right on this line:

SetEnv PHPRC "C:/php"



check these lines:



#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

ScriptAlias /php/ "C:\\PHP\\"

Action application/x-httpd-php "C:\\PHP\\php-cgi.exe"

PHPIniDir "C:\\PHP\\"

LoadModule php5_module "C:\\PHP\\php5apache2.dll"



OK, should work now.

Save file and RESTART SERVER

(Restart server after every change ,and saving of httpd.conf



============================================



Then come back when you want to get Perl and mySql working - but not today, eh?
Dev
2008-07-07 22:10:53 UTC
Cool buddies!

Just try NuSphere technology platform. It comes with built in latest php and apache versions together. Most important feature we have to see is it comes with pre-made php configurations. Just install it and you no need to configure apache. Apache will automatically installed in the same "nusphere" folder like C:\\program files\nusphere\apache\
Some Guy
2008-07-07 21:46:20 UTC
Did you add a domain in the httpd.conf file in Apache?



If you did, then add the domain in your HOSTS file (C:\ Windows\ System32\ drivers\ etc\ HOSTS)



127.0.0.1 name.of.apache.domain



EDIT



Can you load a plain html file?



Is the filetype directive set in the httpd.conf file?



Did you set the correct version for PHP?



Did you enable the PHP type libraries?



Sooo many issues that can cause the 500 Internal Server Error...
baltrip
2017-01-04 14:27:14 UTC
one million) decide your IP cope with 2) pass to Godaddy's administration panel and regulate the DNS putting on your IP cope with (see step one million) 3) Wait quarter-hour to 24 hours do not ignore approximately that till at last you have paid for a lasting IP cope with, your IP cope with can replace, and as a result, that's quite useful to do this every time it does replace. (that's why we could like determining to purchase a number of!)
Draven
2008-07-07 21:48:09 UTC
I've never been a fan of WAMP, perhaps you need to move to LAMP ;-) more stable but in any case you should look here



http://www.lowter.com/article/too-easy-wamp-setup



- C


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...