centos下的lnmp环境搭建
1.配置centos的第三方yum源,因为原始的yum是无法安装nginx的
wget http://www.atomicorp.com/installers/atomic 下载atomic yum源
sh ./atomic 执行安装
yum check-update
2.安装nginx
yum install nginx
service nginx start
chkconfig nginx on
3.安装mysql
yum install mysql mysql-server
service mysqld start
chkconfig mysqld on
4.安装php及其相关组件
yum install php-mysql php-redis php-devel php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel php-fpm php
service php-fpm start
chkconfig php-fpm on
5.修改相关配置使nginx支持php
vi /etc/nginx/conf.d/default.conf
去掉前面的注释
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #注意这里需要修改为$document_root
include fastcgi_params;
}
然后重启nginx,service nginx restart
现在已经可以支持php了
6.测试环境搭建是否成功
新建index.php文件在/usr/share/nginx/html路径下
<?php
phpinfo();
?>
访问地址 ###(ip地址或者绑定的域名)/index.php

显示这样的内容的话,证明已经配置成功了
centos下的lnmp环境搭建的更多相关文章
- CentOS下Web服务器环境搭建LNMP一键安装包
CentOS下Web服务器环境搭建LNMP一键安装包 时间:2014-09-04 00:50来源:osyunwei.com 作者:osyunwei.com 举报 点击:3797次 最新版本:lnmp- ...
- CentOS下JAVA WEB 环境搭建
首先介绍下我的软件环境.虚拟机Vmware9.0(已经汉化),CentOS6.4(选择安装语言为简体中文),xshell4.0(强大的安全终端模拟软件),xftp4.0(FTP工具). 方便大家环境搭 ...
- CentOS下 pycharm开发环境搭建之无穷无尽的问题
在上一篇的环境搭建中,表面上以为已经升级好python,安装好pycharm,并且可以用上了django框架,谁知道,谁知道,又是一断被虐的经历,我都要快恼羞成怒了. 在些记录一下我的经历. 1.首先 ...
- PHP - CentOS下开发运行环境搭建(Apache+PHP+MySQL+FTP)
本文介绍如何在 Linux下搭建一个 PHP 环境.其中 Linux 系统使用是 CentOS 7.3,部署在阿里云服务器上. 1,连接登录服务器 拿到服务器的 ip.初始密码以后.我们先通过远程 ...
- CentOS下 pycharm开发环境搭建
经过一系统列的折腾之后,我终于有高版本的python和我熟悉的输入法用了,下面来搭建pycharm下的python开发环境. 1.首先安装java jdk注意是JAVA 的JDK,不是JAVA VM什 ...
- CentOS下Hadoop运行环境搭建
1.安装ssh免密登录 命令:ssh-keygen overwrite(覆盖写入)输入y 一路回车 将生成的密钥发送到本机地址 ssh-copy-id localhost (若报错命令无法找到则需要安 ...
- centos下配置LNMP环境(源码安装)
准备工作,安装依赖库 yum -y install gcc automake autoconf libtool make gcc-c++ glibc libxslt-devel libjpeg lib ...
- 阿里云(ECS)Centos服务器LNMP环境搭建
阿里云( ECS ) Centos7 服务器 LNMP 环境搭建 前言 第一次接触阿里云是大四的时候,当时在校外公司做兼职,关于智能家居项目的,话说当时俺就只有一个月左右的 php 后台开发经验(还是 ...
- Linux下-LNMP环境搭建博客网站(全过程)
通常我们所说的LNMP是指一个网站基本的组织框架,即Linux系统支持,Nginx静态服务,Mysql数据库支持以及PHP动态编程语言支持.目前Mysql数据库被Oracle数据库分析公司收购,其创始 ...
随机推荐
- Maven配置 settings.xml 转
https://my.oschina.net/qjx1208/blog/201085 摘要: 记录settings.xml的配置,理解mirror.repository.profile的关系 本地仓库 ...
- Yii 将对象转化成数组
将从数据库查找的对象,转换成数组,并且以设定属性键名称,用到ArrayHelper::toArray $posts = Post::find()->limit(10)->all(); $d ...
- ASP.NET MVC- Controllers and Routing- Controller Overview
In this tutorial, Stephen Walther introduces you to ASP.NET MVC controllers. You learn how to create ...
- JMeter入门(2):一个简单实例
场景描述: 自己建立一个服务器端,接受参数:name和age,并将这些数据保存到数据库中: http://localhost:8080/Server/SaveServlet?name=xxx& ...
- GWT用frame调用JSP
Frame htmlFrame = new Frame("../OurHome/modules/core/mainIndex.jsp?merchantId="+merchantId ...
- android考试题
一.选择题 1. Math.round(11.5)等于多少( ). Math.round(-11.5) 等于多少( C ). A.11 ,-11 B.11 ,-12 C.12 ,-1 ...
- hdu 4773 Problem of Apollonius
莫名其妙就AC了-- 圆的反演-- 神马是反演? 快去恶补奥数-- #include<iostream> #include<map> #include<string> ...
- Optimizing Linux network TCP/IP kernel parameters
You can verify the Linux networking kernel parms from the root user with these commands::Many Oracle ...
- \n 与 \r
符号 ASCII码 意义 \n 换行NL \r 回车CR 回车 \r 本义是光标重新回到本行开头,r的英文return,控制字符可以写成CR,即Carriage Return 换行 \n 本义是光标往 ...
- Core Motion传感器原始数据
1.访问原始的Motion数据 #import <UIKit/UIKit.h> #import <CoreMotion/CoreMotion.h> @interface Vie ...