[UPHPU] setting path for command line PHP script

Richard K Miller richardkmiller at gmail.com
Wed Oct 29 09:48:56 MDT 2008


>> 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.

Ah, that's a good point. Thanks, Lonnie.



More information about the UPHPU mailing list