note 119100 deleted from features.commandline.usage by cmb

From: Date: Wed, 17 Apr 2019 10:24:48 +0000
Subject: note 119100 deleted from features.commandline.usage by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-210608@lists.php.net to get a copy of this message
Note Submitter: gar37bic at gmail dot com ---- For Linux and similar, the actual path to php may differ according to the particular distribution's layout. Sometimes it is in /usr/local/bin/php, sometimes /usr/bin/php, and even /home/user/bin/php. So #/usr/bin/php may need to be changed. But there is an alternative: Use #/usr/bin/env php instead. This uses the environmental setup, and will ordinarily find PHP in one of your $PATH locations, searching down the path to the first hit. (At least I think that's how it works.) If your CLI script will be run in different environments on different machines, this allows it to work without changes. I believe this also works on BSD (which also means MacOS?) but I don't have one around any more to confirm.

« previous php.notes (#210608) next »