centos7.3安装php7.0
需求:在Centos7.3下搭建LNMP环境 文章转载自:http://blog.csdn.net/wszll_alex/article/details/76285324 作者:狂热森林
. 关闭防火墙和selinux 打开文件selinux vim /etc/sysconfig/selinux 将文件中SELINUX=enforcing改为disabled,然后执行”setenforce ″不用重启地关闭selinux。 SELINUX=disabled 关闭放火墙 systemctl stop firewalld.service .安装软件
2.1.MYSQL安装 下载MySQL的repo源 wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm 安装mysql-community-release-el7-.noarch.rpm包 rpm -ivh mysql-community-release-el7-.noarch.rpm 安装MYSQL sudo yum install -y mysql-server 更改MYSQL用户权限: sudo chown -R root:root /var/lib/mysql 重启服务: systemctl restart mysql.service 登录,并修改密码: mysql -u root
mysql > use mysql;
mysql > update user set password=password(‘‘) where user=‘root‘;
mysql > exit; .2nginx安装 下载对应当前系统版本的nginx包 wget http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm 建立nginx的yum仓库(默认yum是没有nginx的) rpm -ivh nginx-release-centos--.el7.ngx.noarch.rpm 下载并安装nginx yum install -y nginx nginx启动 systemctl start nginx.service .3安装php rpm 安装 Php7 相应的 yum源 rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm 安装php7. yum install -y php70w 安装PHP扩展 yum install -y php70w-mysql.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 安装php FPM yum install -y php70w-fpm . 修改配置文件
.1修改Nginx配置文件 nginx配置文件位置:(/etc/nginx/conf.d/default.conf) vim /etc/nginx/conf.d/default.conf 修改 root目录,可自定义: root /forest/nginxDir/html; 配置php解析,修改 下面代码中黑色加粗部分: location ~.php$ {
root /forest/nginxDir/html;
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
} 3.2 修改php-fpm配置文件 php-fpm配置文件位置:(/etc/php-fpm.d/www.conf)
修改 user =nginx
group=nginx .放入测试文件 cd /forest/nginxDir/html
echo 'hello eric' >index.php .启动服务
.1启动nginx服务: systemctl start nginx.service 查看启动状态: systemctl status nginx 看到以下字眼说明启动成功!
Active: active (running) since 六 -- :: CST; 50min ago
5.2.启动PHP-FPM: systemctl start php-fpm.service 查看启动状态: systemctl status php-fpm.service 看到以下字眼说明启动成功!
Active: active (running) since 六 -- :: CST; 18min ago
.测试 在浏览器打开192.168.44.:/index.php
看到 hello eric 就大功告成~ 设置开机自启动服务systemctl enable php-fpm.servicesystemctl enable nginx.service如项目框架为lavarel,则配置文件可用下面这个:
server {
listen 80;
server_name learn.laravel5.com;
root /var/www/html/learnlaravel5/public;
index index.html
index.php;
location / {
try_files $uri $uri/
/index.php$is_args$query_string;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME
$document_root$fastcgi_script_name;
include fastcgi_params;
}
}
centos7.3安装php7.0的更多相关文章
- centos7下编译安装php-7.0.15(PHP-FPM)
centos7下编译安装php-7.0.15(PHP-FPM) 一.下载php7源码包 http://php.net/downloads.php 如:php-7.0.15.tar.gz 二.安装所需依 ...
- Linux Centos7.2 编译安装PHP7.0.2
操作环境: 1.系统:Centos7.2 2.服务:Nginx 1.下载PHP7.0.2的安装包解压,编译,安装: $ cd /usr/src/ $ wget http://cn2.php.net/d ...
- Centos7 离线安装 php7
问题:因内部管控,机器无法连接公有yum源安装php. 正常安装php7可以参考CentOS7.2 安装 PHP7.2 下面的代码也是一种方法 yum -y install libmcrypt lib ...
- Centos7 编译安装PHP7
Centos7 编译安装PHP7 编译安装的方式可以让组件等设置更加合理,但需要你对PHP的代码及各种配置非常的熟悉,以下为大致的安装流程,大家可以参考 1.下载编译工具 yum groupinsta ...
- CentOS7编译安装php7.1配置教程详解
这篇文章主要介绍CentOS7编译安装php7.1的过程和配置详解,亲测 ,需要的朋友可以参考. 1.首先安装依赖包: yum install libxml2 libxml2-devel openss ...
- Linux安装php-7.0.16,完成php和apache的配置
Linux安装php-7.0.16,完成php和apache的配置 版本:php-7.0.16.tar.gz,libxml2-2.9.2.tar.gz(php需要它的支持,首先安装它) 说明 ...
- centos7.x部署php7.0、mysql
1.安装httpd yum install httpd systemctl start httpd.service #启动命令 systemctl stop httpd.service #停止命令 s ...
- CentOS7离线安装MySQL8.0
CentOS7离线安装MySQL8.0 卸载软件 rpm -e --nodeps 要卸载的软件包 root@jacky zookeeper]# rpm -e --nodeps java-1.6.0-o ...
- centos7.5环境下编译安装php7.0.30并安装redis和mongo扩展
.安装php7..30的脚本 # vim install_php.sh #!/bin/bash # 安装基本依赖 yum install -y gcc gcc-c++ htop telnet ioto ...
随机推荐
- vue自定义tap指令
1.Vue指令 Vue提供自定义实现指令的功能, 和组件类似,可以是全局指令和局部指令,详细可以参见vue官网自定义指令一节(https://cn.vuejs.org/v2/guide/custom- ...
- linux软链接与硬链接详解
软连接 命令: ln -s 原文件 目标文件 特征: 1.相当于windows的快捷方式 2.只是一个符号连接,所以软连接文件大小都很小 3.当运行软连接的时候,会根据连接指向找到真正的文件,然后执行 ...
- Eclipse项目启动不了
当你的Eclipse项目启动不了多半是[eclipse工程jdk版本]的问题 在eclipse中项目jdk版本不匹配的时候需要修改项目工程的jdk版本,但是网上的一些版本修改不是很完全,经过一些摸索之 ...
- Unity 代码集锦之图片处理
1.将Texture2D保存为jpg void TestSaveImageToJPG(Texture2D buffer) { File.WriteAllBytes("F:/output.jp ...
- hbase的hbase-site.xml配置文件
<property> <name>hbase.rootdir</name> <value>hdfs://server110/hbase</valu ...
- CSS隐藏overflow默认滚动条同时保留滚动效果
主要应用于移动端场景,仿移动端滚动效果.对于隐藏滚动条,众所周知overflow:hidden,但是想要的滚动效果也没了. 所以对于移动端webkit内核提供一个伪类选择器: .element::-w ...
- mybatis插入操作时,返回自增主键id
mapper.xml 代码 <insert id="insert" parameterType="com.Student" > <select ...
- LaTeX 表格指定宽度并居中
本系列文章由 @YhL_Leo 出品,转载请注明出处. 文章链接: http://blog.csdn.net/yhl_leo/article/details/50532269 在绘制表格的时候,对于特 ...
- [ReactVR] Animate Text, Images, Views, and 3D Elements Using the Animated Library in React VR
Motion is an important aspect of a complete immersive experience, therefor we are going to look into ...
- 阿里云server部署架构
近期要上马一个项目,客户要求所有部署到阿里云的server,做了一个阿里云的部署方案. 上图: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc21hbGx ...