1. nginx php-rpm 包升级

sudo rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

2. 安装mysql

sudo yum install mysql mysql-server
sudo /etc/init.d/mysqld restart
sudo /usr/bin/mysql_secure_installation

3. 安装nginx

sudo yum install nginx
sudo /etc/init.d/nginx start

这时你可以直接访问ip或者域名,查看nginx是否安装成功

4. 安装php

sudo yum --enablerepo=remi install php-fpm php-mysql

5. 配置php

sudo vi /etc/php.ini
#cgi.fix_pathinfo=1
cgi.fix_pathinfo=0
doc_root = /usr/share/nginx/html

6. 配置nginx

默认的配置文件nginx.conf

sudo vi /etc/nginx/nginx.conf
processer = 4
sudo vi /etc/nginx/conf.d/default.conf
#
# The default server
#
server {
listen 80;
server_name example.com; location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
} error_page 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
} error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

1) location  下

添加index.php

2) root 可以改成你想要的位置,如/var/www/wordpress

3)server_name 改成你的域名或者ip或者localhost

4) location ~ \.php$ { 下面的root要和上面location的一样

5)fastcgi_param 帮助php解释器在document root找到php脚本

7. 配置php-fpm

sudo vi /etc/php-fpm.d/www.conf

替换apahce到nginx

[...]
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx
[...]

重启php-fpm

sudo service php-fpm restart

8.添加php测试页面

sudo vi /usr/share/nginx/html/info.php
sudo service nginx restart

9. 添加开机自动重启

sudo chkconfig --levels 235 mysqld on
sudo chkconfig --levels 235 nginx on
sudo chkconfig --levels 235 php-fpm on

上面环境配置好以后就可以安装wordpress了

1. 下载并解压

wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz

2. 创建数据库

mysql -u root -p
CREATE DATABASE wordpress;
CREATE USER wordpressuser@localhost;
SET PASSWORD FOR wordpressuser@localhost= PASSWORD("password");
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
exit

3. 配置wordpress

复制配置文件并配置

cp ~/wordpress/wp-config-sample.php ~/wordpress/wp-config.php
vi ~/wordpress/wp-config.php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress'); /** MySQL database username */
define('DB_USER', 'wordpressuser'); /** MySQL database password */
define('DB_PASSWORD', 'password');

复制wordpress到nginx的root目录下,

sudo cp -r ~/wordpress/* /var/www/html

可能需要php-gd

sudo yum install php-gd

重启nginx

sudo service httpd restart

4 安装wordpress

访问你的域名http:xxx.com/wp-admin/install.php 来安装,很简单。

这样一个wordpress的博客配置就完成了。

CentOS 6.4 php环境配置以及安装wordpress的更多相关文章

  1. centos 7.3 服务器环境搭建——MySQL 安装和配置

    centos 7.3 服务器环境搭建——MySQL 安装和配置服务器信息如下:服务器:阿里云系统 centos 7.3 (阿里云该版本最新系统)mysql版本:5.7.18 (当前时间最新版本)连接服 ...

  2. ubuntu 开发环境配置及安装 nodejs

    ubuntu 开发环境配置及安装 nodejs 1 安装nodejs $ sudo apt-get install build-essential $ sudo apt-get install gcc ...

  3. ogre3d环境配置 SDK安装配置及简单事例教程

    ogre3d环境配置 SDK安装配置及简单事例教程 http://www.cr173.com/html/22594_1.html ogre3d环境配置 SDK安装配置及简单事例教程 http://ww ...

  4. yaf框架在windows上的环境配置和安装

    1.首先检测你的php版本 如图:Architecture:×86和thread Safety:disabled 这个有什么用呢? 2.进入这个网站 tgz是linux下的扩展包,windows下点D ...

  5. Mac本地环境配置以及安装织梦CMS,增加新的坑解决办法

    Mac上其实已经自带了Apache和PHP,只是默认关闭的.开启一下就行了. Apache配置 apache已经自带了,只需在“终端”输入命令开启下就行了. ​​​开启apache服务 sudo ap ...

  6. windows下《Go Web编程》之Go环境配置和安装

    <Go Web编程>笔者是基于unix下讲述的,作为入门练手,我选择在windows下开发,全程按照目录进行... 一.安装 windows下需要安装MinGW,通过MinGW安装gcc支 ...

  7. WAMP环境配置-PHP安装

    我这次环境配置安装的是php-5.6.25版本! (最近我在反复安装PHP的时候出现了一个问题,httpd.conf加载php5apache2_4.dll出现错误,怎么修改都不行,此时我安装的是VC1 ...

  8. Jmeter Web 性能测试入门 (一):环境配置 (免安装版)

    去官网下载并安装java jdk8 去官网下载jmeter binaries最新的zip,并解压到某路径下.(注:由于jmeter-server的限制,放置的路径不要太长,路径不要带空格,例如:D:\ ...

  9. PyTorch环境配置及安装

    环境配置 温馨提示:为了更好的教程体验,提供视频.阅读地址 Youtube: https://www.youtube.com/playlist?list=PLgAyVnrNJ96CqYdjZ8v9Yj ...

随机推荐

  1. 基于struts2的ajaxfileupload异步上传插件的使用

    服务器端采用struts2来处理文件上传. 所需环境: jquery.js ajaxfileupload.js struts2所依赖的jar包 及struts2-json-plugin-2.1.8.1 ...

  2. spark LinearRegression 预测缺失字段的值

    最近在做金融科技建模的时候,字段里面很多缺少值得时候,模型对于新用户的预测会出现很大的不稳定,即PSI较大的情况. 虽然我们依据字段IV值得大小不断的在调整字段且开发新变量,但是很多IV值很大的字段直 ...

  3. 非抢占式RCU中的一些概念

    该记录着重介绍下:2.6.34版本中非抢占式RCU的基本概念. RCU保护的是指针,因为指针的赋值可以使用原子操作完成: 在非抢占式RCU中: 对于读者,RCU仅需要抢占失效,因此获得读锁和释放读锁分 ...

  4. 【数据分析知识点】detailed table of contents

    Exploratory Data Analysis - Detailed Table of Contents http://www.itl.nist.gov/div898/handbook/eda/e ...

  5. 页面加载中jquery逐渐消失效果实现

    为了获得更好的用户体验,现在大多数网页都会在页面中加一个加载中效果,这里实现一个加载中逐渐消失的效果,以至于看上去不那么生硬. html: <div id="loading" ...

  6. centos6.8 安装Python2.7后, yum出现“No module named yum”错误

    出现yum错误:No module named yum 解决方法,查看 /usr/bin下python有哪几个版本 ll /usr/bin 我这里是:2.6  和  2.7 (刚安装的) 由于yum命 ...

  7. python中的字符串常量,是否支持通过下标的方式赋值

    说明: 今天在看python,通过下标获取字符串常量的字符,在想是否可以通过下标的方式赋值. 操作: 1.对字符串下标赋值 >>> text='python' >>> ...

  8. swagger的说明、配置及使用

    一.What is swagger? 官方介绍:Swagger是一个规范且完整的框架,提供描述.生产.消费和可视化RESTful Web Service.专业角度:Swagger是由庞大工具集合支撑的 ...

  9. Batch Normalization 学习笔记

    原文:http://blog.csdn.net/happynear/article/details/44238541 今年过年之前,MSRA和Google相继在ImagenNet图像识别数据集上报告他 ...

  10. BearSkill纯代码搭建iOS界面

    欢迎相同喜欢动效的project师/UI设计师/产品增加我们 iOS动效特攻队–>QQ群:547897182 iOS动效特攻队–>熊熊:648070256 浅谈一下 关于iOS兼容布局一直 ...