init.d scripts

Ed Hill ed at eh3.com
Mon Jan 30 10:59:48 EST 2006


On Mon, 2006-01-30 at 10:52 -0500, Tom Metro wrote:
> David Kramer wrote:
> > My problem is I am setting up to run a PHP script, so the command needs to be
> > "php myscriptname.php foo bar"...
> 
> Use a shebang line.
> 
> myscriptname.php:
> #!/path/to/php

While the above will certainly work, its a good idea to develop the
habit of using "#!/usr/bin/env INTERPRETER_NAME" since 1) its maximally
portable and 2) it allows for easy run-time selection of different
installed versions.

Ed

-- 
Edward H. Hill III, PhD
office:  MIT Dept. of EAPS;  Rm 54-1424;  77 Massachusetts Ave.
             Cambridge, MA 02139-4307
emails:  eh3 at mit.edu                ed at eh3.com
URLs:    http://web.mit.edu/eh3/    http://eh3.com/
phone:   617-253-0098
fax:     617-253-4464




More information about the Discuss mailing list