linux系统如何安装php8.3.4
1. 添加PHP软件源
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo yum install epel-release
sudo yum install php83w php83w-common php83w-devel
2. 安装PHP8.3.4
Ubuntu/Debian:
Bash
sudo apt-get install php8.3 php8.3-fpm php8.3-common php8.3-cli php8.3-mysql php8.3-gd php8.3-curl php8.3-xml php8.3-mbstring
php8.3-mysql
、php8.3-gd
等扩展。CentOS/RHEL:
Bash
sudo yum install php83w php83w-fpm php83w-common php83w-cli php83w-mysql php83w-gd php83w-curl php83w-xml php83w-mbstring
3. 配置PHP
sudo vim /etc/php/8.3/fpm/php.ini
date.timezone = Asia/Shanghai # 替换为你的时区
4. 启动PHP-FPM服务
sudo systemctl start php8.3-fpm
sudo systemctl enable php8.3-fpm
sudo systemctl start php-fpm
sudo systemctl enable php-fpm
5. 验证安装
sudo nano /var/www/html/info.php
PHP
<?php
phpinfo();
sudo apt-get install php8.3-redis # Ubuntu/Debian
sudo yum install php83w-redis # CentOS/RHEL
sudo pecl install redis
8.3
为你要安装的PHP版本。通过以上步骤,你应该成功地在Linux系统上安装PHP8.3.4。
如果你在安装过程中遇到任何问题,请提供以下信息:
我会尽力帮助你解决问题。