将wordpress博客导入本地环境,记录步骤如下
yun install mysql-server
安装好mysql后导入数据
如果mysql版本比较新,导入时会提示datetime默认值''0000-00-00 00:00:00'无效,将其改成有效值
#因为我的博客需要最新的php,所以添加新的yum源
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum install php php-mysqlnd php-fpm
vim /etc/yum.repos.d/remi-php81.repo
将enabled=1
vim /etc/php-fpm.d/www.conf
1 2 3 4 5 6 |
user = nginx group = nginx listen = /var/run/php-fpm/php-fpm.sock; listen.group = nginx listen.mode = 0660 |
vim /etc/nginx/nginx.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
root /var/www; # 前缀匹配,如果该文件以'/'结尾,那么添加具体的文件。 location / { index index.php index.html index.htm; } # '~*' 不区分大小写匹配.php后缀 location ~* \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } |
重启服务器
systemctl start php-fpm
systemctl start nginx
how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-7
Posted in: IT人生
Comments are closed.