Mobile app version of vmapp.org
Login or Join
Hamaas447

: Configure PHP and Apache in Windows 7 I installed Apache successfully on a Windows 7, 32bit system. It showed "It works" in the webpage. I also configured <?php phpinfo(); ?>file as info.php.

@Hamaas447

Posted in: #Apache #Php #Windows7

I installed Apache successfully on a Windows 7, 32bit system. It showed "It works" in the webpage. I also configured <?php phpinfo(); ?>file as info.php.
But when I tried to open localhost/info.php in the browser, all I get is <?php phpinfo(); ?>in plain text.

I restarted Apache server every time I made changes. Anyone can help with this?

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Hamaas447

3 Comments

Sorted by latest first Latest Oldest Best

 

@Lee4591628

Per this tutorial (step 4) try editing the doc_root line to point to the root folder of where you are serving PHP files from, e.g. doc_root = "C:public_html". It should match the DocumentRoot path in your Apache config file.

Also, when you make changes to your Apache or PHP configs, you need to restart Apache for the changes to be loaded.

The tutorial I linked above has been my years-long guide for setting up and running the AMP stack on Windows, it's worth a look. Not the author, just a happy user.

10% popularity Vote Up Vote Down


 

@Steve110

Are you sure your php5apache2.dll is actually in that path? It seems like a few years ago, I had to copy those from another directory in the PHP installation directory (though I don't remember what version of PHP I was working with at the time).

Aside: I would've posted this as a comment, but I don't have the rep yet.

10% popularity Vote Up Vote Down


 

@RJPawlick198

Add the appropriate handlers, as you could've read in the manual:


You need to insert the following lines into your Apache httpd.conf
configuration file to load the PHP module for Apache 2.x:


#
LoadModule php5_module "c:/php/php5apache2.dll"
AddHandler application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php"

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme