yum安装php7.3,安装zip扩展
1.安装php:
安装 EPEL 源
yum install epel-release
安装 REMI 源
yum install irepo/enterprise/remi-release-7.rpm
安装 Yum 源管理⼯具
yum install yum-utils
安装php7.3
# yum install -y php73-php-fpm php73-php-cli php73-php-bcmath php73-php-gd php73-php-json php73-php-mbstring php73-php-mcrypt php73-php-mysqlnd php73-php-opcache php73-php-pdo php73-php-pecl-crypto php73-php-pecl-mcrypt php73-php-pecl-geoip php73-php-recode php73-php-sn
mp php73-php-soap php73-php-xmll
开机⾃启及启动php
systemctl start php73-php-fpm
systemctl enable php73-php-fpm
设置 PHP
查安装包:
rpm -qa | grep 'php'
编辑/etc/opt/remi/php73/php.ini替换换 ;cgi.fix_pathinfo=1 为 cgi.fix_pathinfo=0 快捷命令:
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/opt/remi/php73/php.ini
查看下版本
更多操作:
systemctl restart php73-php-fpm #重启
systemctl start php73-php-fpm #启动
systemctl stop php73-php-fpm #关闭
systemctl status php73-php-fpm #检查状态
查zip扩展包
yum search php73|grep zip
安装zip扩展包
yum -y install php73-php-pecl-zip.x86_64
php8兼容php7吗安装好后重启下php
systemctl restart php73-php-fpm
2.yum安装nginx
添加源
rpm -Uvh /packages/centos/7/noarch/RPMS/arch.rpm
安装Nginx
通过yum search nginx看看是否已经添加源成功。如果成功则执⾏下列命令安装Nginx。
yum install -y nginx
启动Nginx并设置开机⾃动运⾏
systemctl start nginx.service && systemctl enable nginx.service
修改配置⽂件⽀持php,yum安装的主配置⽂件/etc/nginx/下,发布⽬录在/usr/share/nginx/html,⽇志在/var/log/nginx/,修改⼦配置⽂件
vim /etc/nginx/conf.f
给个php测试⽂件
vim /usr/share/nginx/html/index.php
<?php
phpinfo();
>
重启下nginx
nginx -s reload
⽹页访问下,有了zip的扩展,昨天装了半天⼀直装不好的东西。。所以才放弃编译安装了。。
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论