PDA

View Full Version : Running PHP Scripts


Trev
07-06-2005, 09:00 AM
What do I need to be able to run and test PHP scripts on my XP machine?

I'm getting sick having to work on them online all the time...

Jeremy
07-06-2005, 09:22 AM
Install php locally.

Grab the Windows version from php.net. Have a surf for tips on editing the config files and where to place the dll's. It can be a bit of a bugger but it's not insurmountable.

If you run it from the command line, add php to the Environment Variables on the Advanced Tab in Control Panel / System - then you can just use the line "php script.php" at the c prompt - you can use "> output.txt" to pipe the script output to a particular file etc.

If you want it to return output to a browser, you'll need to install apache and add php to the apache config and maybe point a particular port to you your php testbed folder. (eg so you run it by typing http://localhost:PORT/script.php into the address bar.

You can also with some fiddle-faddling around get it all to run as an exact copy of that on your web server, so if it works, you just upload it with no amendments.

gonzo
07-06-2005, 09:25 AM
Good luck with it Trev. You can install and test em all you want locally. If your host is Unix based...they may or maynot work as installed at home.

Now if your installing em to see what the hell they do...thats a different story.

I almost always order a script with installation today. However the folks at Naked Hosting where I havea couple of boxes are very good about installing anything and getting it to work free of charge!

Trev
07-06-2005, 10:52 AM
Thanks guys,


It seems it's less of a pain in the ass to just tinker with them online, although setting up my box as a web server is quite tempting :)

Jeremy
07-06-2005, 11:29 AM
I know what you mean about it being a PITA to set up, but once you do it, it's well worth it :-))

CTRL+S, ALT+TAB, F5 is a lot quicker than save, upload, reload etc.

The good thing with installing apache on your box is that you can set it up to really be a proper testbed for scripts / sites etc before publishing them.

rich06
07-06-2005, 12:53 PM
you could try XAMPP ... it is an all in one package of Apache/MySQL/PHP/PhpMyAdmin + other stuff so you can install all of them using a single installshield/windows installer ...

disclaimer: i've not used it myself but I've heard it's pretty good... :)

you can get it here -> http://www.apachefriends.org/en/xampp-windows.html

hth
rich

Trev
07-06-2005, 01:15 PM
Originally posted by Jeremy@Jul 6 2005, 04:30 PM
I know what you mean about it being a PITA to set up, but once you do it, it's well worth it :-))

CTRL+S, ALT+TAB, F5 is a lot quicker than save, upload, reload etc.

The good thing with installing apache on your box is that you can set it up to really be a proper testbed for scripts / sites etc before publishing them.
Good point, it would save hours in the long run :)

Trev
07-06-2005, 01:17 PM
Originally posted by rich06@Jul 6 2005, 05:54 PM
you could try XAMPP ... it is an all in one package of Apache/MySQL/PHP/PhpMyAdmin + other stuff so you can install all of them using a single installshield/windows installer ...

disclaimer: i've not used it myself but I've heard it's pretty good... :)

you can get it here -> http://www.apachefriends.org/en/xampp-windows.html

hth
rich
Thanks for the link rich and welcome to Oprano :)