Search code examples
phpapache.htaccesslaravel-5.5

How do you update php version to 7 on siteground server?


I have a system build with Laravel 5.5 and it needs PHP version 7. I have deployed the project to site ground server, updated PHP version using PHP version but when I ran php -v command via putty it is showing me PHP version 5. I don't know what going on. I shall be thankful if someone tell me that what is the proper way of updating PHP version? I have also tried AddHandler application/x-httpd-php70s .php in my .htaccess files but got nothing fruitful


Solution

  • So there's no problem if you see PHP5 using command line and PHP7 using php file with phpinfo();. Your hosting provider allows you to choose from several PHP version. You can select PHP7 e.g. using .htaccess but it doesn't have to change PHP CLI version. So when you set PHP7 in .htaccess file it serves your website using PHP7, but CLI is still v5.

    By the way, this type of question should be asked on superuser I think.