Centos7 yum安装php的方法:首先安装nginx以及MYSQL;然后通过命令“yum install php71w php71w-fpm php71w-cli php71w-common...”安装php以及扩展即可。
Centos7 yum快速安装php7.1
1、安装nginx
yuminstallnginx##开启nginxservicenginxstart
2、安装MYSQL
yumlocalinstallhttp://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpmyuminstallmysql-community-server//开启mysqlservicemysqldstart//查看mysql的root账号的密码grep'temporarypassword'/var/log/mysqld.log//登录mysqlmysql-uroot-p//修改密码ALTERUSER'root'@'localhost'IDENTIFIEDBY'password';//修改root用户可远程登录GRANTALLPRIVILEGESON*.*TO'root'@'%'IDENTIFIEDBY'password'WITHGRANTOPTION;//刷新flushprivileges;
3、安装php
rpm-Uvhhttps://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmrpm-Uvhhttps://mirror.webtatic.com/yum/el7/webtatic-release.rpm//查看yumsearchphp71w//安装php以及扩展yuminstallphp71wphp71w-fpmphp71w-cliphp71w-commonphp71w-develphp71w-gdphp71w-pdophp71w-mysqlphp71w-mbstringphp71w-bcmath//开启服务servicephp-fpmstart//修改/etc/nginx/nginx.conf使其支持php见下//重启nginxservicenginxrestart---------------------配置server{charsetutf-8;client_max_body_size128M;listen80;##listenforipv4server_namelocalhost;root/var/www/;indexindex.php;location/{if(!-e$request_filename){rewrite^/(.*)$/index.php/$1last;}try_files$uri$uri//index.php?$args;}location~\.php${includefastcgi.conf;fastcgi_pass127.0.0.1:9000;try_files$uri=404;}location~\.php{fastcgi_pass127.0.0.1:9000;fastcgi_indexindex.php;include/etc/fastcgi_params;fastcgi_split_path_info^(.+\.php)(/?.*)$;fastcgi_paramSCRIPT_FILENAMEfastcgi_paramPATH_INFO$fastcgi_path_info;fastcgi_paramPATH_TRANSLATED$document_root$fastcgi_path_info;}error_page404/404.html;location~/\.(ht|svn|git){denyall;}}
4、安装redis
yuminstallredis//修改配置vi/etc/redis.conf//daemonizeyes后台运行//appendonlyyes数据持久化serviceredisstart
5、安装php-redis扩展
//先装gityuminstallgit//git下扩展cd/usr/local/srcgitclonehttps://github.com/phpredis/phpredis.git//安装扩展cdphpredisphpize//修改php配置vi/etc/php.ini添加extension=redis.so//重启phpservicephp-fpmrestart
产品猿社区致力收录更多优质的商业产品,给服务商以及软件采购客户提供更多优质的软件产品,帮助开发者变现来实现多方共赢;
日常运营的过程中我们难免会遇到各种版权纠纷等问题,如果您在社区内发现有您的产品未经您授权而被用户提供下载或使用,您可按照我们投诉流程处理,点我投诉;
本文来自用户发布投稿,不代表产品猿立场 ;若对此文有疑问或内容有严重错误,可联系平台客服反馈;
部分产品是用户投稿,可能本文没有提供官方下下载地址或教程,若您看到的内容没有下载入口,您可以在我们产品园商城搜索看开发者是否有发布商品;若您是开发者,也诚邀您入驻商城平台发布的产品,地址:点我进入;
如若转载,请注明出处:https://www.chanpinyuan.cn/42288.html;