Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running PHP scripts from local hard disk?

Status
Not open for further replies.

marmablue

Technical User
Dec 27, 2001
10
0
0
GB
I've recently installed a PHP script using a SQL database on my website. I don't host it myself, and it's taking ages to add records to the database online. So what I really need is a way of running PHP scripts on my local hard disk, so I don't need to be online to add records to the database.

Does anyone have any ideas how I could do this? I am told that it's easy to download PHP software to do it, but where do I get it from, and is it free?

Thanks in advance,
Ian Renton
moonshadow@talk21.com
 
PHP is free and you can get it at
I run PHP scripts on my local Win2K PC for testing and cross database synchs. Download the Win binary (as long as you are running Windows) and run the install. You also may need to associate the .php extension with the php executable.
 
Hmmm... that didn't seem to work. I got a DOS box pop up when I tried running a PHP script. Then my firewall popped up a message saying that it was trying to connect to my SQL database online, which I let it do... then nothing happened. The DOS box just stayed blank for about 20 seconds, then closed itself.
 
Actually, change that... This time I actually watched it more closely... The box waited about 20 seconds before doing anything, then very quickly displayed all the text in my PHP file, then closed itself. Do I need to do something else to get the PHP program to run the code rather than just scroll through it?
 
running the scripts from windows (double clicking with the mouse) will make this happen. The DOS window closes after the script is finished (usually just a second or two).

If you run the script from a DOS/Command prompt the window will not close. To do this place the path to php.exe in your PATH enviroment variable and then you can run any php script like so: C:\> php.exe script.php

You also might be able to stop the window from closing by removing the "close on exit" check in properties of php.exe and/or your scripts. Right click on either of theses and go to properties and look for the "close on exit" check box.

Hope this helps :)
 
^_^ That's a good point. (Trust me to overlook the obvious stuff...)

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top