作为一名不喜欢MySQL的pg党,最近又迁了一个WordPress到PostgreSQL上,顺便就作个笔记以备不时不之需吧。当然,web server也从Apache换成了Nginx,所以这个配置也要改一下。
WordPress的Nginx配置
这个比较简单,因为Nginx不支持 .htaccess 配置只能改在conf里(使用php-fpm):
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/yoursite$fastcgi_script_name;
include fastcgi_params;
fastcgi_intercept_errors on;
}
安装WordPress和PG4WP
首先下载WordPress,并解压到你的网站目录。
然后下载PG4WP最新版,8月份更新的这个1.3.1版本已经修正了