Tag Archives: WordPress

How To Fix 500 Internal Server Error in WordPress

In this article, we will show you how to fix the internal server errors in WordPress.

The internal server errors are status codes returned by the web server whenever it encounters a condition that prevents it from completing the request initiated by the client. This error message does not necessarily mean that the web server is responsible. The causes of such errors are multiple. We’ll be discussing several solutions to this problem and walking you through each.

Quick Steps: 

  1. Check for corrupt .htaccess rules.
  2. Increase the PHP Memory limit in WordPress.
  3. Deactivate faulty plugins.
  4. Check file permissions.
  5. Upload the core WordPress files to your site.

Create a New .htaccess File

Create a new .htaccess file on your WordPress root directory – public_html. If you cant find the .htaccess file or any dotfiles, enable Show Hidden Files (dotfiles) from the Settings icon on the top right corner of your window.

Settings in File Manager.

Once you found the .htaccess file, right-click the file and rename it to .htaccess.bk to disable it. To create a new .htaccess file,  go to your WordPress Admin  >> Settings and select Permalinks. Scroll down to the bottom of the page and click the save button. This will create a new .htaccess file with the proper redirection rules for your site

Open your browser and call your website. If your site loads then the 500 internal server error was caused by the corrupted .htaccess file. If you’re still seeing the error, move on to the next section.

Increasing the PHP Memory Limit

Another way of fixing the 500 internal server error is by increasing the PHP memory limit in WordPress and refreshing your site to test whether or not this is causing your 500 internal server error.

Open File Manager and locate the wp-config.php file from your root directory. Right-click on the file, and select Edit to add the following code below inside the opening PHP tag,

define(‘WP_MEMORY_LIMIT’, ’64M’); 
ini_set(‘post_max_size’, ’64M’); 
ini_set(‘upload_max_filesize’, ’64M’);

Refresh your site and if you are still seeing the error then the issue is not because of the PHP memory limits. Remove the above code from the file wp-config.php and save it.

Deactivating Plugins

Connect to your website using a FTP client, or the File Manager tool in cPanel. Once connected navigate to the wp-content folder. Right click on the plugins folder and select Rename. Change the name of the plugins folder to plugins.bk. This essentially deactivates all the plugins on your site. 

Refresh your website. If the site loads, then the error was due to a faulty plugin. Activate each plugin one by one and refresh your website after each plugin activation to find out the problematic plugin.

Check the File Permissions

Permissions for the folders and files in your WordPress directory should be 755 or 644, respectively .Check if they have the correct permissions.  If they are anything else but 755 or 644, it can cause these 500 errors. To solve this, open up File Manager, go to the root directory and right-click on the files/directories that have the incorrect permissions and click Change Permissions. A popup window will appear on which you can set the permissions to 755 or 644.  

Changing Permissions via File Manager.

Changing Permissions via File Manager.

Re-building the Core WP Files

This step is considered as a last resort. Download a fresh installation of WordPress from their downloads page. Extract the zip file and open the extracted folder. Connect to your WordPress website using an FTP client and upload the wp-admin and wp-includes from your fresh version of WordPress to the root folder of your website – /public_html. The FTP client will now transfer those folders to the site’s directory, overwriting the older files. 

Conclusion

The 500 internal server errors can be really frustrating, we know, as it is difficult to pin point the exact cause of the error. If all methods fail, then contact us. We’ll be happy to take a look.

How to Install and Manage WordPress Sites With WP-CLI

The following steps are meant to be run with root privileges on a server (VPS hosting). This feature comes preinstalled with our shared/reseller hosting accounts.

This tutorial will help you to install and manage WordPress with the WP-CLI. WP-CLI provides a command line interface for WordPress. WP-CLI provides users the tools necessary to install and update plugins, create databases without using a web browser.

Prerequisites

  • Unix-like environment (Linux, FreeBSD, Cygwin).
  • PHP 5.4 or later
  • WordPress 3.7 or later

Installation

Connect to your Server’s console through SSH. You can now download the file wp-cli.phar using wget or curl.

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Next, check whether the downloaded Phar file is working.

php wp-cli.phar --info

Now, set the permission to make the Phar file executable with the following command:

chmod +x wp-cli.phar

Move the file wp-cli.phar to a new directory named wp under /usr/local/bin. This allows us to execute the WP-CLI commands by typing ‘wp’ at the start.

sudo mv wp-cli.phar /usr/local/bin/wp

Run wp –info to check whether the installation was successful.  If the installation was successful, you’ll see the following output below,

Verifying the installation using wp – info.

Verifying the installation using wp –info.

Managing WordPress with WP-CLI

Lets go over some basic and useful WP-CLI commands.

WP-CLI Help System

WP-CLI comes with a guide which can be accessed by using “wp help“. You can get a detailed info about a specific command here. For example, if you want to know more about config command, you can type in:

wp help config

A sample output:

Man page of wp config.

Man page of wp config.

Managing Themes

To list themes present in your WordPress, you can use the following command:

wp theme list

The output will be:

Managing WordPress themes.

Managing WordPress themes.

If you want a different theme, use the following command:

wp theme activate twentyseventeen

Managing Plugins

Like themes, plugins can also be installed and managed using wp-cli.

The following command is used for listing the plugins that were already installed on your WP site. 

wp plugins list

Also you can search and install the plugins available from the command line. For example,  use the command below to search for the plugin “Yoast SEO”.

wp plugin search yoast

The output will be:

Managing WordPress plugins via the command line.

Managing WordPress plugins via the command line.

For installing and activating the plugin, you can use the below command.

wp plugin install wordpress-seo – activate

Updating WordPress

When updating WordPress from the command line, you need to update the core WordPress files and the database to complete the update process.

 Update the WordPress core files with the command shown below:

wp core update

Then, update the database using the command below:

wp core update-db

The commands we discussed on this guide are just the tip of the iceberg. There are many more commands to manage your database, posts, and multi-sites. Refer to this documentation from WordPress for more information on WP-CLI commands.

Conclusion

Congratulations! Now you know how to manage your WP installation from the command line. For more information on WP-CLI, please visit their official page here.

How to Configure WordPress to Use a Temporary URL

This guide will show you how to configure a temporary URL in WordPress.

Quick Steps:

  1. Login to your cPanel account and open File Manager.
  2. Therein, in the root folder of WordPress, locate the wp-config.php file.
  3. In the wp-config.php file, locate the lines that specify WP_HOME and WP_SITEURL and
    make the below changes:

    • Define(‘WP_HOME’,’http://IPADDRESS/~username’);
    • Define(‘WP_SITEURL’,’http://IPADDRESS/~username’);
  4. Now you can access the site using http://IPADDRESS/~username

If migrating or transferring your WordPress website from one host to another, you should ensure everything is in order before you change your domain’s nameservers. For example, if leaving your current host and your site has been migrated to VeeroTech, you can view your website using a temporary URL in order to double-check that everything is perfectly the same — and then make the changes to your domain nameservers.

This post will explain how to configure and access WordPress using a temporary URL.

Where to Find a Temporary URL?

In your hosting account information email (the one you got when you signed up for your hosting account), you can easily find the temporary URL that you can use to access your site.

Also, if you are on a reseller hosting plan, you can find your temporary URL by looking at the IP address in WHM. generally, it is something that looks like this:

http://IPADDRESS/~yourusername

So, if your IP is 1.234.56.789 and your username is “myname”, your temporary URL would be something like this: http://1.234.56.789/~myname

How to Configure WordPress to Use Temporary URL?

Since WordPress adds your domain name to its database, it will not automatically work with any other URL unless you make manual changes to its configuration.

Once your website has been successfully transferred (or WordPress has been successfully installed using Softaculous), login to your cPanel account and open File Manager.

cPanel File Manager

cPanel File Manager

Therein, in the root folder of WordPress, locate the wp-config.php file.

How to Configure WordPress to Use Temporary URL

How to Configure WordPress to Use Temporary URL

Right click on it and select Code Edit. In the wp-config.php file, locate the lines that specify WP_HOME and WP_SITEURL — if the lines are not there, you will need to add new ones. Either change the URL to your temporary one in existing lines, or add new lines of code to resemble this (wherein the IPADDRESS is the IP mentioned in your hosting account information email and the username is your cPanel username):

define('WP_HOME','http://IPADDRESS/~username');
define('WP_SITEURL','http://IPADDRESS/~username');

Save your changes by clicking the button in the top right corner.

 

That is all, your website can now be viewed using the temporary URL. Once you have ensured that your site is the way you want it to be, you can change the wp-config.php file to reflect your actual domain name, and point your domain’s nameservers to VeeroTech.