Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My WAMP server is not executing PHP. I have already tried the following things:

  • restarted just Apache
  • restarted all WAMP services
  • restarted the WAMP application
  • restarted my whole system
  • renamed the file
  • placed the file in the root direcory
  • my file is named index.php, its not a txt file
  • I am accessing it as localhost/phppractice/index.php
  • Tried on different browsers (Chrome, FF, Opera)

This is my code, which I am assuming is correct:

<?php phpinfo(); ?>

Simple as that. I have also tried to run it as:

<?php phpinfo(); ?>

And to substitute the phpinfo() with hello world. The result is the same - a blank page. No code, no result of the code, nothing, just a blank page. I have totally no idea what am I doing wrong.

share|improve this question
Did you enable php in your apache configs? – Kruug Jun 21 '13 at 15:48
Is apache set up to map your phppractice/ folder correctly? – MattDMo Jun 21 '13 at 15:48
Also, did you check the server logs to see if there is an error someplace? – MattDMo Jun 21 '13 at 15:49
@Kruug - yes, I have Apache 2.2.22 and LoadModule php5_module "c:/wamp/bin/php/php5.3.13/php5apache2_2.dll" in the config, so it should be ok. – user232865 Jun 21 '13 at 15:55
@SBI Wamp sets Apache/MySQL/PHP up automatically. Its a one click Apache web environment. So dont fiddle with the DocumentRoot parameter. – RiggsFolly Jun 28 '13 at 11:51

Make sure that the filename of the script you are running has an extension of .php

If you use a .html extension it will not be passed to the PHP interpreter for compilation and execution.

share|improve this answer

You need just to put those 3 lines in your httpd.conf & httpd-vhosts.conf files:

1. C:\wamp\bin\apache\Apachex.x.xx\conf\extra\httpd-vhosts.conf

2. C:\wamp\bin\apache\Apachex.x.xx\conf\httpd.conf

DirectoryIndex index.php index.php3 index.html index.htm

AddType application/x-compress .Z

AddType application/x-gzip .gz .tgz

AddType application/x-httpd-php .php

AddType application/x-httpd-php .php3

ForceType application/x-httpd-php

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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