View Full Version : php question..
Swab
December 20th, 2005, 05:25 PM
I need to run a php script from the command line and want to be able to pass variables when calling the program... is this possible? Thanks for your time.
Virak
December 20th, 2005, 06:15 PM
Install php4-cli/php5-cli (whatever matches the version of PHP you're using. I haven't tried php4 (because php5 is better :P) but it should work the same) with synaptic/apt-get/whatever, and read this (http://ca.php.net/manual/en/features.commandline.php).
simon w
December 21st, 2005, 02:36 PM
Once phpX-cli is install:
echo "<?php print_r($argv); ?>" > test.php
php -q test.php arg1 arg2 arg3
Swab
December 21st, 2005, 04:03 PM
Thanks for the help guys... everything is working great!
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.