phpBB upgrade gets stuck during the database upgrade process when upgrading from 3.0.* to 3.1.*

phpBB upgrade gets stuck during the database upgrade process when upgrading from 3.0.* to 3.1.*

Symptom(s):

The phpBB automatic upgrade appears to get stuck during the database upgrade process when upgrading from version 3.0.* to 3.1.* and never proceeds on refresh.  No error is given since the issue is occurring within the configured folder and file permissions assigned to the Apache Web Server.  The error can actually be located in the Apache Server error log file.

Solution(s):

  • If you check the Apache logs, which are typically located in the /var/log/httpd or /var/log/apache2 directories, its actually a directory permissions / owner issue.
  • When files are uploaded by a user account the control panel assigns user permissions instead of Apache permissions.  The script needs to run as Apache since it is running locally on the web server itself and not as the user whose permissions it was assigned.

Solution #1:  If you have root access:  Change the owner of Cache and Store folders located under your phpBB installation to www-data:www-data (Or psacln if plesk) using the chown command from the shell prompt, (i.e. chown www-data:www-data /Your-php-install/cache), then refresh the upgrade screen to complete the upgrade.

Solution #2: If you do NOT have root access: Temporarily set the folders of Cache and Store to 0777, continue the upgrade and then restore permissions to 0755. This can be done by using the chmod command from the shell prompt, (i.e. chmod -R 0777 /your-php-install/cache),  then refresh the upgrade screen to complete the upgrade.  Once completed make sure you run the command again using chmod -R 0755 /your-php-install/cache and store folders respectively.  The -R denotes “recursive”, which means all the permissions are changed for all files and folders recursively under the cache directory.

Note: In all Apache installs where files will be accessible to the internet, the best settings for permissions are to set 0644 for all files within the directory and to set permission 0755 for all directories that will be accessed externally or on the Internet.  0644 basically means that www-data or Apache can read and write to the file and everyone else including the Internet can only read the file and nothing else.   0755 means that www-data or Apache can read, write, and execute the file, but everyone else including the Internet can read and execute the file, which is required for directories to work properly.