文章目录[隐藏]
wget https://cn.wordpress.org/wordpress-4.7.4-zh_CN.zip
unzip wordpress-4.7.4-zh_CN.zip
mysql> create schema db_word_press;
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on db_word_press.* to wordpress@'localhost' identified by 'nk-KfD6C;Z\1AZ"';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
yum -y install libmcrypt-devel mhash-devel libxslt-devel
yum install -y libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel
yum install -y zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel
yum install -y ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel
yum install -y krb5 krb5-devel libidn libidn-devel openssl openssl-devel
wget http://php.net/get/php-7.1.7.tar.gz/from/this/mirror
tar xvf mirror
./configure --prefix=/usr/local/php --enable-fpm --with-mcrypt --enable-mbstring --enable-pdo --with-pdo-mysql --enable-mysqlnd --with-curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --with-zlib --enable-sockets --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-mhash --enable-zip --with-pcre-regex --with-mysqli --with-gd --with-jpeg-dir --with-openssl=/usr
make all install
groupadd www-data
useradd -g www-data www-data
chown -R www-data:www-data wordpress/
chmod 755 wordpress
cp /usr/local/etc/php-fpm.conf.default /usr/local/etc/php-fpm.conf
cp /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf
server {
listen 80;
index index.html index.php;
server_name blog.lzxz1234.cn;
root /opt/wordpress;
location / {
#index index.html index.php;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.php$ {
root /opt/wordpress;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
}