Troubleshoot WordPress Issues
Introduction
WordPress is one of the most popular open source Content Management Systems (CMS). In this how-to guide, you will learn how Bitnami configures WordPress, what the common issues are and how to address them.
Configuration
Bitnami offers two flavors: WordPress (for a single blog) and WordPress Multisite (for multiple blogs). Both are configured as follows:
Bundled main components
- Apache
- PHP
- Database server (MySQL or MariaDB)
- OpenSSL
- phpMyAdmin
- Varnish (TM)
System users
NOTE: This does not apply to Windows installers or non-root installations.
- bitnami: SSH login user for cloud images and virtual machines.
- daemon: Runs Apache.
- mysql: Runs the database server (MySQL or MariaDB).
- varnish: Runs Varnish (TM).
Permissions and ownership
NOTE: For more information about permission issues, see this guide.
- All files in /opt/bitnami/wordpress are owned by the bitnami system user and the daemon group. This helps to avoid issues when uploading files to the stack.
- All subfolders in /opt/bitnami/wordpress have 775 using UNIX permissions notation, which means the following:
- Read, write, and execute: bitnami user and daemon group.
- Read and execute: rest of system users.
- All files in /opt/bitnami/wordpress except wp-config.php have 664 using UNIX permission notation, which means:
- Read and write: bitnami user and daemon group.
- Read: rest of system users.
- The wp-config.php file contains sensitive information, and for that reason it has more restrictive permissions. The file has a value of 640, which means the following:
- Read and write: bitnami user.
- Read: daemon group.
- No access: rest of system users.
- Uploaded files in /opt/bitnami/wordpress/wp-content/uploads using the WordPress media library manager are owned by the daemon user and the daemon group.
- Installed plugins in /opt/bitnami/wordpress/wp-content/plugins using the WordPress plugin manager are owned by the daemon user and daemon group.
How to fix WordPress permissions issues
Watch the following video to learn how to fix WordPress permissions issues:
Plugins included
- Akismet Anti-Spam: Filters spam.
- All In One Search Engine Optimizations (SEO) Pack: Improves visibility.
- All-in-One WP Migration: Exports and imports WordPress installations.
- Google Analytics for WordPress by MonsterInsights: Connects your WordPress installation to Google Analytics.
- Jetpack: Includes popular addons, such as security, contact forms, social network integration, and so on.
- Simple Tags: Extends the tagging capabilities in WordPress posts.
- WP Mail SMTP: Allows you to configure outbound email settings.
Common issues
These are the most common issues that Bitnami WordPress users face:
- Permissions: Includes the issues described in this troubleshooting guide. In the case of WordPress, most of them occur when uploading a file to the wp-uploads folder via FTP.
- SSL: Includes the issues described in this troubleshooting guide. In the case of WordPress, there is an extra case which is that of mixed content issues, provoking the page to be rendered incorrectly.
- SMTP: Includes the issues described in this troubleshooting guide.
- SSH: Includes the issues described in this troubleshooting guide.
- Domain names: Includes issues when assigning a domain name. These are more frequent in WordPress Multisite installations.
- Changes in WordPress configuration files: Configuration issues can break the application, and usually occur by incorrectly changing configuration files such as wp-config.php or functions.php.
- Infrastructure: Includes issues with the server itself, such as running out of space, performance issues due to suspicious attacks, changes in the IP after rebooting, operating system upgrades, and so on.
- Bitnami banner: Issues can occur when removing the Bitnami banner.
- Migration and upgrade: Problems can occur when backing up, migrating or upgrading their instance. A common case is that of moving a single WordPress installation to WordPress Multisite.
- Plugins: Some plugins can cause the application to show a warning or directly crash. This is due to incompatibilities with the WordPress version or some special Apache requirements (such as using .htaccess files). Disabling or removing the conflicting plugin solves the issue.
- Integration with extra components: Some users encounter issues when integrating their WordPress installation with solutions such as Memcached, CloudFront, RDS, etc.
Troubleshooting checklist
The following checklist covers the majority of cases described above and will help you find and debug most WordPress issues.
Did you install any extra plugin to the application?
Certain plugins may have compatibility issues with your WordPress version. If you are getting HTTP 500 errors and you have installed extra plugins, follow these steps to solve the problem:
-
Log in to the server console. Learn how to connect to the server through SSH.
-
Once you have accessed the server, on the terminal window of your local system, search for the /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins folder.
-
Execute the ls command. You will see different folders for each of the installed plugins. The following are some examples:
drwxrwxr-x 4 bitnami daemon 4096 Nov 30 00:33 akismet drwxrwxr-x 10 bitnami daemon 4096 Nov 30 00:33 all-in-one-seo-pack drwxrwxr-x 3 bitnami daemon 4096 Nov 30 00:33 all-in-one-wp-migration drwxr-xr-x 2 bitnami daemon 4096 Dec 11 15:13 conflicting_plugin drwxrwxr-x 6 bitnami daemon 4096 Nov 30 00:33 google-analytics-for-wordpress -rw-rw-r-- 1 bitnami daemon 2255 May 22 2013 hello.php -rw-rw-r-- 1 bitnami daemon 28 Jun 5 2014 index.php drwxrwxr-x 16 bitnami daemon 4096 Nov 30 00:33 jetpack drwxrwxr-x 6 bitnami daemon 4096 Nov 30 00:33 simple-tags drwxrwxr-x 3 bitnami daemon 4096 Nov 30 00:33 wp-mail-smtp
-
Identify the extra plugins you have installed. For each of them, execute the following command (replace the PLUGINFOLDER placeholder):
$ sudo mv PLUGINFOLDER /tmp
For the example above, we will move the conflicting_plugin folder:
$ sudo mv conflicting_plugin /tmp
-
Check if the application works again. Try it every time you move one plugin out of the stack.
If required, it is also possible to disable all WordPress plugins using WP-CLI with the command shown below:
$ sudo wp plugin deactivate --all
Are you trying to migrate your WordPress instances to a WordPress Multisite?
If you have several WordPress installations and want to merge them in a WordPress Multisite installation, we do not recommend you modify wp-config.php to enable WordPress' multiple blog feature. Instead, we recommend that you spin up a Bitnami WordPress Multisite instance and follow the steps in this guide.
Are you having problems setting the domain name?
If you want to configure a domain name in WordPress, you may see that the URL section is greyed out.
In order to set a domain name, follow this guide.
Did you modify any WordPress configuration file?
If you get HTTP 500 errors when acces sing your application, check if you have performed any modifications in /opt/bitnami/apps/wordpress/htdocs/wp-config.php. Small errors in this configuration file render the application unusable. If you have modified the file:
- Try finding any syntax errors in the file.
- If you do not find anything suspicious, launch a fresh WordPress instance and compare the contents of the wp-config.php file in the new instance.
- Check that the permissions and ownership are correct (find more details in this section).
Did you modify any Apache configuration file?
If your WordPress application becomes unusable or is having issues loading certain content, check if you have changed any of the following configuration files:
- /opt/bitnami/apache/conf/httpd.conf
- /opt/bitnami/apache/conf/bitnami/bitnami.conf
- /opt/bitnami/apps/wordpress/conf/httpd-app.conf
- /opt/bitnami/apps/wordpress/conf/htaccess.conf
- /opt/bitnami/apps/wordpress/conf/httpd-prefix.conf
- /opt/bitnami/apps/wordpress/conf/httpd-vhosts.conf
An error modifying these files may break the application configuration. In this case, restore the Apache original configuration. You can do this by launching a fresh WordPress instance and comparing the contents of each file.
Can’t you remove the Bitnami banner?
If you are unable to remove the Bitnami banner (in the bottom right corner), make sure you have done the following:
- You have followed the instructions detailed in this guide.
- You have checked that the bnconfig command (in the guide above) did not show any error message.
- You have executed the command with super-user privileges.
If this does not solve the issue, then open the files below with a text editor and remove their content:
- /opt/bitnami/apps/bitnami/banner/conf/banner.conf
- /opt/bitnami/apps/bitnami/banner/conf/banner-substitutions.conf
Restart Apache:
$ sudo /opt/bitnami/ctlscript.sh restart apache
Are you seeing a site security warning even though you have installed an SSL certificate?
In some cases, you may see an SSL warning even though you have an SSL certificate installed. This occurs when your WordPres pages include mixed content (content which mixes secure HTTPS URLs and insecure HTTP URLs). To resolve this, try the following:
- Configure the WordPress domain name.
- Use a WordPress plugin like the SSL Insecure Content Fixer plugin to identify and update mixed-content URLs.
Is your installation slow?
If you are experiencing performance issues in your application, follow the instructions shown in this guide. In addition, check that you are not getting suspicious access attempts in your server by following these steps:
-
Get the list of top 10 IP addresses that access your site:
$ tail -n 10000 /opt/bitnami/apache/logs/access_log | awk '{print $1}'| sort | uniq -c | sort -nr | head -n 10
-
Execute the following command once per IP address in the list. This will allow you to check the activity of each one of them (replace the IP_ADDRESS placeholder with the IP address):
$ cat access_log | grep IP_ADDRESS
-
If the IP address is not your internal or external IP and its behavior is suspicious, such as accessing only one page or only trying to login, it is probably a bot.
If that’s the case, block the address by following this guide.
If the installation is still slow, refer to our guide on optimizing WordPress or consider installing an optimization plugin such as WP-Optimize.
Are you having problems with Memcached?
The Bitnami WordPress stack does not include Memcached, so you need to check the following:
-
You installed Memcached using your operating system package manager:
$ sudo apt-get install memcached
-
You enabled the libmemcached module following this guide (NOTE: the steps mentioning ctl.sh do not apply).
Are you having issues enabling Varnish (TM)?
By default, Varnish (TM) is disabled in Bitnami WordPress. If you have issues enabling Varnish (TM), check the following:
- Check that you followed this guide to enable Varnish (TM).
- Check the Varnish (TM) version in your stack. Depending on the version, you will need to use wordpress.vcl or wordpressv4.vcl.
- Check that you have opened port 81 in your firewall to ensure that Varnish (TM) works correctly.
- Check that you disabled PageSpeed Apache module.
Are you having problems related to file/directory ownership and permissions?
When you manually modify permissions, it can cause several problems because the various services included with the stack may then not have enough permissions to perform required actions.
To resolve this, try resetting the permissions as described below.
-
Reset the permissions of the WordPress directories:
$ sudo chown bitnami:daemon -R /opt/bitnami/wordpress /bitnami/wordpress $ sudo chmod g+w -R /opt/bitnami/wordpress /bitnami/wordpress
-
Reset the permissions of the MariaDB directory:
$ sudo chown mysql:mysql -R /bitnami/mariadb/data
-
Reset the permissions of the Apache directory:
$ cd /opt/bitnami $ sudo cp -rp ./apache{,.back} $ sudo chown root:root -R ./apache $ sudo chmod +x ./apache/bin/* $ sudo chown bitnami:root -R ./apache/conf $ sudo chown root:root ...
-
Restart services:
$ sudo /opt/bitnami/ctlscript.sh restart
Useful links
The following resources may be of interest to you:
- WordPress documentation page
- Troubleshoot Permission issues
- Troubleshoot SSH issues
- Troubleshoot SMTP issues
- Troubleshoot SSL issues
Varnish is a registered trademark of Varnish Software AB and its affiliates.