php not working?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
000zero
Forum Newbie
Posts: 6
Joined: Tue Sep 15, 2009 5:07 pm

php not working?

Post by 000zero »

I have installed WAMP server 2 and when i try to drop a php file in firefox it doesnt display anything, and then when i drop it in IE it attempts to download the file

Can someone tell me how to fix this?
User avatar
Weiry
Forum Contributor
Posts: 323
Joined: Wed Sep 09, 2009 5:55 am
Location: Australia

Re: php not working?

Post by Weiry »

you have to put your php file in your wamp/www directory.
default install directory is:
C:/wamp/www/

once your php file is in there, you have to connect to your local apache server using your internet browser.
http://localhost/

you also have to make sure your wampserver is started.
000zero
Forum Newbie
Posts: 6
Joined: Tue Sep 15, 2009 5:07 pm

Re: php not working?

Post by 000zero »

i wasnt connect to http://localhost/ thanks for the help.

Is there any way to have firefox connect to the local host automatically if i drop a php, from the wamp/www directory, in it?
User avatar
Weiry
Forum Contributor
Posts: 323
Joined: Wed Sep 09, 2009 5:55 am
Location: Australia

Re: php not working?

Post by Weiry »

unless there is a plug-in for it... no

it would be like dropping a cloth on your pc and telling it to clean itself.. you have to tell it where to look, how to open it.

My suggestion, make a desktop shortcut to your wamp/www directory, then bookmark your http://localhost/
that way you can click and drag php docs to the folder shortcut, then launch your browser.

Unless anyone else has heard of something else, thats probably the quickest way.
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: php not working?

Post by jackpf »

You can probably write a FF extension to do that pretty easily..

Say, when a new tab opens, check to see if it's on your hard drive (so like...if it begins with "C:\", or whatever drive letter it's on...), and ends in ".php".

If so, extract the script name, and redirect to "http://localhost" + the script name.


Just an idea 8)
Post Reply