note 47711 deleted from function.func-get-arg by betz

From: Date: Fri, 26 Nov 2004 03:59:05 +0000
Subject: note 47711 deleted from function.func-get-arg by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-81046@lists.php.net to get a copy of this message
Note Submitter: skippy -at- offshoremailroom.com.se ---- To save someone else the grief, I'll share my experience with trying to pass command line arguments to a php script (from Radius for example). It does not work with the cgi version of php which most rpm's tend to install. Try var_dump($argv). If it says NULL, you need to get the CLI version of PHP. Download the source do a ./configure and then: make install-cli It puts the cli version in /usr/local/bin. Put #!/usr/local/bin/php at the top of your script and then dive right in with <?php .... ?>. $argv[1] contains the first command line argument you passed the script. Having the cli version installed does not seem to interfere with apache at all. The default also allows access to mysql. Hope I saved somebody else the time I spent on this. Skippy Remove .se from my email address above. ---- Reason: useless note

« previous php.notes (#81046) next »