First off, you can enable PHP 5.3 on HostGator on a directory level basis. Simply add the following line to the .htaccess
file in your public directory:
AddType application/x-httpd-php53 .php
reference link
Ba-Da-Bing! Now you can run your PHP 5.3 applications!
Oh, but wait! You have SSH access and want to use PHP Composer?
If you log in via SSH and try the following command: # php composer.phar install
you will get the following error: Fatal error: Class 'Phar' not found in...
This is because HostGator's # php
command runs in 5.2.2. To run in 5.3, you need to provide the full path to the 5.3 binary.
Here's the working command:
# /opt/php53/bin/php composer.phar install
I was so excited that I got this working that I figured I would share!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…