I would like to load a specific PHP version (5.4), I use Bluehost shared hosting which uses Apache and support PHP 5.4.
I have a .htaccess file and a php.ini file in a subdirectory (/api
) with that line:
AddHandler application/x-httpd-php54 .php
to specify to server to use PHP 5.4.
I have in /public_html
another htaccess which uses single php.ini file which is located in that directory.
I have a file called by Shell, with that hashbang line:
#!/usr/bin/php -c/homex/xx/public_html/api/php.ini
I've looked at PHP version at runtime (when called by hashbang line), it shows 5.2 (default version) despite of the fact that I specified to use PHP 5.4 and the usage of php.ini in /api
.
In the other hand, if I call my script by a browser, PHP version used is 5.4.
What's wrong? Do I need to add something else?
How could I use PHP 5.4 with my hashbang called file?
I've deleted php.ini file from /api
and deleted that line from AddHandler application/x-httpd-php54 .php
.htaccess file. So the php.ini file used is the single one from /public_html
.
I've alo added that line to .htaccess from /public_html
: AddHandler application/x-httpd-php54s .php
s which mean single php.ini file.