Re: Three quickies anyone?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ryan A wrote:

Hey,
I am new to CLI and using PHP to run shell but need to know it so am getting
my feet wet, hopefully with your help :-)

Now when I said three quickies, I mean three PHP RELATED quickies of
course...if you thought anything otherwise... you have a wicked mind.

Here goes:

1.
I start my CLI scripts with:
#!/usr/local/etc/php

as thats the path on my machine... the problem is some of these scripts will
have to  be installed on clients machines by them... any easy way for them
to find out whats the path PHP is installed on their machine? (this q is
more of a doubt really)

is it the same as $_SERVER["include_path"]


The canonical way:

#!/usr/bin/env php

This will call the first php executable in $PATH, and is generally
used when portability in scripts is desired.

3.
This should be a rather simple question but I just confused myself after
reading/searching google (i do that to myself sometimes, totally
unintentional really)
Can I run CLI/Shell scripts
eg: scripts that began with the  #!<php path>
on machines that have PHP loaded as a CGI and as a module or only as a CGI
or only as a module?

Well, if you use the "canonical way" I describe above, one problem
I foresee is that the cgi-bin directory is hardly ever in $PATH. . .

HTH,

Kevin Kinsey

--
	How many people work here?
	Oh, about half.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux