[UPHPU] setting path for command line PHP script

Lonnie Olson lists at kittypee.com
Wed Oct 29 09:45:55 MDT 2008


On Wed, Oct 29, 2008 at 9:41 AM, Richard K Miller
<richardkmiller at gmail.com> wrote:
> I agree that my method is hackish. But I don't want to set the include_path
> in my script, which would make it less portable across dev/production
> machines, and I don't want to specify the -c flag every time I run a script.
> I guess laziness is winning over elegance. :)

If you make your PHP script executable, your first line could be
#!/usr/bin/php -c /path/to/php.ini

Now you wouldn't have to specify it each time.  As far as portability,
you just need to ensure the machine specific php.ini file is located
in the same place on each machine.

--lonnie


More information about the UPHPU mailing list