Ubuntu18.04 PHP升级到最新版本

收录合集

在Ubuntu18.04上将PHP的版本从PHP7.3升级到PHP7.4,做如下记录

1.更新源
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update

2.安装php7.4组件

sudo apt install php7.4 libapache2-mod-php7.4 php7.4-common php7.4-mysql php7.4-gmp php7.4-curl php7.4-intl php7.4-mbstring php7.4-xmlrpc php7.4-gd php7.4-xml php7.4-cli php7.4-zip php7.4-mysql php7.4-imagick

3.配置apache2 文件,调整内存大小、上传文件大小等参数

sudo vim /etc/php/7.4/apache2/php.ini
file_uploads = On
allow_url_fopen = On
short_open_tag = On
cgi.fix_pathinfo = 0
memory_limit = 1024M
max_execution_time = 360
upload_max_filesize = 200M
max_file_uploads = 200

4.禁用php7.3
sudo a2dismod php7.3

5.启动php7.4
sudo a2enmod php7.4
sudo systemctl restart apache2.service

6.删除php7.3组件
sudo apt-get purge `dpkg -l | grep php7.3| awk '{print $2}' |tr "\n" " "`

双ISP家庭宽带美国原生IP超大带宽不限流量解锁ChatGPT、流媒体、TikTok, Lisahost新品4837线路。访问ChatGPT的可用VPS机房IP推荐 Lisahost美国原生IP搬瓦工美西DMITTripodcloudFrantech

本文由作者 okass2 发布在 WirelessLink , 转载请联系客服授权处理,获得授权后请保留文章的完整性并附上原文链接: https://wirelesslink.net/6405.html

2

Tags:

无限制访问资源 | 下载VIP专享资源 | 享受VIP会员专区优惠折扣 | 会员独享专栏| 去除广告| 会员订阅更多详情说明 订阅会员
We will be happy to hear your thoughts

      Leave a reply

      error: Content is protected !
      WirelessLink
      Logo