Running PHP pages through browser offline

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
Twinbee
Forum Newbie
Posts: 4
Joined: Wed Jul 25, 2007 10:29 am

Running PHP pages through browser offline

Post by Twinbee »

I am trying to develop PHP code, and keep having to upload the page to a website to try it. I can of course install my PHP to my own PC, but then I also have to install a server too (I use Win XP).

My question is if it's possible to run PHP scripts through my browser without installing a server (e.g. IIS), and also without having to upload constantly to webspace to try it out (where I need to be online).
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

There are editors that can do it for you, but installing a server lets you browse the website as though it was online.
Twinbee
Forum Newbie
Posts: 4
Joined: Wed Jul 25, 2007 10:29 am

Post by Twinbee »

Yeah, basically, I want it running through the browser offline, but I'm basically forced to install the server too?
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Use xampp for a quick and easy setup: http://www.apachefriends.org/en/xampp.html
Twinbee
Forum Newbie
Posts: 4
Joined: Wed Jul 25, 2007 10:29 am

Post by Twinbee »

Hi,

Thanks very much, that seems like the best option at the moment, though the download is quite high (almost 200 MB) if I just want to use it for PHP. I presume there's nothing else?
Last edited by Twinbee on Wed Jul 25, 2007 12:19 pm, edited 1 time in total.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

If you download each piece separately, install it and configure it yourself, the download would probably be smaller and it would be a good experience for you.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

If you get them separately, try to get the newest of each (Apache 2, PHP 5, MySQL 5).
Twinbee
Forum Newbie
Posts: 4
Joined: Wed Jul 25, 2007 10:29 am

Post by Twinbee »

Just tried EasyPHP which was initially found at: http://en.wikipedia.org/wiki/Comparison_of_WAMPs

Only 8 mb (compressed), and it does the job nicely. The only thing I was stuck on was that I needed to put web pages into its special www folder (found in the browser via http://127.0.0.1) rather than loading from an arbitrary place on my HD. Is there any way to load from any place I want from the HD?

Thanks all for the help!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

You can specify the ServerRoot in your httpd.conf, however all your php files must be placed in this directory
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

You mean DocumentRoot. ServerRoot is where the binary files (php.exe etc.) are found.
Z3RO21
Forum Contributor
Posts: 130
Joined: Thu Aug 17, 2006 8:59 am

Post by Z3RO21 »

On apachefriends.org the installer for XAMPP 1.6.3 is only 34 MB, where did you find it where it was 200? And in my opinion XAMPP is good. It is much quicker than downloading individual parts and makes set up easier. Having a localhost testing server is a must for me because it allows me to test across many browsers and many operating systems quickly.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Jenk wrote:You mean DocumentRoot. ServerRoot is where the binary files (php.exe etc.) are found.
Whoops yea, thanks for the correction.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Could someone please more this thread to Installation and Configuration. Feel free to delete my post after.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Moved to Installation and Configuration.

Thanks ole :wink:
Post Reply