mostafaznv mostafaznv - 1 year ago 119
PHP Question

Wamp does not execute php code

It happened today!

server does not execute my php code.

It worked fine yesterday!

This first screen-shot shows my project. It seems blank , but I wrote
<? php echo "s" ?>
on that.
The second screen-shot is source PHP code of my project into Google Chrome.

pic 1

pic 2

Answer Source

You have to open your page not via file://... but with


http://localhost/path/to/your/server/document/root/your-script.php .

By default on xampp/wamp installations this path is <install_folder>/xampp/ or <install_folder>/wamp/ and in this path resides the document root (folder with name www for wamp installation or htdocs for xampp).

Also it is general good idea to replace spaces in your sub-folder with slashes - or underscore _, however this is not mandatory for your scripts to work.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download