bash - PHP cli from different PHP.ini -
i've got php cli script need execute. however, cli version of php isn't need (the script requires php 5.3+ , cli version of php 5.2).
from command line:
# php /usr/bin/php # whereis php php: /bin/php.orig /bin/php /usr/bin/php.orig /usr/bin/php /sbin/php.orig /sbin/php /usr/sbin/php.orig /usr/sbin/php /etc/php.d /etc/php.ini /lib64/php /usr/lib64/php /usr/local/bin/php.orig /usr/local/bin/php /usr/include/php /usr/share/php /usr/share/man/man1/php.1.gz
the host tells me can't change cli version of php can use php -c
switch execute script php version. example gave was:
php –c /root/php/53/etc/php.ini /example/target.php
i wrote shell script wrapper command:
#!/bin/bash php –c /root/php/53/etc/php.ini /example/target.php
however, when execute script command line get:
status: 404 not found content-type: text/html no input file specified.
which makes me think gave me path apache version of php.
can explain should doing here?
thanks!
the php.ini config file, not determine version of php run. can check version doing php -v
. if need run different version of php, you'll need find php executable. you'll need contact host find out executable is, or can try whereis php
find executable (often located in bin folder).
Comments
Post a Comment