0

It happened today! The wamp 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

3
  • 1
    did you set the server online? Commented Apr 11, 2014 at 13:15
  • First recommendation: Never put spaces in folders. The 'cosmetics' aren't nice and it's not preferred to have the spaces in the url. Second thing I have to ask: is the server actually online? As I can see no WAMP icon in your traybar. Can you check your output (in like Firebug or the Chrome Console) and see if it actually echoes something? Commented Apr 11, 2014 at 13:16
  • @PimVerlangen Aside from cosmetics and personal preference, there's no real reason one can't use spaces in paths. Also note that the folder in question seems to be the root of the project, so the spaces in that name won't likely translate to the actual site. That said; I agree with your preference and the reason for it. Commented Apr 11, 2014 at 14:10

3 Answers 3

6

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

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

or

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.

Sign up to request clarification or add additional context in comments.

Comments

1

please start the wamp server to desktop or bottom bar. Then put localhost/ put in url.

example: localhost/phpmyfristprojet/

The WAMP server running if there is green signal.

Comments

0

in wordpress i had to do in .htaccess

#AddHandler application/x-httpd-php70 .php .php5 .php4 .php3
AddType application/x-httpd-php php php4 php3 html htm

Explain: I comment the first line and added the second

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.