Cách Cài Đặt & Nâng Cấp Php 5, Cách Cài Đặt Và Cấu Hình Php 7

I have seen some help on this online but for other distros. Before I screw something up, I would love some help on this for my exact thiết lập which is below. This will ultimately be for upgrading Laravel to lớn 5.6 which needs newer php version.

Bạn đang xem: How khổng lồ downgrade and upgrade php 7

Ubuntu LTS, MariaDB, nginx, Laravel 5.5, AWS EC2 instance


Bạn đang xem: Cách cài Đặt & nâng cấp php 5, cách cài Đặt và cấu hình php 7

*

Use terminal and download repo:

sudo add-apt-repository ppa:ondrej/php sudo apt-get updateThen install:

service apache2 stop sudo apt-get install php7.1 php7.1-commonStart using php 7.1:

a2enmod php7.1 service apache2 restartCheck version:

php -vMore for apache : https://jakelprice.com/article/how-to-upgrade-from-php-70-to-php-71

More for NGINX: https://www.howtoforge.com/tutorial/installing-nginx-with-php7-fpm-and-mysql-on-ubuntu-16.04-lts-lemp/


*

I was also wondering how to lớn update to the latest 7.1.* version. I had PHP 7.1.7 but for Symfony 4 I need >=7.1.8.I coudn"t find an explanation how khổng lồ updated. Finally I kiểm tra how I installed the latest version:

Xem thêm: Gái Ngoan Ngoại Tình Vì Chồng Yếu Sinh Lý Vợ Ngoại Tình Vì Chồng Yếu Sinh Lý

*

Use Vagrant + DockerYou can use Vagrant + Docker to replicate your environment except for PHP which will be 7.1 và see if the tiện ích is still working :)
*

Thanks for contributing an answer lớn Stack Overflow!

Please be sure to lớn answer the question. Provide details và share your research!

But avoid

Asking for help, clarification, or responding khổng lồ other answers.Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

Post Your Answer Discard

By clicking “Post Your Answer”, you agree lớn our terms of service, privacy policy & cookie policy

Not the answer you're looking for? Browse other questions tagged php laravel ubuntu or ask your own question.


*

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device & disclose information in accordance with our Cookie Policy.