I finally got the database to update. However, the update did cause my forums page to basically not have a template any longer, or so it appears. Also, the phpMyAdmin page no longer loads either.
Help, please?
This
nginx.conf layout is taken directly from the example shown by Paul (
here).
All changes listed from the semi-working proposal from Marc's recent
nginx.conf post above have been applied to include
/forums/
where necessary. One of the required locations needing
/forums/
to be present was missed but was added and noted below, which ended up making the upgrade process finally work.
All other edits made in conjunction with Marc's proposal are also posted below to show the "
before" and "
after" changes with several notes regarding issues and solutions that may fix them.
Once again, my URL in the configuration file below has been changed to "
mywebsite.com" since I do not wish to share my link here.
Here is my
working nginx.conf file which I used to upgrade phpBB 3.1.10 to 3.2.0 running on Windows:
Code: Select all
# Sample nginx configuration file for phpBB.
# Global settings have been removed, copy them
# from your system's nginx.conf.
# Tested with nginx 0.8.35.
# If you want to use the X-Accel-Redirect feature,
# add the following to your config.php.
#
# define('PHPBB_ENABLE_X_ACCEL_REDIRECT', true);
#
# See http://wiki.nginx.org/XSendfile for the details
# on X-Accel-Redirect.
# Custom Settings (1 of 2) START
worker_processes auto;
error_log logs/error.log;
events {
worker_connections 1024;
}
# Custom Settings (1 of 2) END
http {
# Custom Settings (2 of 2) START
#client_body_timeout 60s;
#client_header_timeout 60s;
#client_max_body_size 1m;
#default_type application/octet-stream;
#include mime.types;
#keepalive_timeout 75s;
#send_timeout 60s;
#sendfile off;
server_tokens off;
server_names_hash_bucket_size 64;
# Custom Settings (2 of 2) END
# Compression - requires gzip and gzip static modules.
#gzip on;
#gzip_static on;
#gzip_vary on;
#gzip_http_version 1.1;
#gzip_min_length 700;
# Compression levels over 6 do not give an appreciable improvement
# in compression ratio, but take more resources.
#gzip_comp_level 6;
# IE 6 and lower do not support gzip with Vary correctly.
#gzip_disable "msie6";
# Before nginx 0.7.63:
#gzip_disable "MSIE [1-6]\.";
# Catch-all server for requests to invalid hosts.
# Also catches vulnerability scanners probing IP addresses.
#server {
# default specifies that this block is to be used when
# no other block matches.
#listen 80 default;
#server_name bogus;
#return 444;
#root /var/empty;
#}
# If you have domains with and without www prefix,
# redirect one to the other.
server {
# Default port is 80.
#listen 80;
server_name mywebsite.com;
# A trick from http://wiki.nginx.org/Pitfalls#Taxing_Rewrites:
rewrite ^ http://www.mywebsite.com$request_uri permanent;
# Equivalent to:
#rewrite ^(.*)$ http://www.mywebsite.com$1 permanent;
}
# The actual board domain.
server {
#listen 80;
server_name www.mywebsite.com;
root C:/nginx/html;
location / {
# Main index page for WordPress. If it is not running then this is the index page for Nginx. This part may need to be removed if it causes trouble or is unnecessary.
index index.php index.html index.htm;
try_files $uri $uri/ /index.php;
}
location /forums/ {
# phpBB uses index.htm
index index.php index.html index.htm;
try_files $uri $uri/ @rewriteapp;
}
location @rewriteapp {
rewrite ^(.*)$ /forums/install/app.php/$1 last;
}
# Deny access to internal phpBB files.
location ~ /forums/(config\.php|common\.php|includes|cache|files|store|images/avatars/upload) {
deny all;
# deny was ignored before 0.8.40 for connections over IPv6.
# Use internal directive to prohibit access on older versions.
internal;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root C:/nginx/html;
}
# Pass the php scripts to FastCGI server specified in upstream declaration.
location ~ \.php(/|$) {
# Unmodified fastcgi_params from nginx distribution.
include fastcgi_params;
# Necessary for php.
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
try_files $uri $uri/ /app.php$is_args$args;
fastcgi_pass php;
}
# Correctly pass scripts for installer
location /forums/install/ {
# phpBB uses index.htm
try_files $uri $uri/ @rewrite_installapp;
# Pass the php scripts to FastCGI server specified in upstream declaration.
location ~ \.php(/|$) {
# Unmodified fastcgi_params from nginx distribution.
include fastcgi_params;
# Necessary for php.
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
try_files $uri $uri/ /forums/install/app.php$is_args$args;
fastcgi_pass php;
}
}
location @rewrite_installapp {
rewrite ^(.*)$ /forums/install/app.php/$1 last;
}
# Deny access to version control system directories.
location ~ /\.svn|/\.git {
deny all;
internal;
}
}
# If running php as FastCGI, specify php upstream.
upstream php {
server localhost:9000;
}
}
Here is the list of changes and things I want to point out, along with an error in the link provided by Paul that should get fixed at some point:
Code: Select all
------------------------------------------
# Custom Settings (1 of 2) START
------------------------------------------
worker_processes 1;
worker_processes auto;
------------------------------------------
#error_log logs/error.log;
error_log logs/error.log;
------------------------------------------
# The default is "512", but "worker_connections" has been left at 1024.
events {
worker_connections 1024;
}
------------------------------------------
# Custom Settings (1 of 2) END
------------------------------------------
------------------------------------------
# Custom Settings (2 of 2) START
------------------------------------------
client_body_timeout 10;
#client_body_timeout 60s;
------------------------------------------
client_header_timeout 10;
#client_header_timeout 60s;
------------------------------------------
#client_max_body_size 4096k;
#client_max_body_size 1m;
------------------------------------------
default_type application/octet-stream;
#default_type application/octet-stream;
------------------------------------------
include mime.types;
#include mime.types;
------------------------------------------
keepalive_timeout 10;
#keepalive_timeout 75s;
------------------------------------------
send_timeout 10;
#send_timeout 60s;
------------------------------------------
sendfile off;
#sendfile off;
------------------------------------------
server_tokens off;
------------------------------------------
# This is newly added due to an error I was getting. The default is probably 32. It said I need to increase it (32|64|128):
server_names_hash_bucket_size 64;
------------------------------------------
# Custom Settings (2 of 2) END
------------------------------------------
------------------------------------------
# This is from the default templates located at https://github.com/phpbb/phpbb/blob/master/phpBB/docs/nginx.sample.conf and https://github.com/phpbb/phpbb/blob/3.2.x/phpBB/docs/nginx.sample.conf. This appears to be incorrect:
location @rewriteapp {
rewrite ^(.*)$ /app.php/$1 last;
}
# This is how the default template should probably be:
location @rewriteapp {
rewrite ^(.*)$ /install/app.php/$1 last;
}
# And this is how the default template should be for my forums located at http://www.mywebsite.com/forums/:
location @rewriteapp {
rewrite ^(.*)$ /forums/install/app.php/$1 last;
}
------------------------------------------
# Old:
root html;
# New:
root C:/nginx/html;
------------------------------------------
# This has been added but it may not be necessary or it may cause problems:
location / {
# Main index with WordPress
index index.php index.html index.htm;
try_files $uri $uri/ /index.php;
}
------------------------------------------
# This was temporarily added while WordPress is not running on my site. It will be removed later when WordPress is back on and things are running again:
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root C:/nginx/html;
}
------------------------------------------
# Old (for Unix(?)):
# If running php as FastCGI, specify php upstream.
upstream php {
server unix:/tmp/php.sock;
}
# New (for Windows):
# If running php as FastCGI, specify php upstream.
upstream php {
server localhost:9000;
}
------------------------------------------
Just to clarify, I believe there is a mistake in the following links:
https://github.com/phpbb/phpbb/blob/mas ... ample.conf
https://github.com/phpbb/phpbb/blob/3.2 ... ample.conf
Line #91:
Code: Select all
try_files $uri $uri/ /app.php$is_args$args;
I think it should be this:
Code: Select all
try_files $uri $uri/ /install/app.php$is_args$args;
Without that change, the update or upgrade will not work and the "
500 Internal Server Error" will appear when someone clicks the "
Update" or "
Custom" tabs. Please test the change to confirm this is correct.
*Edit*
Here's something interested I came across:
http://area51.phpbb.com/phpBB/viewtopic ... 81&t=49426
There is something extra that is needed. I got the inspiration from
viewtopic.php?f=466&t=2294581 which fixes the ability to add extensions. To get the install working add this snippet before any other rules:
Code: Select all
location /install/app.php {
try_files $uri $uri/ /install/app.php?$query_string;
}
*Edit*
P.S. This is the
error.log after visiting my forums after the database was updated to phpBB 3.2.0. The page does not load fully, and as I said, there is no template displayed. All I see is some text from my forums index.
Code: Select all
2017/01/12 23:57:48 [error] 3640#3568: *4 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 108.162.241.123, server: www.mywebsite.com, request: "GET /forums/cron.php?cron_type=cron.task.core.tidy_sessions&sid=950c8ff10f35b32cf09900c0bc9e7708 HTTP/1.1", upstream: "fastcgi://[::1]:9000", host: "www.mywebsite.com", referrer: "http://www.mywebsite.com/forums/"