0

I installed Apache, PHP and Apache to be used with PHP. The Apache server was never pointing to localhost, and the localhost always pointed to IIS instead of Apache.

Interestingly, I had a seperate website (explicitly named with somename.com, running locally with default port 80 and upon firing the Apache server the site was being used (instead of localhost) for displaying the Apache-based folders.

However, both are not able to process PHP and I've been trying to get this to work for almost a day now (I thought it wouldn't be too rough on me initially)

So since no matter what change I've made:

Apache configuration to use specific IP, rather than port 80. Restricted IIS on specific ports, rather than port 80 and all local ports. Disabled IIS via 'Services' in Administrative Tools. Forced restart of 'Apache Service' via 'Services' in Administrative Tools (this threw an error). But restarting it via the Apache Http server menu options seemed to work fine. Installed XAMPP so it will run directly (not sure if I'm using this wrong though, it did seem to start up but again localhost was never pointing to the Apache's 'htdocs' like it's supposed to.

PHP was added to Apache as well as downloaded (both .MSI, .ZIP installed for BOTH Apache and IIS). No option seems to make the PHP process, it just displays the source code (like in HTML you have the html, head, body tags displayed on the web site instead of actual HTML ). It's pretty frustrating that:

After different attempts to disable IIS, I've not been able to. Apache has everything configured to run PHP (I have actually done this on a Macbook once a long time back, don't remember if I missed anything though) but it doesn't work.

No errors are thrown, except that localhost is not displayed (I stopped the sites that were on IIS, and localhost points to IIS, any attempts at accessing either the IIS specific folders, or the Apache sites are not working).

Also, several attempts of getting PHP to work on WINDOWS 7 (yes in capital letters) has failed as well. Please help!!! Let me know if any specific details may help in troubleshooting, and I will be glad to provide them.

1
  • thank you for the suggestions, now do you have any answers? I have been trying to process PHP using both IIS and Apache, hence the tag. May 5, 2011 at 22:03

2 Answers 2

0

Well, firstly, apache is obviously now running as you can see the php source. If you only see php source, assuming the PHP file is of a .php extension, you can boil it down to almost certainly the mime type hasnt been set.

in your apache config there will be lines such as:

AddType application/x-httpd-php .php

if not, add it.

If that doesnt work it would really seem it hasnt heard of PHP at all. having not got apache on win7 to hand, theres probably a loadmodule line missing, while this is aimed at vista, this may have some ideas.

http://www.wikihow.com/Install-and-Configure-Php-5.2.5-and-Apache-2.2.8-in-Windows-Vista

4
  • yes that was added to the Apache configuration, but it's still not working. Windows 7 is 64-bit, PHP is 32-bit app if that helps? Thank you for the suggestion though. Edit: The site is still going to IIS, so I have set up PHP for working with IIS now. It's not reverting back to Apache. May 5, 2011 at 22:16
  • This is the Error in IIS (looks like the localsite is switching between ports and now the control has again gone back to IIS) HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map. Researching about this error now. May 5, 2011 at 22:19
  • 2 apps cant share a port, without trying it, IIS and apache may work if you have different IPs so, 127.0.0.1 may allow you to listen with apache and your network IP with IIS. The error you mentioned sounds like the one I was talking about with Apache.
    – BugFinder
    May 6, 2011 at 7:38
  • yes, that was it, thank you! Have to resolve the IP addresses now. Phew! Thanks a ton for your help! May 6, 2011 at 15:05
0

Just use some prebuilt solution....

I use WAMP, But there are loads out there.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.