1
votes

I would like to deploy my Laravel 3 project on Hostgator shared hosting. The minimum php needed for Laravel 3 is php56. The default php in Hostgator is php54 which is lower than the needed version.

I followed this instruction to locate php56 in HG then I found it. Then I edited the ~/.bashrc.

    [ -z "$PS1" ] && return
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions

alias php='/opt/php56/bin/php'
alias composer='/usr/bin/php-cli ~/bin/composer/composer.phar'
export DRUSH_PHP='/opt/php56/bin/php'

Now when I check the php --version it clearly says it's PHP 5.6.30

PHP 5.6.30 (cli) (built: Mar 27 2017 11:42:52) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v6.0.5, Copyright (c) 2002-2016, by ionCube Ltd.

However when I tried to run composer install on the project root it said that the installed php version is 5.4.45 hence does not satisfy the requirements.

  • symfony/yaml v3.3.4 requires php >=5.5.9 -> your PHP version (5.4.45) does not satisfy that requirement. Problem 35
    • nikic/php-parser v3.0.6 requires php >=5.5 -> your PHP version (5.4.45) does not satisfy that requirement.
    • psy/psysh v0.8.9 requires nikic/php-parser ~1.3|~2.0|~3.0 -> satisfiable by nikic/php-parser[v3.0.6].
    • Installation request for psy/psysh v0.8.9 -> satisfiable by psy/psysh[v0.8.9].

How can I correctly configure the system in shared hosting to use the correct PHP version ?

1

1 Answers

0
votes

According to Hostgator, Laravel is compatible with their shared platforms. Several posts related to the installation of Laravel on HG are available. Probably the most helpful is this one.

In looking over your question, it appears that you have neglected to add the php handler to the .htaccess file in the application root directory. I suggest you start there.

Please be aware that you can contact HG Live Support and request assistance with the installation. They may be willing to perform the installation for you; however, they will not support any direct development work you have.