4

Currently on composer install I get the error need 5.5.9 but using 5.4 but on Hostgator cpanal it's set as 5.5

On php -v I get

PHP 5.4.45

On php --ini I get

Configuration file (php.ini) Path: /opt/php54/lib

When going into /opt/ There is a php54, php55 and php56

How do I change my version to 5.5

I saw the following example on this link

$ php -v
PHP 5.4.x (cli) ...
$ set PATH="/usr/lib64/php5.6/bin:$PATH"
$ php -v
PHP 5.6.x (cli) ...

But when going into /usr/lib64 there's no php5.6

On my index file in the webserver I did a phpinfo() and it's set as 5.5

Anyone got any ideas

Community
  • 1
  • 1
Ninja
  • 83
  • 6
  • what about contacting hostgator's support? – Marcin Orlowski Dec 14 '15 at 11:34
  • I've already put a ticket in to them but had no luck so far. I thought it would be an easy one for a regular linux user. It's just changing the php destination but I just have no idea how that is done. I just don't want to type in what I think is right because I've had experience in messing things like this up in the past. – Ninja Dec 14 '15 at 11:44

1 Answers1

13

On my hostgator shared hosting, the php 5.6 executable is located at /opt/php56/bin/php

You can use ls /opt to see if the php version folders exist.

So if you want to update your php command with 5.6 you should edit your ~/.bash_profile and append the following line:

alias php='/opt/php56/bin/php'

You might have to logout and log in again if you dont see a change.

Now, when you use php -v it should say 5.6.x if you have done it right.

This works the same with 7.0 and any other php versions should be located in the same dir.

Andy
  • 2,892
  • 2
  • 26
  • 33