博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
wordpress安装
阅读量:7286 次
发布时间:2019-06-30

本文共 3078 字,大约阅读时间需要 10 分钟。

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-fpmgroup = 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/binexport 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

你可能感兴趣的文章
死磕 java集合之ConcurrentLinkedQueue源码分析
查看>>
ubuntu安装sun jdk6
查看>>
phalapi-入门篇4(国际化高可用和自动生成文档)
查看>>
xcode报错集锦_1
查看>>
hadoop-mapreduce分析
查看>>
多线程学习(4)wait/notify
查看>>
OSChina 周五乱弹——让人伤心的事
查看>>
Golang配置
查看>>
android下拉刷新
查看>>
linux 中route命令的使用
查看>>
ArrayList既然继承自AbstractList抽象类,而AbstractList已经实现了List接口,那么ArrayList类为何还要再实现List接口呢?...
查看>>
CentOS安装Redis
查看>>
在iOS上实现一个简单的日历控件
查看>>
Android——Type mismatch类型转换错误的根源
查看>>
4.Utm详细实现-用户资源管理
查看>>
CentOS7.3安装Python3.6
查看>>
怎么才能用ABBYY FineReader提高工作效率
查看>>
STORM 落入MONGO速度优化
查看>>
python:守护进程deamon
查看>>
coding项目怎样和其他人共享
查看>>