Hi,

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?

... 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.

1. You must access from http://localhost/ not from c:/www/ etc...
2. You can change: short_open_tag = Off to short_open_tag = On in you php.ini! and it will be solved!

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.

WAMP is a local web-server, which you use in your browser by typing in the url http://localhost/.
If you want to access a file in your www directory called test.php, you would type in the url http://localhost/test.php.

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.

hmm I don't know what can cause this. Try Unistalling & Re-Installing it!

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.