1 2 3 4 5 |
sudo apt-get update sudo apt -y install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt -y install php7.4 |
參考:
AWS、PHP、LINUX、APACHE、MYSQL、CAKEPHP、JAVASCRIPT…….
1 2 3 4 5 |
sudo apt-get update sudo apt -y install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt-get update sudo apt -y install php7.4 |
參考:
1 2 |
sudo apt-get install php-zip sudo service apache2 restart |
1 2 |
sudo apt-get install php-imagick sudo service apache2 restart |
1 2 |
sudo apt-get install php7.4-mbstring sudo service apache2 restart |
1 2 |
sudo apt-get install php-xml sudo service apache2 restart |
參考文章:
1 2 3 |
sudo apt-get install php7.4-curl sudo service apache2 restart |
1 2 3 4 |
#gd版本看你php是多少版本就改成那個數字 sudo apt-get install php7.4-gd sudo service apache2 restart |
在Ubuntu上安裝了新版本php之後,要記得停用舊版本,才會去使用新版本。
1 2 3 4 5 6 7 |
sudo a2enmod php7.4 # 停用php7.2 sudo a2dismod php7.2 # Restart Apache sudo service apache2 restart |
參考文章:
https://stackoverflow.com/questions/55603615/change-my-php-version-on-my-ubuntu-server