mem0ri Posted June 8, 2006 Share Posted June 8, 2006 I've written a script in PHP to copy an MSAccess database file from one network location to another and then take that DB and copy rows from one table into several others...it's all just a bandaid for an ancient program that needs to be replaced......the problem, however, is getting this script to run off the desktop/command line. From what I've read about the PHP SAPI CLI/CGI I am able to just prepend my file with:#!/usr/bin/phpHowever...it doesn't seem to be working...Any thoughts? Quote Link to comment https://forums.phpfreaks.com/topic/11532-running-php-on-desktopcommand-line/ Share on other sites More sharing options...
Fyorl Posted June 8, 2006 Share Posted June 8, 2006 I'm assuming you're using Linux or a unix-based operating system. In which case, have you compiled PHP for your system? Did you specify CGI or CLI (I think the default's CLI) installation?What error messages are you getting when you try to run the command?My Linux computer runs PHP fine from the command line if I put #!/usr/bin/php but your must make sure it has executable permissions before you can run it eg:[code]chmod +x /path/to/your/script.php[/code]Of course, you may not be using Linux (or a Mac) in which case putting #!/usr/bin/php will not work and you'll have to write a batch file for it. Instructions for doing that can be found [a href=\"http://uk2.php.net/manual/en/features.commandline.php\" target=\"_blank\"]here[/a] Quote Link to comment https://forums.phpfreaks.com/topic/11532-running-php-on-desktopcommand-line/#findComment-43420 Share on other sites More sharing options...
mem0ri Posted June 12, 2006 Author Share Posted June 12, 2006 Thank you.I actually am not using a Linux system. Our server is a Win2000 server...and the PHP script is pulling MSAccess databases from one server location to antoher and redistributing a main table through to other tables. In other words...I'm workin' with the worst I can get (Win2000 + MSAccess)!There are no error messages that come up...simply a failure to run. I'll look into the batch file more closely. Thank you for the link...though I think I've read over that page a couple of times with no luck for myself. I think I might need to read very slowly and take very careful notes this time.The chmod settings, however, are definitely correct :) I had that part figured. Quote Link to comment https://forums.phpfreaks.com/topic/11532-running-php-on-desktopcommand-line/#findComment-44682 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.