I have downloaded the wampserver and now I need to use the php.
I tried to use the www directory upload my files but, when I try to open those php files as a web application, that appears as a html web application.I used the mozilla browser.

Now I need to display those files as the php applications and do the amendments when I need.
Please can you tell me the method?

Edited by 1987: n/a

8 Years
Discussion Span
Last Post by 1987

... when I try to open those php files as a web application, that appears as a html web application.

What do you mean?
Are you seeing the PHP code in your browser?

If that is so, you might want to check if your PHP uses the short_tags syntax <? ...PHP code... ?> , in which case you can either:

  1. Reconfigure PHP to allow short_tags, or
  2. Change all <? ...PHP code... ?> to <?php ...PHP code... ?>

I would recommend the second one. That way you ensure you never run into that particular problem again.


2. You can change: short_open_tag = Off to short_open_tag = On in you php.ini! and it will be solved!

Not really, though. More like: delayed or temporarily avoided :)


Not really, though. More like: delayed or temporarily avoided :)

Yeah I know what you mean!

I use this trick (in dreamweaver):
Replace <? with <?php (in the script folder)
Then replace <?phpphp with <?php

Works (except you have a <?=, then you have to replace <?php=... with <?php echo ...)


The second method (<?php ...PHP code... ?>) is which I have used in my code.But its still not working.
I can see the part of the php code in the mozilla browser.

My http://localhost didn't display anything and can you explain in detail what are the steps which I can use to access to the localhost.
I want to know how to display the web page using the localhost.

Edited by 1987: n/a


Yes I did all these things.

I downloaded wampserver to the c:/wamp folder and before using the php I always turned on the services.

After that I always uploaded my files to the www directory and I used the browser by typing htttp://localhost/file_name.php

And then it didn't appear anything by using mozilla browser.

When I try to use the internet explorer it asks to save the file by using downloading files message box with the message "Do you want to save or open this file?"

If I pressed the save button of that message box it asks the where do I need to save the file.
After that it automatically saved the files in the default folder and then it did not open anything and automatically closed the browser.

If I pressed the open button it automatically closed the browser.

I coudn't understand where is the problem is.


Ok, that would indicate that the WAMP server isn't recognizing .php files as PHP code, and thus instead of executing it as PHP code and sending the output, it sends the code as a .php file.

The browsers of course have no idea what to do with that, so they either try to display it as a web-page (which would appear as an empty page), or offer you a Download dialog.

I've heard of this problem before, in regards to WAMP. You need to alter the Apache configuration, to tell it to use .php files as PHP code.

However, I would suggest that you uninstall WAMP and try XAMPP instead. I've never had any problems with that one. Just runs out-of-the-box without any problems.


Anyway thank you for your response and if I find a solution I will send u.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.