I am having a trouble on updating php version in homestead. When I check the version in homestead ssh
it says it's php version is PHP 5.6.23-1+deprecated+dontuse+deb.sury.org~trusty+1 (cli)
. Now I would like to update the PHP version to 7 for code compatibility. Is there an easy way how to fix this?
I also tried this one from here but got no luck. Thanks
Updating Homestead You can find the latest stable release version on Homestead's GitHub releases page. After updating the Vagrant box, you should run the bash init.sh command from the Homestead directory in order to update Homestead's additional configuration files.
Log into the control panel of your hosting provider. Under, the “Software” tab, click on Select PHP Version. On the next page, you will see the PHP version your web server is using. Now, click on the current PHP version and then select the latest version from the drop-down.
You have probably Laravel version 5.0 - https://laravel.com/docs/5.0/homestead, in this version Homestead has Ubuntu 14.04 and PHP 5.6. To update only PHP to 7.0, you need log into the Homestead, and execute:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get -y install php7.0-mysql php7.0-fpm php7.0-mbstring php7.0-xml php7.0-curl
Then you need change fastcgi_pass
in you configuration files in /etc/nginx/sites-available/*
to this fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
and at the end restart services:
/etc/init.d/nginx restart
/etc/init.d/php7.0-fpm restart
Upgrade the laravel/homestead box itself
$ vagrant box update
ssh into the virtual machine
$ vagrant ssh
and upgrade everything
$ sudo apt-get update
$ sudo apt-get upgrade
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With