Localhost PHP access
Posted by: scottmacneill (---.sip.cha.bellsouth.net)
Date: January 08, 2008 09:41PM

I am a complete novice when it comes to WampServer, as will become apparent shortly.

I installed WAMP in order to develop and test some small PHP programs (scripts?) locally (i.e. Without having to FTP them to my server in order to test them) and I can't seem to get the configuration quite right.

I did a straight installation in accordance with the instructions and have the C:\wamp\www directory as indicated. I added a project folder "FBC" for my PHP scripts, also as instructed. I also make sure that WampServer is running and the required services are started.

When I try to run the scripts locally using Firefox, the best I can get is the script text reiterated on the screen, yet when I upload them to my server they actually perform and yeild the results I'm looking for. I have tried both the online and offline modes to no avail. I can get the phpinfo() function to work locally, but that's about it.

How can I get PHP to operate as a local function? Thanks in advance for your help.

Re: Localhost PHP access
Posted by: yfastud (Moderator)
Date: January 08, 2008 09:51PM

What instructions are you talking about?

By the way, use full tag <?php ... ?> if short_open_tag in php.ini is not enabled

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Re: Localhost PHP access
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: January 08, 2008 09:56PM

yes im sure this is ur problem. wampserver2.0 ships with short tags disabled,

left click wamp icon >phpsettings> and second from the top is short open tag. tick it

Re: Localhost PHP access
Posted by: scottmacneill (---.sip.cha.bellsouth.net)
Date: January 08, 2008 09:59PM

I changed php.ini to enable the short tags but it doesn't seem to matter. PHP scripts that work fine on the server simply will not do anything on my local machine, with the exception of phpinfo().

To test phpinfo, I have started and stopped the services. When started, it works; when stopped it doesn't. None of my hand crafted PHP scripts will work locally, even those I have tested on the server which is running version 4.3.

I must have something strange in the path or environment but I don't understand why I can access phpinfo and nothing else.

Re: Localhost PHP access
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: January 08, 2008 10:03PM

where are u putting the files on the server? is the index.php file that was in the www folder running?

Re: Localhost PHP access
Posted by: scottmacneill (---.sip.cha.bellsouth.net)
Date: January 08, 2008 10:09PM

On the server, I've been putting the scripts in the root and accessing them by going to something like "[www.mysite.com]; This seems to work just fine.

Locally, I am going to "c:\wamp\www\fbc\testfile.php" which does not work at all.

The original index.php file resides in the c:\wamp\www folder but I have no idea if it is running or not. I have never started it, I'm sure. How would I know if it has been run? Does it need to be run?

Re: Localhost PHP access
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: January 08, 2008 10:15PM

if the server is on the computer only u need to use localhost.


goto this [localhost] h t t p : / / l o c a l h o s t / i n d e x . p h p

if u get the wamp screen then its all working


ur files shud be at
[localhost] h t t p : / / l o c a l h o s t / f b c / t e s t f i l e . p h p



Edited 1 time(s). Last edit at 01/08/2008 10:16PM by stevenmartin99.

Re: Localhost PHP access
Posted by: scottmacneill (---.sip.cha.bellsouth.net)
Date: January 08, 2008 10:25PM

I clicked on your [localhost] link and got the following error message: Firefox can't establish a connection to the server at localhost.

I apparently had some problem with the installation but no error messages popped up so I'm not sure what happened. Actually, this is the second time I've installed Wampserver. The first time around I got the same results so I uninstalled it and did it again.

I have no idea as to where "localhost" should be located or how to get the pointers pointing in the right direction so that I can access it. Any suggestions?

Re: Localhost PHP access
Posted by: stevenmartin99 (---.b-ras1.blp.dublin.eircom.net)
Date: January 08, 2008 10:29PM

wat are u running ? xp? if its running properly it will do it all itself
and u just type in localhost in the browers and nothing else,

wat colour is ur wamp icon?

have u ever had a server on this computer?

Re: Localhost PHP access
Posted by: dwd2000 (---.cpe.net.cable.rogers.com)
Date: January 08, 2008 11:16PM

I had the same problem and did the same thing (reinstall).
Just type "localhost" in your browser.
Bookmark or add to "Favorites".
Whenever you want to access your "offline" pages, just use the bookmark.
Any page you have named "index" will show up.
You may want to rename the original index file so there is no confusion and you may want to look at it again later, as you update it.
If you want to look at a different page, other than the index file, just type the name of the page after "localhost" in the browser window, (/test.php) or whatever you named it.
(sorry for assuming you didn't know that last part, but someone else might read this later who may not know)

Re: Localhost PHP access
Posted by: scottmacneill (---.sip.cha.bellsouth.net)
Date: January 08, 2008 11:24PM

I'm running XP Pro.

The Wamp icon in the task bar is basically white with a black center.

I've never run a server on this machine, an HP Pavilion notebook.

When I type "localhost" in my browser, it brings up the Wamp homepage.

When I type "localhost/fbc/solutiona.php" (A short PHP test script) it performs as expected.

Why does it appear to be working all of a sudden? Is the problem yet another "feature" of Windows?

Thanks for all the help. I'll see if it stays working.

Re: Localhost PHP access
Posted by: yfastud (Moderator)
Date: January 09, 2008 12:38AM

Quote

I changed php.ini to enable the short tags but it doesn't seem to matter. PHP scripts that work fine on the server simply will not do anything on my local machine, with the exception of phpinfo().
Quote

Why does it appear to be working all of a sudden?
After edit any config file , for example enable short_open_tag, you need to restart wamp to take effect

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Sorry, only registered users may post in this forum.