wordpress安装

1.安装php(我选的版本是5.6.2)

(1) 安装依赖环境

yum install libxml2-devel curl-devel libjpeg-devel libpng-devel freetype-devel openssl-devel -y

 

还有一个依赖需要用源码装:

# wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz
# tar xf libmcrypt-2.5.7.tar.gz
# cd libmcrypt-2.5.7
# ./configure --prefix=/usr/local/libmcrypt && make && make install

 

(2) 编译php

# cd /usr/local/src/
# wget http://cn2.php.net/distributions/php-5.6.2.tar.gz
# tar xf php-5.6.2.tar.gz
# cd php-5.6.2
# ./configure --prefix=/usr/local/php-5.6.2 \
--with-config-file-path=/usr/local/php-5.6.2/etc \
--enable-fpm --with-fpm-user=php-fpm --with-mysql=mysqlnd \
--with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir \
--with-freetype-dir --with-iconv-dir --with-zlib-dir \
--with-mcrypt=/usr/local/libmcrypt \
--enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring \
--enable-exif --disable-ipv6 --with-pear --with-curl --with-openssl
# make && make install

 

(3) 启动php-fpm

# cp /usr/local/src/php-5.6.2/php.ini-production /usr/local/php-5.6.2/etc/
# cd /usr/local/php-5.6.2/etc/
# cp php-fpm.conf.default php-fpm.conf
# groupadd php-fpm
# useradd -g php-fpm -s /sbin/nologin php-fpm
# vim php-fpm.conf
---------------
user = php-fpm
group = php-fpm
---------------
# cp /usr/local/src/php-5.6.2/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
# chmod +x /etc/init.d/php-fpm
# /etc/init.d/php-fpm start

 

2. 安装数据库

# tar xf mysql-5.5.54-linux2.6-x86_64.tar.gz -C /usr/local/
# cd /usr/local/
# mv mysql-5.5.54-linux2.6-x86_64 mysql
# groupadd mysql
# useradd -g mysql -s /sbin/nologin mysql
#  cd /usr/local/mysql/scripts/
#  ./mysql_install_db --basedir=/usr/local/mysql \
--datadir=/usr/local/mysql/data --user=mysql
# chown -R mysql:mysql /usr/local/mysql
# cp /etc/my.cnf /etc/my.cnf.bak
# cp /usr/local/mysql/support-files/my-large.cnf /etc/my.cnf
# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
# chmod +x /etc/init.d/mysqld

 

添加环境变量:

# vim /etc/profile
在末尾添加:
PATH=$PATH:/usr/local/mysql/bin
export PATH

 

创建数据库:

mysql > create database wordpress;
mysql > grant all on wordpress.* to 'wp'@'localhost' identified by 'wp';
mysql > flush privileges;

 

3.配置Nginx

# vim /usr/local/nginx/conf/nginx.conf
--------------------------------
location / {
  root html;
  index index.php index.html index.htm;
}
location
~ \.php$ {   root html;   fastcgi_pass 127.0.0.1:9000;   fastcgi_index index.php;   fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;   include fastcgi_params; } ---------------------------------

# /usr/local/nginx/sbin/nginx 启动Nginx

 

4.下载配置wordpress

# wget https://cn.wordpress.org/wordpress-4.5.3-zh_CN.tar.gz
# tar xf wordpress-4.5.3-zh_CN.tar.gz
# cp -r wordpress/* /usr/local/nginx/html/
# cd /usr/local/nginx/html
# cp wp-config-sample.conf wp-config.conf
# vim wp-config.conf
------------------------------
define('DB_NAME', 'wordpress');
define('DB_USER', 'wp');
define('DB_PASSWORD', 'wp');
define('DB_HOST', '127.0.0.1');  // 注意此处一定写127.0.0.1,因为写localhost和主机IP无效
-------------------------------

 

5.浏览器访问

http://www.example.com

http://IP

转载于:https://www.cnblogs.com/t-road/p/6878650.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值