Greetings !
Im trying to create a script in command line. I heard of argv, taht conatins commands passed by reference to the script, like this :
./scriptname arg1 arg2 ...
Problem is, it seams this array does nto get registered, even if it is specified in my php.ini file to register it :
; This directive tells PHP whether to declare the argv&argc variables (that
; would contain the GET information). If you don't use these variables, you
; should turn it off for increased performance.
register_argc_argv = On
Example :
[root@dmocov membres]# ./test.php test
[root@dmocov membres]# cat test.php
#!/usr/bin/php -q
<?
echo $argv;
echo $argv[0];
?>
Finally, here is information about my PHP custome RPM build :
'./configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--enable-cli' '--with-mysql' '--enable-sockets' '--enable-pcntl' '--disable-debug' '--enable-inline-optimization' '--with-mm' '--with-regex=system' '--enable-bcmath' '--enable-magic-quotes' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-versioning' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-force-cgi-redirect'
Any clues ?
Thanks all.