首页 > 教程 >
Centos7 yum安装php的方法
2023-02-18教程围观次
简介Centos7yum安装php的方法:首先安装nginx以及MYSQL;然后通过命令“yuminstallphp71wphp71w-fpmphp71w-cliphp71w-common...”安装php以及扩展即可。Centos7yum快速安装php7.11、安装nginxyuminstallnginx##开启nginxservicenginxstart2、安装MYSQLyumlocalinsta
Centos7 yum安装php的方法:首先安装nginx以及MYSQL;然后通过命令“yum install php71w php71w-fpm php71w-cli php71w-common...”安装php以及扩展即可。
Centos7 yum快速安装php7.1
1、安装nginx
yum install nginx##开启nginxservice nginx start
2、安装MYSQL
yum localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpmyum install mysql-community-server//开启mysqlservice mysqld start//查看mysql的root账号的密码grep 'temporary password' /var/log/mysqld.log//登录mysqlmysql -uroot -p//修改密码ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';//修改root用户可远程登录GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;//刷新flush privileges;
3、安装php
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmrpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm//查看yum search php71w//安装php以及扩展yum install php71w php71w-fpm php71w-cli php71w-common php71w-devel php71w-gd php71w-pdo php71w-mysql php71w-mbstring php71w-bcmath//开启服务service php-fpm start//修改/etc/nginx/nginx.conf 使其支持php 见下//重启nginxservice nginx restart---------------------配置
server { charset utf-8; client_max_body_size 128M; listen 80; ## listen for ipv4 server_name localhost; root /var/www/; index index.php; location / { if (!-e $request_filename){ rewrite ^/(.*)$ /index.php/$1 last; } try_files $uri $uri/ /index.php?$args; } location ~ .php$ { include fastcgi.conf; fastcgi_pass 127.0.0.1:9000; try_files $uri =404; } location ~ .php { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include /etc/fastcgi_params; fastcgi_split_path_info ^(.+.php)(/?.*)$; fastcgi_param _FILENAME fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; } error_page 404 /404.html; location ~ /.(ht|svn|git) { deny all; }}
4、安装redis
yum install redis//修改配置 vi /etc/redis.conf//daemonize yes 后台运行//appendonly yes 数据持久化service redis start
5、安装php-redis扩展
//先装gityum install git//git下扩展cd /usr/local/srcgit clone https://github.com/phpredis/phpredis.git//安装扩展cd phpredisphpize//修改php配置vi /etc/php.ini 添加extension=redis.so//重启phpservice php-fpm restart
下载链接:网站源码/小程序源码/网站模板下载
下载排行
- WordPress主题 JustNews5.2.2 + QAPress问答插件适合源码站虚拟资源站个人博客
- 最新去水印小程序源码分享/无需后台/对接接口/支持全网去水印功能
- 自带多平台解析接口短视频去水印图集水印小程序源码下载
- ThinkPHP高仿蓝奏云网盘系统源码/对接易支付系统程序
- 知识付费小程序源码升级版知识付费变现小程序源码+卡密-独立后台版本
- 某鱼最近卖的很火蓝色版微信去水印小程序源码+接口
- TooNaughty网址导航主题/WordPress主题下载
- 最新短视频去水印小程序源码/带流量主/外卖CPS系统/批量解析/修改MD5
- 新版多功能去水印工具微信小程序源码下载+带流量主功能
- 起点导航系统源码最新V2.6开源可运营版