Author: RunCloud Team

  • WP-CLI — The Complete Guide to Controlling WordPress From The Command Line

    WP-CLI — The Complete Guide to Controlling WordPress From The Command Line

    Thanks to all the themes and plugins of WordPress, it is now very easy to build and manage a WordPress site. Once you have created your site, the Admin Panel allows you to manage it easily.

    However, what if you prefer a command-line interface? It requires time and effort to manage WordPress websites through the Admin Panel. But, instead of taking steps manually, a command-line interface lets you quickly perform actions with simple commands.

    That’s where WordPress Command Line Interface (WP-CLI) comes in. WP-CLI is a popular and powerful tool to generate backups, add/update themes and plugins, and manage your WordPress website using a simple command-line interface.

    In this article, we’ll talk about what WP-CLI is and how you can use it to manage your WordPress website. We’ll also walk you through some of the basic WP-CLI commands:

    • What Is WP-CLI?
    • How To Install WP-CLI?
    • Getting Started With WP-CLI Commands
    • How to use WP-CLI from a remote server?
    • Conclusion

    What Is WP-CLI?

    wp-cli logo

    WP-CLI is an open-source tool for web developers to maintain and update their WordPress sites through the Command Line Interface. Its main goal is to speed up the WordPress developer’s workflow.

    WP-CLI’s various functions and commands manage common (and some not-so-common) tasks such as resetting passwords, managing post categories, adding/removing users, updating plugins, configuring multisite installations, and more. WP-CLI saves you time and increases your productivity because it allows you to complete multiple tasks quickly.

    Daniel Bachhuber has maintained WP-CLI since 2003. Over the years, WP-CLI has been a requirement for other open-source projects like Bedrock and Trellis. In January 2017, this open-source tool officially moved to WordPress.org and was co-maintained by Alain Schlesser.

    Suggested read: How to Change the WordPress Admin Password via wp-cli

    How To Install WP-CLI

    Installing WP-CLI is easy. From WP-CLI.org, download the Phar file to complete the installation process. For other installation methods (Homebrew, Docker, Composer), check out the WP-CLI documentation file.

    Make sure that your environment meets the following requirements:

    • UNIX-like environment (OS X, Linux, FreeBSD, Cygwin); limited support in Windows environment
    • PHP 5.4 or later
    • WordPress 3.7 or later.
    1. Now, download the wp-cli.phar
    2. Download the cURL command-line tool.
    3. Check the Phar file to make sure it’s working by executing the following command in your Linux terminal after installing cURL:
    php wp-cli.phar --info

    To use the WP-CLI command, you need to first mark the file as an executable, as it’s still a Phar build. Then, you must move it in your PATH. Use the following command to make this happen:

    chmod +x wp-cli.phar
    sudo mv wp-cli.phar /usr/local/bin/wp

    Now, instead of typing wp-cli.phar, you can just type wp. When you run wp –info, you’ll see the following code, which means that WP-CLI is installed successfully:

    $ wp --info
    OS:     Linux 4.19.128-microsoft-standard #1 SMP Tue Dec 7 12:58:10 UTC 2021 x86_64
    Shell:  /usr/bin/zsh
    PHP binary:     /usr/bin/php
    
    PHP version:    8.0.5
    php.ini used:   /etc/php/8.0/cli/php.ini
    MySQL binary:   /usr/bin/mysql
    MySQL version:  mysql  Ver 8.0.23-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))
    SQL modes:
    WP-CLI root dir:        /home/wp-cli/
    WP-CLI vendor dir:      /home/wp-cli/vendor
    WP_CLI phar path:
    
    WP-CLI packages dir:    /home/wp-cli/.wp-cli/packages/
    WP-CLI global config:
    WP-CLI project config:  /home/wp-cli/wp-cli.yml
    WP-CLI version: 2.5.0 

    If you did everything correctly, WP-CLI will work properly. If, however, you encounter an error, you’ll have to repeat the steps again.

    To install WP-CLI on Windows, the process is slightly different. You should have the command line PHP for Windows in your system so you can execute PHP from any working directory.

    Now, you can just use cURL to install WP-CLI (cURL ships natively with Windows 10).

    Getting Started With WP-CLI Commands

    In this section, we’ll learn some of the basic commands that are commonly used in WP-CLI.

    WP-CLI commands generally begin with “wp.” A command and subcommand follow the “wp” to execute a query. A full WP-CLI command looks like this:

    wp command subcommand requiredparam --optionalparam --optionalparam2=value

    Let’s take a look at some basic WP-CLI commands with examples:

    How To Install A Plugin With WP-CLI

    Installing a plugin with WP-CLI is fairly straightforward. All RunCloud servers have WP-CLI installed by default, so you can easily connect to WP-CLI via the Terminal on Mac or through third-party software like PuTTY for Windows using your SSH key.

    Once the connection is established, here’s what you do.

    To install a public plugin through WP-CLI, type the following command:

    wp plugin install [plugin name]

    For example, to install the WooCommerce plugin, type:

    wp plugin install woocommerce

    To activate the plugin, type:

    wp plugin activate [plugin name]

    For example:

    wp plugin activate woocommerce

    Your plugin has now been activated.

    Installing Multiple Plugins with WP-CLI:

    You can install multiple plugins using the following command:

    wp plugin install advanced-custom-fields jetpack ninja-forms --activate

    To find a plugin name, use the command wp plugin search term, which will give you a list of plugins in the terminal.

    You can also install plugins from a remote file. This comes in handy if you’re developing a plugin or using a premium plugin. The following example installs two plugins from the repository and one from an Amazon S3 server:

    wp plugin install advanced-custom-fields jetpack https://d1qas1txbec8n.cloudfront.net/wp-content/uploads/2018/06/23073607/myplugin.zip --activate

    This command is especially useful to troubleshoot compatibility issues. The best way to manage plugins that are not compatible is to deactivate all the plugins.

    Get a list of plugins with WP-CLI

    Run the following command to get the list of the available plugins:

    wp plugin list

    To see the list of active plugins, use the following commands:

    wp plugin list --field=name --status=active --update=available

    Managing WordPress themes with WP-CLI

    To install a theme, type:

    wp theme install [WordPress theme name]

    For example:

    wp theme install twentytwentytwo

    Make sure to type the theme name exactly as it appears in the page URL.

    wp theme path example for wp cli

    To activate a theme, type:

    wp theme activate twentytwentytwo

    Your WordPress theme should now be activated.

    To install and activate a theme from wordpress.org, run the following command:

    $ wp theme install twentytwentytwo --activate

    You can also install a theme from a local .zip file:

    First, you have to download the ZIP file for your theme and upload it to your server. This is possible through SFTP using a client like FileZilla.

    Once you’ve uploaded the file to your server, just run the following command:

    $ wp theme install mynewtheme.zip -activate

    Or from a URL:

    $ wp theme install https://github.com/Automattic/_s/archive/master.zip

    To list all installed themes, run the following command:

    $ wp theme list

    It’s important to note that non-marketplace themes can’t be downloaded using the WP-CLI. Custom themes can be activated through their zip folder or through URL. You could also download them with curl and the themes package will have specific instructions to activate them through WP-CLI.

    Make sure to use only trusted sources to download themes and plugins as themes/plugins installed from unverified sources are not safe to use.

    Installing WordPress with WP-CLI

    You can easily install WordPress through WP-CLI by using a few simple commands. This allows you to skip the standard WordPress installation process which can take some time as compared to completing the installation process through WP-CLI.

    Step 1: To install WordPress through WP-CLI, you’ll have to locate the directory where you want to complete the setup process and run the following command:

    wp core download

    Step 2: The second command will set up the config file with the database access and some additional PHP.

    wp core config --dbname=mydbname --dbuser=mydbuser --dbpass=mydbpass --dbhost=localhost --dbprefix=whebfubwef
    wp db create
    wp core install –url=https://mysite.io –title=mysite –admin_user=mydbuser admin_password=mydbpass –admin_email=mydbuser@email.com

    Step 3: You’ll need to run the core install command to start the installation process. There are some extra parameters in the command such as email, admin username, and password, where you have to replace those parameters with your own variables.

    WordPress should be installed to the latest version. After some time, you will need to update WordPress. You can use the following command to update the platform:

    wp core update

    Once the platform is fully updated, you’ll want to do the same for your database:

    wp core update -db

    Changing the WordPress URL with WP-CLI

    Generally, WordPress is configured to work and accept requests through the URL which is set during the installation process. Sometimes, for various reasons, the URL is required to change. For example, you may need to move your WordPress installation from one subfolder/subdomain to a different one, or you might want to change your domain name. You may even need to force HTTPS connections to your website after installing an SSL certificate. Another reason may be when you want to install WordPress or want to move the site from local to production, then you need to update the WordPress and site address URLs.

    Updating the URL is usually a complex job, as all the database entries containing the old URL need to be updated with the new URL. However, doing it through WP-CLI is much easier and quicker, and can be done by running one command:

    wp option update home [URL homepage web address]
    wp option update siteurl [URL homepage web address]
    

    For example:

    wp option update home 'http://www.domainofthewebsite.com'
    wp option update siteurl 'http://www.domainofthewebsite.com'

    Your WordPress URL should be updated.

    There can be some hard-coded links to resources in your files that can contain old URLs. If you find any missing CSS files, missing images, or any other inconsistencies, check out your web browser’s error console for the particular errors. Also, you can open the error console by clicking F12.

    Manage users with WP-CLI

    You can use the following commands to manage users along with their roles, responsibilities, and metadata.

    List users

    In order to list all users you can use the following commands:

    wp user list

    You can also list users with certain roles (such as the administrator role in this case)

    wp user list --role=administrator

    Create a new user

    New users can be created with the command:

    wp user create name email.

    If you want to assign the new user a role, then the command will need to include a suffix:

    --role=whatevertheroleis

    Examples:

    Create a new editor role.

    wp user create ron ron@alexa.com --role=editor
    
    Success: Created user 4.
    Password: WordPressAssignedPassword
    

    Delete user and re-assign posts to another user

    Delete function is simple as create command – run command

    wp user delete name

    If you want to re-assign posts to other users, add the suffix:

    --reassign=username

    Example:

    Delete user ‘ron’ and reassign posts to user ‘tim’:

    $ wp user delete ron --reassign=tim

    Reset the password for one user

    This is how to reset the password of any user:

    Step 1:

    $ wp user list

    Find the ID of the user you’d like to update.

    Step 2: update the user

    $ wp user update 1 --user_pass=password

    Replacing “1” with the ID of the user you want to update.

    Change admin email address for one user

    Step 1:

    $ wp user list

    List to see all users. Find the ID of the user you’d like to update.

    Step 2: update the user

    $ wp user update 1 --user_email=newemail

    replacing “1” with the ID of the user you want to update

    Set or modify a user role

    Step 1:

    Type the following to see all users:

    $ wp user list 

    Find the ID of the user you’d like to update.

    Step 2:

    $ wp user set-role 1 administrator
    Success: Added ronsmith (1) to http://yourdomain.com as author.
    

    WordPress’s available roles by default:

    • Administrator
    • Editor
    • Author
    • Manager

    Suggested read: Using wp-cli to manage WordPress Cron Jobs

    Manage WP core and cache with WP-CLI

    Check for missing or modified core files

    You can use the following commands to check for any missing or modified core WordPress files:

    wp core verify-checksums

    Reinstall WordPress Core

    You can use the following command to download WordPress core without the default themes and plugins.

    wp core download --skip-content --force

    Flush cache

    To flush the cache, use the following command:

    wp cache flush

    A full list of WP-CLI commands can be found by visiting https://developer.wordpress.org/cli/commands/.

    How To Use WP-CLI From A Remote Server

    One of the best features of WP-CLI is that you can use it to manage your remote WordPress installations.

    You will have to install WP-CLI in two places: on the system from where you’re running the command, and on your server.

    In order to install WP-CLI on your system, you can use the guide above since we have already gone through this. Saying that here’s how to configure the server with WP-CLI.

    Configuring Remote Server with WP-CLI:

    You can configure your server through WP-CLI globally or locally.

    To configure your server globally, use the config.yml file. You can also use wp-cli.yml or wp-cli.local.yml files in your current working directory. In one of your working files, type the following code:

    ssh:
    
      staging:
        cmd: ssh %pseudotty% username@server.com %cmd%
        url: http://yourdomain.com
     path: /www/path/to/site/root
    

    Once this is done, write the following command to update WordPress on your server:

    wp ssh core update --host=staging

    Use Bash Scripts

    Developers save up a lot of time by using bash scripts to automate tasks. With a single script, you can install WordPress or manage other tasks without typing multiple commands.

    To use Bash scripts, you will have to build an “install.sh” file inside a directory and paste the following code:

    wp core download
    wp core config --dbname=mydbname --dbuser=mydbuser --dbpass=mydbpass --dbhost=localhost --dbprefix=whebfubwef_ --extra-php <<PHP
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    PHP
    wp db create
    
    wp core install --url=http://yourdomain.com --title=SiteTitle --admin_user=username --admin_password=yourpassword --admin_email=your@email.com
    

    After which, enter the following command:

    bash install.sh

    The script will be good to go without any interference from the user. If you handle multiple websites, you can establish all your environments by creating similar bash scripts:

    wp ssh core update --host=clientS
    wp ssh core update --host=clientR
    wp ssh core update --host=clientG
    wp ssh core update --host=clientY

    Bash scripts can free up your time when a new WordPress version is released.

    After Action Report — Using WP-CLI Can Be Extremely Useful

    WP-CLI solves many of the most common problems experienced by web developers and website managers. This saves you considerable time and effort, allowing you to focus elsewhere, safe in the knowledge your sites are taken care of.

    As a web developer, you can quickly develop test sites, include test data, and import/export as required. You can easily manage site updates and different other jobs for various websites with one command. WP-CLI community commands such as WP-CLI-SSH also provide some amazing functions. If you encounter an issue, a good place to refer is the WP-CLI common issues documentation.

    RunCloud easily allows hosts and lets you create and manage multiple WordPress websites with fast configuration. Using RunCloud in addition to WP-CLI, will give you back considerable time, and make site management easier. 

    What’s your favorite use case for WP-CLI? Did you come across any issues? Join the conversation & let us know in the comments below. 💬

  • WordPress.com vs. WordPress.org – The Differences & Which To Choose

    WordPress.com vs. WordPress.org – The Differences & Which To Choose

    Are WordPress.com and WordPress.org the same? It’s a question that on the surface seems so obvious, that many people don’t even think to ask it, let alone consider the answer. The truth is that those three little letters after the period make a huge difference, and could impact the success of your website in the future.

    So, what are the differences between WordPress.com and WordPress.org? Besides sharing the name ‘WordPress’ there are a number of significant differences to be aware of when choosing the platform you want to use for your website.

    In this post, we’ll dive deep into their backgrounds & how they’re different.

    What Is The Difference Between WordPress.com and WordPress.org?

    To make things as clear as possible, we’re going to cover all differences between WordPress.com and WordPress.org, starting with:

    The Fundamental Difference

    This is where people typically get confused. Both are called WordPress, yet aren’t the same.

    The non-profit WordPress Foundation manages WordPress.org which is a self-hosted content management system (meaning that you can install it anywhere and buy your own domain to set up a site). Not only is it a self-hosted content management system, but it’s also the world’s leading content management system.

    WordPress.com, on the other hand, is essentially the largest WaaS platform owned by Automattic, the company run by WordPress co-founder, Matt Mullenweg. It is powered by the WordPress.org open-source software.

    TL;DR – WordPress.com vs. WordPress.org Differences

    In short, WordPress.com is a limited version of WordPress.org that has been intentionally simplified for a completely different demographic.

    WordPress.org is open-source meaning that the main difference is:

    • Hosting – you can either set up a server with a cloud provider like DigitalOcean, Linode or Vultr with the help of RunCloud (highly recommended, of course 😉) or using a shared hosting service (which we would not recommend due to the limited resource availability and sluggish performance).

    While some of the most notable limitations of WordPress.com include:

    • No monetization through ads is possible (you are locked in to using the “official” WordPress.com advertising program)
    • No plugin installation or updates on the free plan — bigger plans also have these limitations, just lighter
    • You only get to choose one out of a few free themes if you’re on a free plan
    • Customization of the appearance, features, and overall site is heavily limited
    • The free plan doesn’t let you use Google Analytics
    • You have to upgrade from the free plan if you want to use your domain without the WordPress.com subdomain
    • No eCommerce features or integrated payment on the free plan
    • No membership websites

    Verdict

    There are plenty more limitations with WordPress.com, however, you have more responsibility with WordPress.org as a result. This should affect your decision on whether you should go with WordPress.com or WordPress.org.

    Pricing and Cost Differences

    Budget is always one of the first things you have to figure out when you’re building something. In this case, there are big differences between the pricing and costs of WordPress.com and WordPress.org, so to help you plan your budget better, we have broken down both solutions.

    WordPress.com offers four different pricing plans that can be paid annually, upfront, or monthly.

    Here’s a detailed pricing breakdown for WordPress.com

    wordpress.com pricing

    Besides these, WordPress.com does offer a free plan, and all you have to do is buy the domain. However, you will have their subdomain displayed e.g www.yourwebsite.wordpress.com.

    When it comes to WordPress.org, it’s completely free to use. However, there are other costs that WordPress.org doesn’t cover, which WordPress.com covers for you. The costs that WordPress.org doesn’t cover are:

    • Hosting — you will have to choose where you will host your WordPress website. You can check out some of our solutions here!
    • Security — Depending on your hosting, you might need some premium security features or plugins that can cost up to $250 per year.
    • Premium themes — there are free ones, but to get the most out of WordPress.org, you’ll probably want to go with premium themes. They usually cost up to $150 per year.
    • Premium plugins — another optional thing, but if you’re serious about scaling your website fast, you will probably want to go with some premium plugins like Rank Math for SEO.

    Verdict

    The cheapest way to create a website with WordPress is to buy a domain and go with the WordPress.com free plan. However, how desirable the free plan is will depend on the nature of your site, as WordPress.com has greater limitations. If you go with WordPress.org, you may end up incurring more costs on what it doesn’t cover, spending more than you wanted.

    Ease of Use

    Both WordPress.com and WordPress.org have a learning curve, but which one is easier to overcome?

    Since WordPress.org offers you a lot more freedom, you might frequently get lost if you’re a beginner. Whereas WordPress.com doesn’t have this issue. Their setup is more robust as you’re solely dependent on the plan you chose.

    On the other hand, if you are a more advanced user, you’ll probably find your way faster with WordPress.org, as you’ll know exactly what you need to set up your intended site.

    Setting up WordPress.com is a bit easier as it’s designed for blogging. Also, since it has far more limitations and doesn’t allow you to change many things you would normally be able to change on WordPress.org, fewer options mean it is easier to use.

    Verdict

    Considering WordPress.com has more limitations, it’s a lot easier to find your way around with their streamlined setup process. Therefore, WordPress.com wins this battle!

    Hosting

    Hosting is your own home in the internet realm. Without hosting, your site pretty much doesn’t have a place to live, and therefore no one can find it.

    WordPress.com and WordPress.org differ when it comes to hosting options, and these differences are important to know.

    With WordPress.com, you are already getting the hosting regardless of the plan you pick, since the service is self-hosted (free or premium). Effectively, hosting isn’t something to worry about if you decide to go with WordPress.com.

    However, since WordPress.org is just software, you will need hosting with your WordPress site.

    There are dozens of hosting providers out there offering you your new virtual house, and it can be a bit overwhelming sometimes to review all of them, especially if you’re not that tech-savvy.

    It doesn’t matter if you’re a beginner or an expert — we’re certain that here at RunCloud, we can provide you with everything you need to get your site up and running with ultra-fast speed, maximum security, and features that will help you scale it sky-high. Make sure to check our plans here!

    Verdict

    Since WordPress.com will take care of all hosting-related stuff, it’s fair to say that WordPress.com is the simpler option to go with here. However, if you’re a more advanced user who wants more control, you’ll definitely want to host your website by yourself.

    Theme Design & Customization

    Themes are there so you can get your WordPress site to look exactly the way you want.

    When speaking solely about themes, you have plenty of choice on both WordPress.com and WordPress.org.

    However, here are some things worth mentioning:

    With WordPress.com you:

    • Can’t upload any premium themes without the Business plan
    • Can choose from dozens of free themes
    • Are heavily limited with customizing themes

    With WordPress.org you:

    • Can choose from plenty of free themes
    • Can upload whichever premium theme you want
    • Can edit absolutely everything if you know how to code

    Customization is also a big part of deciding which of the two options is better in terms of design. Unfortunately, customization is impossible on WordPress.com which makes WordPress.org win this race by some margin.

    This flexibility is a benefit if you’re an advanced user who already knows how things work and what exactly it is you need.

    On the other hand, if you’re a beginner, you might be perfectly fine with the limitations of WordPress.com, as you are yet to develop your experience and are still learning what you actually need.

    Verdict

    WordPress.org wins hands down in terms of options and possibilities with your website design. It practically has no limits and you can do whatever you want to as long as you know how to do it properly. But once again, it all comes down to what you actually need out of your website, and WordPress.com is more beneficial if you are newer to the process.

    Plugins

    Plugins are coded programs that serve the purpose of performing certain functions on your website, and they can be anything from payment integrations to a simple table of contents.

    There are major differences in handling plugins on WordPress.com and WordPress.org so you must familiarize yourself with these to make your choice better.

    WordPress.com doesn’t allow you to use any plugin upload or installation unless you’re on the Business plan ($300) even though the majority of plugins from WordPress databases (over 50,000) are free.

    This again represents a huge limitation in controlling your website, but the benefit is that WordPress.com pretty much handles a lot of things for you. Whereas you’d need to install more plugins yourself on WordPress.org.

    Speaking of WordPress.org, you have zero limitations when it comes to playing with plugins. You can install any plugin you want, free or premium, and configure it however you want.

    Verdict

    Both platforms use the same plugin directory, but the fact that you can’t modify your plugins on WordPress.com without paying $300 per year, gives a huge advantage to WordPress.org. The advantage of WordPress.com is again for those with less experience and who prefer things being handled for them.

    Blogging

    If you’re looking to build a site for blogging, then both options can be great. It all depends on what you need.

    If you have never previously had a blog, want to start one without planning to scale it sky-high, and don’t have much blogging experience, then in terms of structured SEO writing and setting the blog up WordPress.com is an amazing option for you.

    You will learn a lot and it can be free (which we suggest). There’s no harm in trying new things out and as you don’t have to spend a dime (except on the optional domain of course) to tackle that learning curve, it’s a great option!

    There are many blogs on the WordPress.com free plan, and we’re sure it will satisfy your needs as a beginner.

    However, if you’re an experienced blogger, then WordPress.com probably won’t work for you.

    WordPress.org is a much better option for experienced bloggers as you probably have WordPress knowledge and you know exactly what you need. There is likely to be an issue with WordPress.com because of its limitations.

    Also, if you’re planning to scale your blog and make it a six-figure business, then WordPress.org might be a better solution as it gives you more options from the beginning.

    Verdict

    Both WordPress.com and WordPress.org are great options for blogging. WordPress.com is great for beginners, but if you’re planning to grow your blog rapidly then WordPress.org will be a better solution.

    SEO (Search Engine Optimization)

    SEO plays an important role if you’re planning to grow your site’s traffic organically.

    WordPress is generally one of the best (if not the best) platforms when it comes to SEO, and both services will provide you with high-quality tools. Both will make sitemaps and send them to Google.

    Both will leave you plenty of options for creating content no one can compete with.

    The only difference here is with plugins.

    As you already know, WordPress.com will not let you upload or install any plugins, which means no SEO plugins as well. Only if you go with a Business plan will you be able to install SEO plugins.

    On WordPress.org, things are much easier, and for that purpose, we recommend Rank Math. It’s currently the best SEO plugin out there and we’re certain it will help you immensely with your SEO game.

    Verdict

    Both services offer a great SEO-friendly environment for creating top-notch content. But the advantage goes to WordPress.org as there are no limitations to boosting your SEO game with SEO plugins.

    Analytics

    Analytics also play an important role in growing your website. How else would you know what your readers want unless looking at analytics, stats, and data?

    WordPress in general doesn’t have its own analytics. All you can track is site traffic, but that doesn’t tell you much, meaning you’ll need some plugins or hard-coded integrations.

    Google Analytics is definitely the best analytics tool out there, but unfortunately, you can only have Google Analytics on your WordPress.com website site if you upgrade to the Premium Plan.

    Besides that, Google Analytics isn’t the only analytics you might want. Depending on your site’s nature you might want to install a heatmap or some other form of the data collection system. Unfortunately, all this is unavailable with WordPress.com if you don’t go with their Business plan.

    On the other hand, if you go with WordPress.org, you can install whatever you want, including Google Analytics. You can install Google Analytics through a hard-coded API, or use some of the other plugins like Rank Math, Jetpack, or others. Effectively all options are at your disposal!

    Verdict

    WordPress.org is a far better platform for tracking down data and getting insights into your audience, as you can use any plugin.

    Maintenance

    Technical maintenance of your website usually comes down to three things:

    • Web hosting maintenance
    • Security maintenance
    • Plugins maintenance

    The benefit of having a website on WordPress.com is that they take care of everything for you. You don’t have to worry about hosting as WordPress.com is self-hosted. You don’t have to think about security as they keep everything together. Additionally, since you don’t have any plugins besides the ones they install for you, you don’t have to pay attention to them either.

    On the other hand, you will need to take care of all these things if you decide to go with WordPress.org.

    Most web hosting companies keep a very close eye on every upcoming WordPress update, making sure that the support is there should you need it.

    With RunCloud this process is made considerably easier, as you have access to a server management control panel that allows you to monitor and update multiple WordPress installations much more quickly. This makes the process of keeping multiple sites secure significantly more practical.

    When it comes to security, depending on the hosting provider you’re working with, you may need to install a security plugin. The Wordfence plugin is often recommended, which has a free option, but if you want to upgrade your security they have multiple plans available.

    Also, WordPress.com provides you with a free SSL certificate which is a super important security requirement, as well as an increasingly important SEO metric. If you decide to go with WordPress.org you will have to take care of SSL yourself. Luckily most hosting providers have free SSL included in their plans.

    Last but not least: plugins. You probably have heard of plugins crashing sites. How do you prevent that from happening to your site? Always keep everything updated! Yes, even though there might be a risk of your website experiencing issues after a plugin update, the chances are much higher of issues occurring when they’re not updated. Also, make sure not to use too many plugins!

    Verdict

    There are almost no differences between the two except that you will have to work a bit more on maintenance with WordPress.org.

    Customer Support

    If you’re a beginner, then support might come in handy, especially if you’re setting up your website for the first time.

    WordPress.com doesn’t offer any support on a free plan, but if you upgrade to the Personal plan, you will get email support, although it might take several days for them to reply.

    If you upgrade to the Business plan, however, you will get their live chat support which is far more responsive than email support.

    WordPress.org doesn’t offer any type of support as there’s no need for them to provide it. The service is free and you have all the freedom to create whatever you want. However, they do offer documentation that you can use and gain a lot of useful information.

    Speaking of support, for both platforms, you can actually find a lot of useful information on the WordPress forum, as issues you’re experiencing are likely issues other people have been experiencing as well.

    Verdict

    There is no support at WordPress.org as your websites are more your own. WordPress.com does offer some sort of support, which makes it more user-friendly in this case.

    We have covered the main differences between WordPress.com and WordPress.org, so now we’ll answer some key common questions, before concluding.

    How To Install WordPress With RunCloud

    Installing WordPress on RunCloud is super simple, and we have a detailed guide here to help you with it!

    Is WordPress.com or WordPress.org Better?

    It all depends on your needs and what you want your website to be. If you are a beginner looking to build a small personal blog, then WordPress.com is a good option. However, if you’re looking to scale your website as an online business, WordPress.org offers much better solutions as it has fewer limitations.

    Can You Switch From WordPress.com to WordPress.org?

    Yes, you can switch from WordPress.com to WordPress.org. All you have to do is

    1. Find a hosting provider where you will host your WordPress.org website
    2. Export your WordPress.com website
    3. Import your site to your new hosting provider (support can help with this)
    4. Voila!

    Some hosting services have an option where you submit your WordPress.com credentials, and they do all the heavy lifting and get it ready for you. Bear in mind this is highly likely to be a paid service.

    What Should You Look For When Picking A WordPress Hosting Provider?

    First and foremost you want to make sure that your hosting provider offers fast and secure servers with good uptime.

    After that, their support is something you should also have in mind as it will often come in handy.

    And last but not least, make sure your hosting provider offers decent pricing, with a range of plans to suit both your budget and your needs, as well as providing the flexibility to upgrade plans in the future as your business expands.

    Here at RunCloud, we pride ourselves on offering top-notch server management tools, helping to improve the speed and responsiveness of your site. Our support is always ready to assist you in case of any need. Check out our server management plans here!

    Can I Monetize A Free WordPress.com Website?

    Yes, you can monetize the WordPress.com website. There are two popular ways you can go with this — either affiliate marketing or building a paid membership program. WordPress has written its own guide to membership programs if you’re interested in finding out more.

    WordPress.com vs WordPress.org – Which One Is Better For eCommerce?

    WordPress.org is far better for building an eCommerce website.

    The reason for that is that with the WooCommerce plugin you can achieve so much without having to spend much more money on premium solutions or buying their extensions. In fact, if you’re starting as a simple eCommerce store, you don’t need any extra features of WooCommerce, which means you can run it almost free (domain and hosting needed only).

    When it comes to WordPress.com, you can go with an eCommerce plan that costs $540 per year which is not the most affordable option, especially if you’re just starting out. Additionally, even with paying that amount, you will still have limitations you wouldn’t usually have with WordPress.org.

    After Action Report — Use WordPress.org for Maximum Versatility & Control

    Although both platforms have their advantages and disadvantages there’s really no question as to which is the best solution for any business that’s either already established or is planning on significant growth.

    From the addons and plugins you can choose that allow you to integrate everything from payment portals to mailing lists, security to social media automation, to full control over your themes and website’s appearance, WordPress.org lets you have it all.

    Have you already made your choice? What was the deciding factor for you? Leave a comment below and join the conversation either here or on Twitter @RunCloud_io. 💬

  • What Is Managed WordPress Hosting & Do You Need It?

    What Is Managed WordPress Hosting & Do You Need It?

    Trying to figure out what managed WordPress hosting is and whether you need it?

    WordPress currently powers over 455 million websites, with 500 new WordPress websites every day. Well over a third of the top 1 million websites is WordPress based, so no one is ever going to deny its popularity or success, but that doesn’t mean that it’s immediately straightforward – there are key decisions to make right from the start which could have a long term impact on your website’s success.

    In this guide, we’ll walk through when managed WordPress hosting can make sense and why for many use-cases running your own infrastructure (with the help of RunCloud) paired with a popular cloud provider like UpCloud, DigitalOcean, Vultr, etc. can be the better choice. Without further ado – let’s dive in.

    What is Managed WordPress Hosting?

    Managed WordPress hosting is a service that takes care of all the technical aspects of running a WordPress website. This generally includes everything from maintaining the performance, stability, and security of your hosting infrastructure all the way through to providing support for technical issues that arise.

    For those willing to pay a premium to have everything taken care of for them, managed hosting can afford you some extra peace of mind. We’ll get into the advantages and disadvantages shortly.

    Overall, the main attraction in finding a managed WordPress host is convenience. You delegate responsibility and let experts handle the technicalities, freeing up to do what you want to focus on which may not be anything related to your hosting infrastructure.

    The Pros & Cons of Managed WordPress Hosting

    Although the features and services may differ from host to host, you can still rest assured that the majority of these pros and cons will be present in every host.

    Managed WordPress Hosting Pros

    There are really only two main advantages of choosing managed WordPress hosting – support & the absence of responsibility.

    Support

    Managed WordPress hosting providers tend to pride themselves in the level of support they’re able to provide.

    The Absence of Responsibility

    When you work with sites where 100% uptime and maintaining security, stability, and performance are not things that you wish to be responsible for, they’re often a good choice.

    Managed WordPress Hosting Cons

    Price (better yet, what is your business model?)

    Managed WordPress hosting is more expensive, but that’s not really what cost comes down to. Whether or not you choose to go with managed hosting as a result of the cost, realistically is a matter of what your business model is. If you’re a WordPress design and development agency that has made the decision they want to get into the hosting business (a billion-dollar industry), then running your own infrastructure, eventually staffing your own support, etc. becomes a more logical choice.

    Whereas, if you wish to maintain the stance that hosting is not something you’re interested in getting into and you would rather focus solely on your area of expertise as a design and development partner, perhaps eventually expanding into offering other services like SEO, then going with a managed WordPress hosting provider – depending on the site – can make more sense for your business.

    Less Control

    When you go with managed WordPress hosting, you are tied into their ecosystem of how you can scale sites, and traffic and how you can optimize when you reach a certain point, i.e. can you decouple your database and use a dedicated database server & do you need to pay $100/month to enable Redis caching because your host offers it as an add-on? All of these are out of your control and tied to how your managed WordPress hosting provider wants you to handle them.

    When Can Managed WordPress Hosting Make Sense?

    We would distill the ideal customer profile of managed WordPress hosting providers don’t

    To make the distinction of when to choose managed WordPress hosting over a solution like RunCloud (and vice versa), you can distill things into 2 ideal customer profiles:

    1. The business owner who is not interested in having extra work to do, just wants things taken care of so is willing to pay a managed WordPress hosting provider.
    2. The businesses that have the technical talent but don’t want to capitalize on WordPress hosting as a part of their business model (as a part of a strategic choice to focus on what their core service is, missing out on recurring revenue as a result, but this can be the right way to go of course).

    While using a solution like RunCloud doesn’t require you to be a SysAdmin or expert by any stretch of the imagination, realistically anyone who can use WordPress to a decent level will (perhaps with some help from our incredible support team) get up & running, it is still slightly more involved than going with a managed WordPress hosting provider.

    So if we go back to the two profiles above, it really comes back to what you want your business model to be. Do you want to take ownership of the hosting layer and become the expert or do you want this to be taken care of by a managed WordPress hosting provider that staffs a team of experts?

    Or, better yet, a mix of both? This is what quite a few of our customers do.

    For agencies that host sites for their clients but not all client sites are alike, some have bigger budgets and some have more complex sites. When there’s a site that’s too big for the agency’s appetite for managing in-house (with their current team) on RunCloud, they offload it to their managed WordPress hosting provider of choice. While the majority of sites tend to fall within the type of sites they want to manage in which case they choose RunCloud which makes total sense, because it really isn’t a completely black & white choice, and fortunately, isn’t an all or nothing choice either.

    Managed WordPress Hosting vs. Shared Hosting

    Now although this isn’t the focus of the article, there is one thing we do want to mention and that is shared hosting. Yes, we’re thinking exactly what you’re thinking – subpar support and terrible performance.

    When To Avoid Shared Hosting?

    Our personal stance on shared hosting is that it almost never makes sense for any kind of serious business owner. Sure, we’re well aware that the shared hosting providers in the industry occupy a very significant portion of the market share but realistically that is because many people that use WordPress aren’t necessarily running a business or working to accomplish something with their websites.

    For the price of most shared hosting providers, you can easily maintain your infrastructure with RunCloud at a fraction of the cost so referring clients (if you’re a design and development agency) to a shared hosting provider is really just a huge missed opportunity. Because you’re both not going to satisfy them with your recommendation (given they are likely to not be happy with their experience) and will miss out on keeping them as a customer as a part of a hosting & support service offering.

    After Action Report – Get Ready To Own The Hosting Layer & Grow Your Business

    Now that you know how to decide on when to use or better yet, the type of sites it may make sense to host with a managed WordPress hosting provider, let’s take a moment to talk about how you can own the hosting layer and use it to grow your business.

    Traditionally, managing your infrastructure with cloud providers like DigitalOcean, UpCloud, Vultr, Linode, AWS, the Google Cloud Platform (and more) required you to be extremely familiar with Linux to the point where you could essentially consider yourself a self-taught SysAdmin.

    Fortunately thanks to RunCloud, this is no longer the case. Managing your own infrastructure, deploying servers with DigitalOcean of UpCloud all the way to setting up WordPress sites on those freshly-deployed servers can all be done in a matter of minutes. And, if you do run into any issues, you have a friendly support team of real people ready to jump in to help.

    This only begins to scratch the surface of how you can use RunCloud, but here are some of the things you can expect to enjoy when managing your infrastructure with RunCloud:

    • Easy server deployments
    • 1-click WordPress installation
    • Built-in tools for file management, Cron jobs, and more
    • 1-click staging environments
    • Server and site monitoring
    • Server statistics and health checks
    • Atomic Deployment
    • Integrations with GitHub and Bitbucket
    • 24/7 friendly & human support team
    • Built-in backups (including to external providers of your choice, i.e. S3 Buckets & more)

    What really separates RunCloud from other similar solutions is ease of use and support. Other newer providers that throw together some copied version of what RunCloud offers come and go, we’ve been here for years and aren’t going anywhere. And we aren’t basing our product development timeline off of competitors.

    One-click SSL, seamless integration with Cloudflare, and more make managing dozens of websites as a company of one (or more with a small team) is all possible with RunCloud.

    Ready to get started? Learn more and sign up for your free trial today.


    Bonus: If I Do Choose To Go The Managed Route – Which Managed WordPress Hosting Providers Can You Recommend?

    So, if you’ve made it to the end of this article and still have a specific use-case for managed WordPress hosting – this is a handpicked list (based on the hosting providers our team has actual experience with). These are all hosts that we can wholeheartedly recommend and are very well-reputed in the industry.

    Servebolt

    servebolt homepage

    Servebolt is a next-level, high-performance managed hosting provider with a strong focus on scalability. Whereas most such hosting companies are built on other platforms, such as AWS or GCP, thereby limiting the extent to which they can optimize their service, Servebolt has built and maintains its own Linux distribution – and controls the stack from top to bottom. As such, they’re able to optimize for raw performance at every layer of their stack.

    • Built for true scale and raw performance
    • Friendly customer support
    • A hardcore approach to performance
    • Consistently outperforms all other managed hosting providers in independent WP Hosting Benchmarks across all tiers.

    If you already aren’t using RunCloud to manage a server deployed with DigitalOcean or UpCloud, it makes sense to go with a hosting provider that hasn’t just built their infrastructure on top of AWS, the Google Cloud Platform, etc. Because maintaining their own hardware is what allows Servebolt to achieve the performance and optimize the stack from top to bottom while the other managed hosting providers (although we still recommend them) are simply powered by AWS and the Google Cloud Platform.

    servebolt pricing

    It’s also worth noting that Servebolt does not impose a limit on PHP workers, something we highly recommend when choosing a hosting provider, especially when looking at managed WordPress hosts which are by no stretch of the imagination extremely affordable. A limit on PHP workers is something that a lot of managed WordPress hosting providers like to do in order to throttle performance when your site starts to scale and charge extra to “add extra PHP workers to your site” to keep charging you more as you grow. Charging more as your site grows is fine, server costs will trend upwards as your site grows but throttling performance as a means of achieving this is not something Servebolt (nor we at RunCloud) are advocates for.

    Pagely

    pagely homepage

    Pagely is an enterprise-level WordPress host and is easily the most expensive service on this list. If you want a host to take care of all the heavy lifting and provide a premium, near hands-free experience, then keep reading.

    • World-class server speeds powered by AWS Cloud
    • Superb customer support (live chat and tickets)
    • Free SSL, CDN, and backups
    • Optimized WordPress sites
    • Simple staging tools
    • Automatic site-wide updates
    • Efficient hosting for eCommerce

    Pagely’s higher pricing plans allow bigger businesses to host 30 to 60 websites and more. As a solution for enterprise companies, Pagely takes security very seriously. You’ll be protected against DoS/DDoS attacks and have all plugins up to date. Pagely also developed its own security architecture called PressArmor. Finally, since nothing is 100% safe, Pagely will automatically back up your website at no additional cost.

    A premium price also requires stellar support, which Pagely proudly offers. Basic support means sending tickets and having access to live chat (only during business hours). If you opt for a more expensive plan, you can get access to phone calls and even have your own personal Slack channel.

    pagely pricing

    Kinsta

    kinsta homepage

    One of the largest managed WordPress hosting sites in the industry, Kinsta caters to a wide range of customers, including new business owners as well as enterprise-level clients.

    Whether you’re a small business or one that’s almost a household name, Kinsta has a pricing plan ready for you. In this review, we’ll be focusing on Kinsta’s cheapest pricing option, the Starter plan.

    Here’s what you can expect from working with Kinsta:

    • Site staging features
    • Automatic database optimization
    • Automatic daily backups, with the option to create manual backup points
    • Free SSL
    • Limits on the number of PHP workers per site
    • 24/7 live chat support team

    It’s important to note that Kinsta doesn’t offer unlimited visits and CDN. Each plan has a monthly visit limit and if your visitors go past that number, you’ll be charged extra (notified ahead of time).

    As a separate point, it’s worth keeping in mind that depending upon which plan you choose, you will have a cap on the number of PHP workers active on your site. For basic, static websites this is not generally a problem, but more dynamic sites should take this into consideration when comparing their options.

    In addition, Kinsta also does not include server-level caching (Redis) that works for dynamic sites unless you pay an additional fee as they separate it from their plans to sell it as a premium add-on.

    Still, the support team behind Kinsta feels passionate about their work. The reviews on Kinsta’s support team are some of the best you can read in this industry. If you’re a business with a sizable number of employees, Kinsta makes team management a breeze. You can add unlimited users to your site and easily set roles or permissions for each user.

    As for security, Kinsta will fix your website for free if it’s hacked. Which frankly is unlikely given the GeoIP blocking, DDoS scanning, and other features that are protecting your site as standard. The only notable downside to Kinsta is their inability to provide an unlimited plan and their list of blocked plugins (to avoid slowing down the servers and your site).

    All in all, Kinsta is a very flexible managed WordPress host. They have 10 pricing plans incremented by $100s from $30 all the way to $1,500. You can also save 2 months’ worth of hosting payments if you pay annually.

    WP Engine

    wp engine homepage

    WP Engine is an all-around managed WordPress host with a long portfolio of innovation and consistent service.

    The managed WordPress hosting service is specifically designed to manage WordPress sites. With patented optimization tools, good customer support, and a range of premium features, WP Engine is an affordable alternative that offers reliable quality.

    Here’s what you can expect from using WP Engine:

    • 24/7 customer service
    • Daily backups
    • Staging site features
    • Simplified website managing process
    • Reliable performance when it comes to speed and uptime
    • Quick and easy WordPress migration and installation
    • Premium themes
    • Automatic site-wide updates
    • Free fix in case of hacking incidents

    WP Engine has a good list of features to help you build and maintain a solid website. Since their entire framework is specifically designed for WordPress, you’ll also be benefiting from consistent loading times and server speed.

    If you’re looking for an entry-level managed WordPress host that executes all the basic features of a WordPress host well, then WP Engine makes a good case.

    wp engine pricing

    Beginner-friendly and inexpensive, WP Engine is a great option for new business owners. For those of you who have more websites and demands to solve, WP Engine also offers enterprise-level solutions with a pricing system that’ll be specific to your needs.

  • What Are Linux Logs? What Are They & How To Use Them

    What Are Linux Logs? What Are They & How To Use Them

    Linux logs offer developers and system administrators a detailed account of all events, requests, and activity on the server. Log files can be used to monitor critical events in the kernel, the server, and for any services or applications actively running.

    Server administrators can review comprehensive diagnostic information about performance, ranging from kernel events to user actions. In this post, we’re going to talk about Linux logs, what they are, why they’re important, and focus on the most important Linux logs. 

    What Are Linux Logs?

    A Linux log is simply a file that records specific information relating to events, applications, and the kernel. When you face an issue, these files can prove to be a critically important tool for troubleshooting.

    In case of a problem, administrators can simply analyze these files to determine and create a timeline for the series of events that occurred, and which eventually led to the problem.

    Linux logs are generally stored in plain text and are available in the /var/log directory. Linux logs can be found for virtually everything, including boot processes, package managers, kernel, Apache, MySQL, and others. 

    The Most Important Linux Logs

    Broadly speaking, Linux logs can be categorized under the four main headings:

    1. Application Logs
    2. System Logs
    3. Service Logs
    4. Event Logs

    Since Linux logs are generally stored in plain text files, sifting through each one is incredibly difficult. That’s one of the main reasons why developers often prefer using different tools, such as log file viewers. Examples of these include Logmaster or MultiTail.

    But as a system administrator, there are some Linux logs that really demand your attention. Here are the ones that you should definitely know about.

    Application Logs

    1. /var/log/syslog

    This is a simple Linux log that shows you general information regarding system performance. Essentially, this log shows all the activity that has occurred in the system. This is the same as /var/log/messages, and shows you a generic log of all system activity.

    All non-critical and informational messages are shown here. For Debian systems, you will use /var/log/syslog. But for other Redhat systems, such as Rhel, you will use /var/log/messages.

    How to use /var/log/syslog

    These Linux logs let you track any errors related to application services or any other messages that are logged when the system boots up. Commonly, this is often the first Linux log that administrators look at when something goes wrong.

    It gives you a basic understanding of any errors, so in case an issue was detected during system startup, administrators can simply go through these messages to find out what went wrong.

    1. /var/log/maillog

    These Linux logs are used for storing information relating to mail servers. This is quite handy for any email-related services that are active on your server. It is also useful for postfix or for the SMTP daemon process.

    How to use /var/log/maillog

    If you’re running email-centric services such as MailScanner, you can find information related to them. With these logs, you can also track all incoming or outgoing emails within a defined period. 

    In any situation where mail delivery has failed, simply refer to the logs to find out why. More importantly, these Linux log files will also give you information about the origins of incoming emails. If there were any spamming attempts detected and blocked by the server, you can find these in the log files too.

    1. /var/log/yum.log

    If you have any packages installed that utilize the yum command, information related to those will be found in these Linux logs. This can be useful for determining if everything went well.

    How to use /var/log/yum.log

    You can see Linux logs that confirm whether packages were installed correctly or not, including information about other software and system components that have been installed.

    In case a software package was not installed correctly, you can find information related to that in these logs. These logs will help you identify any malfunctions and correct them by identifying the underlying issue.

    System Logs

    1. /var/log/boot.log

    These Linux logs contain startup messages and information pertaining to the boot. This includes the initialization script, which sends all bootup information to the log file.

    Think of this as a comprehensive log file that offers detailed information about the server startup process, including all messages that are logged as the server starts up.

    How to use /var/log/boot.log

    In case there were issues with startup or shutdown, you will find relevant information here. This also includes information relating to any boot failures or random restarts.

    These Linux logs are generally useful for determining issues related to system downtime, especially if the server experienced random shutdowns.

    1. /var/log /dmesg

    Another way to view Linux logs is dmesg. This shows you all Kernel ring buffer messages, including information that relates to any hardware components and their drivers.

    The kernel is capable of detecting physical hardware devices that are connected to the server as it boots up, which is why it is capable of logging hardware errors or the general status of these components. It also includes other general logs.

    How to use /var/log /dmesg

    If there’s an issue with a certain piece of hardware connected to the server, you can check the dmesg logs to determine the problem and fix it. It’s great for server management, as these logs are mainly for dedicated server customers.

    1. var/log/mysqld.log

    Finally, this is the MySQL log file. All messages related to debugging, failure, or success of the MySQL daemon are logged here.

    If you’re running RedHat or Fedora distros, you will find these under /var/og/mysqld.log. For Ubuntu or Debian distros, just search through the /var/log/mysql.log directory.

    How to use var/log/mysqld.log

    Any issues related to running or halting mysqld can be found here, so use these logs to determine what’s wrong and make changes. You can also glean valuable information about client connections to the MySQL directory using these logs.

    Service Logs

    1. /var/log/auth.log

    The auth.log generally stores Linux logs associated with authentication and includes information for both failed and successful logins. Again, for Debian or Ubuntu-based systems, you can find the relevant Linux logs in /var/log/auth.log. 

    But, for Redhat or CentOS distros, you will find them under /var/log/secure. All relevant information regarding the user authentication process can be found here.

    How to use /var/log/auth.log

    If you feel that there might have been a security breach on the servers, you may want to check these logs to determine successful or failed logins. Server administrators generally keep a watchful eye and instantly become suspicious if they notice a JavaScript file out of place or anything that doesn’t make sense.

    With these logs, you can quickly and efficiently analyze any suspicious activity, including failed login attempts. Since it records all activity related to user authentication, you can easily figure out if your server was the target of a brute force attack.

    1. /var/log/cron

    This log stores all messages related to cron jobs, including the time when the cron daemon began a job, any relevant failure messages, or other status information.

    How to use /var/log/cron

    Every time a cron job is executed, these Linux logs are used to maintain detailed information, including any error messages or issues relating to the successful execution. If your scheduled cron isn’t running properly, you might want to review these logs.

    Event Logs

    1. /var/log/faillog

    The /var/log/faillog records all relevant information related to failed logins. This is very handy for honing in and finding out about any security breaches. It’s similar to the one above, but instead of showing both successful and unsuccessful logins, it only returns failed logins.

    How to use /var/log/faillog

    If you feel that your server was targeted in a username or password hack, these Linux logs will give you comprehensive information about any such activity.

    1. /var/log/httpd

    This is a directory of Linux logs that contain access_log and error_log files associated with the Apache server. The information is stored in two different log files, with errors kept in the error_log file and memory issues related to requests via HTTP stored in access_log.

    How to use /var/log/httpd

    You can view all errors related to http daemon access using the error_log file, including any system-specific problems. More importantly, the Apache server records events and errors here that occur during http request processing.

    In case you experience an issue with your Apache web server, you can check the logs to determine the issue. In addition, the logs also contain IP addresses and user IDs of all clients that serve a connection request.

    It also contains information about the status of all server requests, including those that were successful or ones that failed.

    1. /var/log/kern

    This log offers information about the kernel and any warnings. Kernel logs can be accessed with this terminal, so in case of any errors or warnings, you can check it out.

    How to use /var/log/kern

    If you’re facing issues with custom kernels, you can check warning data through this log and troubleshoot problems. It gives you comprehensive information about any kernel errors, making it easy to find problems and fix them.

    Frequently Asked Questions

    How Do I Analyze a Log File in Linux?

    You can use a command line tool such as grep to run plain text searches. These can help you analyze log files and are generally found by default in most Linux distros.

    How Do I Manually Create a Log File In Linux?

    To create a log file entry in Linux, you can simply use the logger command. The command helps you connect with the syslog module. To create a log file, simply type “logger” (without the speech marks), followed by your message, and Linux will automatically add it in the /var/log/syslog directory.

    Where Are Logs Kept in Linux?

    You can find most of the Linux log files as plain ASCII text files. They’re commonly stored in the /var/log directory and its subdirectories.

    What Is The Purpose Of Logs in Linux?

    The main purpose of Linux logs is to provide a detailed event timeline in the Linux OS. It can be an excellent tool for diagnostics and for troubleshooting and is commonly used by administrators to determine what went wrong. 

    After Action Report – RunCloud Dashboard Makes Log Viewing Easy

    Linux logs are an excellent way to identify any errors and correct them. The RunCloud dashboard makes it easy for users to find logs within their Web Application. Simply click on the Web Application, and navigate to Web Server Log.

    Are you using Linux logs to keep track of server performance or to identify errors? If so, we’d love to know more about how you use them. Let us know in the comments below!

  • How To Use Autoptimize WordPress Plugin To Optimize Your Sites

    How To Use Autoptimize WordPress Plugin To Optimize Your Sites

    Autoptimize is a popular WordPress plugin to optimize your WordPress sites with more than 1 million active installs and around 1,200 five stars reviews at WordPress.org.

    In this post, we’ll discuss how to use Autoptimize to improve the performance of your WordPress websites.

    Who needs Autoptimize?

    If you use lightweight WordPress theme/plugins in your WordPress site, you probably do not need any extra optimization. You only need to use a cloud server, and your WordPress will be fast. In this case, adding server-side page caching like RunCloud Hub is more than enough to improve WordPress performance.

    But when you use a WordPress theme and some plugins that add extra JavaScript and CSS files to your site, you will probably need Autoptimize to improve your site performance.

    Autoptimize + RunCloud Hub

    Can we combine Autoptimize and RunCloud Hub?

    Short answer, YES!

    In fact, Autoptimize and RunCloud Hub are a perfect combination to optimize your WordPress site.

    Autoptimize works on the WordPress side to optimize your JavaScript / CSS / HTML files on your web page, and RunCloud Hub works on the server-side to cache the optimized version web page.

    JavaScript Optimization 

    Autoptimize comes with some options to optimize JavaScript files on your web page. These JavaScript files come from WordPress core, theme, and active plugins. When you enable the “Optimize JavaScript Code?” option, JavaScript files will be minified and compressed to reduce the file size. A smaller JavaScript file size will make your web page more lightweight.

    javascript options on autoptimize

    By default, the setting for JavaScript is “don’t aggregate but defer” and “also defer inline JS” and no exclusions. Aggregation is off by default since the number of HTTP requests aren’t as important with HTTP/2.

    These two default options are enough for many WordPress sites to both minify and combine JavaScript files.

    Please remember that these options work on your web page only if you have well-coded JavaScript codes. If you use a theme/plugin that has poorly coded JavaScript codes, these options can break some features in your web page that rely on JavaScript.

    If these options work nicely on your site, then you can stop here or explore other JavaScript optimization features. You can also add a list of scripts that you do not want to optimize.

    CSS Optimization

    Autoptimize comes with some options to optimize CSS files on your web page. The main CSS files come from your active WordPress theme that controls the visual presentation of your web page. Other CSS files can come from your active WordPress plugins.

    CSS aggregation is off by default, though you can enable it with a click. Please remember that these options work on your web page only if you have well-coded CSS codes. It’s off by default to prevent any major issues.

    If you use a theme/plugin that has poorly coded CSS codes, these options can break your web page layout.

    css options on autoptimize

    If these options work nicely on your site, you can try to enable the “Also aggregate inline CSS?” option. Autoptimize will aggregate CSS in the HTML.

    HTML Optimization

    HTML optimization is a bonus after you optimize JavaScript and CSS files in your site.

    html options on autoptimize

    Enabling the “Optimize HTML Code?” option will minify the HTML output of your web page. It will make the HTML output code not easily readable, but the file size will be smaller.

    Extra Optimization

    Autoptimize has some extra auto-optimization options under the Extra tab.

    Google Fonts Optimization

    You can use this option to optimize Google font loading on your website.

    We recommend using either the “Combine and link in head” or “Combine and link deferred in head” option. Please test to see which one works best on your site.

    If your website caters to visitors from the European Economic Area, you may want to learn how to stay GDPR compliant while using Google Fonts.

    Remove emojis

    You can enable this option to remove WordPress core emoji’s inline CSS and inline JavaScript, except you use this emoji feature on your website.

    Remove query strings from static resources

    If you enable JavaScript and CSS optimization, this option is no longer needed.

    But if you disable JavaScript and CSS optimization, you can try to enable this option.

    Please remember that this option will not improve your web loading time and performance, but it might improve performance scores when you test your website using any page speed testing tool.

    extra auto optimizations on autoptimize

    Remove global styles

    Introduced with WordPress 5.9, global styles often add CSS & scalable vector graphics (SVG) to your pages automatically. An option is now available to remove global styles.

    Critical CSS / Above-the-fold CSS

    The CSS optimization in Autoptimize is enough to optimize your CSS files on your site. The optimized CSS file is loaded in the head with render-blocking. You probably know that Google Page Speed Insight complains about render-blocking CSS on your site. If you really want to optimize your website for Google Page Speed Insight, you will probably need above-the-fold CSS.

    The idea is simple. Above-the-fold is all the content you see on page load, before scrolling. Above-the-fold CSS or critical CSS will be loaded inline on the head to render the content to your user as soon as possible. Other CSS files will be loaded later in non-render blocking after page load.

    YES, critical  CSS is part of CSS optimization, but not everyone needs it.

    There are two ways to use critical CSS in your site using Autoptimize.

    Same critical CSS for all pages

    If you think you can use the same critical CSS for all pages, you can use the “Inline & defer CSS” option under the CSS Optimization section.

    incline and defer css on autoptimize

    You can check this list of tools to generate critical CSS for your website.

    Different critical CSS for different pages

    In this case, you will need to sign up for a premium service criticalcss.com to generate different critical CSS for each page on your site automatically.

    critical css on autopimize

    Rules Panel

    rules on autoptimize

    A rules panel is now available to help users create manual rules, even if you do not have a Critical CSS API key.

    Misc Options

    You will probably see some options in the “Misc Options” section. If needed, you can enable all of these options.

    The “Save aggregated script/css as static files?” option is very important to cache the optimized JavaScript/CSS files as static files.

    This is why you will see the “Autoptimize – Delete Cache” option on the admin bar to allow you to remove the optimized JavaScript/CSS files, and it will be regenerated again.

    misc options on autoptimize

    If you use RunCloud Hub and Autoptimize combo, when you click “Delete Cache” on Autoptimize, it will automatically clear RunCloud Hub caches. And when you click “Clear All Cache” on RunCloud Hub, it will also automatically clear Autoptimize caches.

    You can now “Enable configuration per post/page?” to change settings per page, or per post, which is ideal for optimizing Largest Contentful Paint for your site.

    After Action Report — Autoptimize Helps Boost Site Performance

    Autoptimize is a popular WordPress plugin to optimize JavaScript / CSS / HTML output of your web page to improve your WordPress performance. With its latest string of new features introduced in version 3.0.3, Autoptimize is a fantastic choice if you have additional CSS and Javascript files on your site. Do you use RunCloud’s server-side caching & are considering pairing it with Autoptimize? Awesome, feel free to join the conversation below to share your experience. 💬

  • Understanding Continuous Integration vs. Continuous Deployment

    Understanding Continuous Integration vs. Continuous Deployment

    If you work in DevOps, you may have heard, or be familiar with, continuous integration and continuous deployment. Often, people use these terms interchangeably, but this is incorrect.

    Consider that you wish to implement a change to your web application – for simple changes, these are often made directly. But when you’re considering improving your development workflow, you’ll want to be able to stage these changes, test them in a separate environment, and deploy them – all without causing your site to be temporarily inaccessible to end-users.

    In essence, continuous integration and continuous deployment are two related, but separate processes for automated deployment to make changes to code. They are ways to change code in order to keep things smooth, with less need for manual testing and changing. While they do relate to each other, each is a distinct concept that needs to be understood.

    In this guide, we’ll break down what these terms mean, how they’re different, the benefits of taking advantage of them in your workflow, and how to implement them properly in WordPress – so, let’s dive right in.

    What Are Continuous Integration And Continuous Deployment?

    As we mentioned previously, they are both methods to deploy changes to code. If you need to make some changes to the code of a site, you will need to understand both continuous integration and deployment to do so.

    However, to make matters potentially a bit confusing, they can work together, with each aspect, integration, and deployment representing different factors. You have to use continuous integration as part of continuous deployment, but you may opt out of continuous deployment, however. So, they are not the same, and they need to be understood independently. Let’s dive into looking at exactly what each of these terms mean.

    What Is Continuous Integration?

    Continuous integration is the first element of a good CI/CD setup in your development workflow, and it is the automated method of combining code versions and validating results. This is particularly useful the more frequently you make changes, as you can create a CI pipeline that automatically builds and tests changes before you merge them.

    This is especially true if you’ve developed automated tests. The benefit of CI is that developers can focus on development while the key tests run in the background to catch any changes that conflict with any other existing code. This can be in the form of deploying to a staging environment or simply running automated tests in the background.

    What Is Continuous Deployment?

    Continuous deployment (CD), on the other hand, is the last element of a CI/CD workflow. Once the modifications have been integrated and tested via your CI pipeline, the next step is to deploy your new release. Many developers still do this manually, which is a huge waste of time. Fortunately, if you use a service like RunCloud to manage your server infrastructure, you can easily automate your deployments making it possible to seamlessly release your code as frequently as you’d like.

    No more sleepless nights thinking of launch days and pushing individual features.

    Deploy with no downtime for your users and easily roll back changes if you spot anything that’s acting up in production that wasn’t caught during your testing.

    Note: There is another term that is sometimes used: continuous delivery. This is very similar to continuous deployment in that it forms an important part of the development approach involved with ensuring that changes can be pushed at any time. This means that building, testing, and releasing software can take place more efficiently.

    What Is The Difference Between Continuous Integration And Continuous Deployment?

    Effectively, continuous integration is how to make the code updates work for the developers, assisting them in the implementation of code changes into the main branch. Continuous deployment is about getting the code to the end-user in a way that doesn’t interfere with the branch, and testing to make sure that changes are automatically implemented without issue. They both relate to each other, in that continuous integration plays a role in continuous deployment, but deployment is the step to get the results to the end-user.

    How Can Continuous Integration And Continuous Deployment Work Together?

    You need continuous integration if you want to do continuous deployment. In that, if a commit is being deployed regularly to production, it needs to be working, and you need to be sure of that. Continuous integration allows you to ensure that it works. So, if you want to do continuous deployment of regular commits, you need to do continuous integration.

    However, if you do not have regular changes, you may not need to do continuous deployment; rather, you may choose to opt for continuous delivery and integration. The integration ensures all code changes work, and delivery requires manual approval of the implementation of the changes. Deployment becomes more useful when you are comfortable with the testing process, and you have more regular changes to implement.

    Why Use Continuous Integration?

    Continuous integration is useful for you and your team to ensure that code changes work. There are several reasons you should use this approach, which we outline now:

    Advantages Of Continuous Integration

    • Fewer Bugs — Because of the automated tests, bugs get caught early on, and there is less chance of breaking.
    • Easy Building Of Release — As you are ensuring that integration matters are taken care of early, the release can be built much easier.
    • Less Context Switching — Developers immediately know when something breaks, allowing them to fix it prior to changing tasks.
    • Less Testing Costs — Continuous integration servers can handle hundreds of tests per second. This reduces your costs considerably.
    • Less Documentation — If you just use continuous integration without continuous deployment, you will have less need to document each and every automatic deployment.
    • Less Need For Top Level Testing — Similarly, if you forgo continuous deployment, you don’t need as much top-level testing to ensure that your automatic deployment works. In fact, you have more manual control over the process.

    Why Use Continuous Deployment?

    With continuous deployment, you make your life considerably easier in the long run. It allows for efficient deployments, and given that you trust your testing, it means that you can spend more time developing instead of worrying whether your changes will work outside of production.

    Here are the reasons to consider using continuous deployment:

    Advantages Of Continuous Deployment

    • Fast Development — There is no need to pause development for each and every release. Rather, the pipelines get automatically triggered to make changes.
    • Less time-consuming tasks — Continuous deployment automates a range of tasks, saving a lot of time.
    • No Daily Merging Of Changes — If you just use continuous integration, you have to take care of merges every day, but continuous deployment does this for you.
    • No tests for each feature — Just using continuous integration requires tests for each new feature. Continuous deployment takes care of that for you.
    • Less Risky Releases — With continuous deployment, you can release small batches of code, which are easier to fix.
    • Daily Improvements — The end users get to experience constant improvement on a daily basis.

    How To Adopt Continuous Deployment?

    If you want the benefits of continuous deployment, but so far are only using continuous integration and delivery, how easy it would be to adopt continuous deployment will vary depending on where you are with your project status.

    When starting a project, you can implement continuous deployment as soon as possible. You can automate deployments before having end-users, to ensure all things are running smoothly, and generally check that everything is working fine. You can increase the testing and when eventually you are content with the deployment process, you can then launch with a whole continuous deployment process in place.

    If your project is already running, and end-users are already present, there are some things to consider changing:

    1. Start with continuous integration and delivery, in order to have more control and checks over the process.
    2. Then create basic tests for automatic execution, to avoid making things too difficult.
    3. Then you can start automating deployments so that eventually all deployments are done automatically.
    4. When you are ready for full continuous deployment you need to ensure that everyone is ready and aware of the nature of any changes to the code, as this can affect customers. Constant planning is also required as are top-level testing capabilities.

    The Best CI/CD Tools We Recommend

    There are multiple tools out there to do the heavy lifting with both continuous integration and continuous deployment. Generally, they help facilitate the integration and automated deployment of code.

    If you already use RunCloud to manage cloud infrastructure, we offer built-in Atomic Deployment, so you don’t have to worry about setting up, configuring, and paying for yet another service to handle your continuous integration and deployment needs.

    That being said, other big names that provide services for continuous integration and deployment are Jenkins, CircleCI, and GitLab, among many others.

    Jenkins is an open-source automation server, with building and integration processes, and it supports hundreds of plugins to help with integration as well as deployment.

    With CircleCI, you are able to have an automated pipeline, from building to deployment, and it is compatible with many other programs, including Jenkins, GitLab, and others. It also hosts continuous integration on the cloud or behind a firewall on your own server.

    GitLab is a Git repository manager and lets you trigger builds, run tests, or deploy code at each push or commit.

    Find what tools you require to help with your continuous integration and deployment needs.

    How Does Continuous Integration Or Continuous Deployment Work With WordPress?

    Generally, WordPress projects are a bit different, due to the lack of suites for built-in units and integration tests. However, these processes can still apply to WordPress. The main concern for developers when it comes to WordPress is ensuring everything works without affecting the speed of pages. Continuous integration and continuous deployment can take care of this.

    Do bear in mind the nature of the structure will be affected if the project has a standalone theme or plugin, or WordPress’s feature themes.

    Generally, you would first need to build your dependencies.

    Second, you test your code. If you use continuous integration and continuous deployment, you can test within your site. Different developers use different approaches, but it is something that can be done with WordPress.

    Finally, you can deploy. When you deploy in WordPress, it is most likely you are deploying a plugin, theme, or full site.

    RunCloud’s Atomic Deployment feature is platform-independent, which means it works with WordPress, but it also works with other platforms, such as Laravel. PHP management tools are essential for WordPress. 

    After Action Report – Implement CI/CD In Your Development Workflow Today

    Continuous integration and continuous deployment are two terms that are used interchangeably, in part because they are often linked together. However, we explained the different natures of each of these things. Whether you wish to use continuous deployment is up to you, but it is a good way to save a lot of time and effort, once set up.

    It is generally better if you can trust your testing capabilities or are in the early stages of project development. Consider learning more about how RunCloud’s Atomic Deployment can help with your site. Here are some sources you can find out more about Atomic Deployment:

    Do you have any specific questions about continuous integration and continuous deployment? Or think we’ve missed something worth including in this post? Join the conversation by leaving a comment below. 💬

  • When And Why To Use Docker

    When And Why To Use Docker

    Docker is a popular containerization platform that has been used by developers and teams to build and scale containerized applications. However, many non-technical professionals are unaware of its capabilities, or why Docker is such a popular choice.

    In the following article, we are going to do a deep dive into Docker, and explain why it is so popularly adopted and used.

    What is Docker?

    At its core, Docker is simply a containerization platform that’s available open-source. For those who don’t know, containerization simply refers to packaging software code using simply the libraries of the operating system and the dependencies needed to run the code.

    It’s all packaged in a single, lightweight “container”, allowing consistent execution on any kind of infrastructure. Containers are preferred by developers instead of virtual machines (VMs) because they are more portable and can be used for running modern cloud-based applications.

    Docker makes it easy for developers to create containers, making the process for building, managing, and deploying containers incredibly straightforward. Think of it as a toolkit that lets you manage containers using a single, straightforward API.

    Here are some other reasons why Docker is so popular:

    • It simplifies infrastructure management
    • Ideal for building and sharing disk images
    • It can be used to maintain a centralized repository of all disk images

    For instance, while you write code in Java and run it using a JVM, you can create a Dockerfile and deploy it on a Docker server.

    And, like Git, Docker makes the same promises, except you can track changes in systems, instead of changes in code. Docker lets you track changes throughout your entire system, letting you pull history to see all recent updates.

    We already made an entire post on what Docker is, so if you want to know more details about it, make sure to check our post here.

    Why Use Docker?

    So, now that you understand the basics, let’s talk about the many reasons why so many dev teams and technical professionals prefer Docker over other options, such as Kubernetes or Microsoft Azure Container Registry.

    1. Security

    One of the main reasons why Docker is such a preferred choice for dev teams is because it adds a layer of security that developers don’t get if they build outside of Docker. For starters, you get the option of separating individual components of a larger application into separate containers.

    This way, should a single container become compromised, you won’t have to worry about the effect permeating through the rest of the application. With distributed teams working on different components, additional security is always good.

    2. Version and Environment Control

    Docker has the ability to track discrete versions of container images. This gives you unprecedented version control, letting you roll back to a previous iteration, view past-built versions, including developers who worked on them, and how the work was done.

    More importantly, you can also decide to upload exclusively just the changes that were highlighted between an existing version of a container and the new version.

    If your software runs in different environments, there’s also a risk of identifying inconsistencies in behavior depending on the machine or environment that the software runs on.

    For instance, one element that works on a developer’s computer might not work on a specific server, which would be a new environment.

    However, since Docker lets you isolate software in containers, you can run them separately without having to worry about environmental changes.

    3. Identical Code Reproduction

    One of the biggest advantages of Docker is its ability to reproduce code in an identical fashion on any system, as long as it is capable of running Docker. Just like Java apps, which tend to run in the same way as long as the machine supports Java VM, Docker containers can do the same.

    You can view the exact specifications of different containers using their Dockerfiles. This way, when working in teams, you can guarantee that all software images that are built using the same Dockerfile will function the same way.

    And, having consistent code documentation is obviously going to make it easier for you to identify issues and track your application development in a better manner.

    4. Isolated Environment

    This one links with additional security. Since the dependencies of one container don’t affect other installations on the container or other containers, developers can prevent any kind of conflicts between dependencies.

    For instance, you can use separate containers for front-end development or for servers. This makes it easy for dev teams to run multiple projects on the same server, without having to worry about any conflicting dependencies.

    5. Easy Technology Management

    Docker makes it incredibly easy to manage new technologies and to test them out. If you’re interested in trying out new programming languages or new databases, you can easily do so. The Docker Hub has a fantastic collection of ready-to-use docker images.

    Just search for a relevant Docker image, and you’re good to go. You can seamlessly add it to your existing Docker configuration. This helps teams save a great deal of time that would otherwise be spent on debugging or installing new images.

    When To Use Docker

    Not sure about when Docker might be useful for your development? We’ve put together a range of situations to give you a better idea about when to use Docker.

    1. When Running Orchestration Engines Like Kubernetes

    While it’s easy to manage a handful of containers directly from the Docker Engine, things do become a bit confusing when your software deployment includes thousands of containers and several services.

    That’s why you might want to consider using an orchestration engine, such as Kubernetes. Container orchestration tools such as Kubernetes are incredibly powerful and are the preferred choice for most developers.

    Docker does have its own orchestration engine, entitled Docker Swarm, though Kubernetes far outranks it in terms of popularity.

    It helps automate several tasks associated with containerized architectures. This makes it incredibly easy to run multiple servers and even lets you deploy your services on several new services.

    2. Ideal for Implementing Version Control

    As stated above, Docker containers make it easy for you to standardize the environment and speed up software development cycles. For instance, if you perform an upgrade on a specific component that ends up breaking the entire environment, you can easily roll back to a previous Docker image.

    Docker is much faster than conventional VM backups, allowing you to quickly replicate the changes and launch new Docker images.

    3. When You Have Developers Working In Different Setups

    Development teams tend to change quite frequently. It’s always a bit time-consuming when you are onboarding new developers to an existing project. Before they can start writing code, you need to make sure that they have a local development environment set up.

    Depending upon the project complexity, this can take quite a bit of time, especially when you have to add third-party libraries and databases too. Docker simplifies this process, virtually automating it to the point where developers just have to run a single command, and Docker will do the rest.

    This way, not only do you save a great deal of time, but it also allows you to activate new team members from the first day.

    4. Isolating Apps

    Developers tend to add new libraries, dependencies, and services to software on a daily basis. This tends to get more complex over time, which is why it’s important for you to make sure that you keep track of all parts, and above all, prevent the software from breaking.

    Docker lets you isolate apps or settings within specific containers so that they won’t affect other installations or instances of apps running on the same system.

    5. When You Want to Move Away From Amazon AMI Marketplace or the Warden Project

    There are a couple of alternatives available to Docker, including the Amazon AMI Marketplace, which is arguably the closest substitute. However, the problem with AMIs is that they run exclusively on Amazon.

    That’s not the issue with Docker, since you can run it on any Linux server, as long as it supports Docker. More importantly, Docker container services also work on Amazon EC2 (Elastic Compute Cloud).

    Another option is the Warden Project, which was written for Cloud Foundry. However, Docker again wins in this field as it contains more social options, letting developers share images with others who are on the same Docker Index.

    After Action Report — Docker Is Application Development Standard

    Docker is a fantastic choice in most cases, but it’s not always the best choice. For instance, while Docker’s a fantastic choice for web apps, it’s not viable if you’re developing a desktop application. While you can build such apps on Docker, it’s generally not the natural environment for running apps that have rich GUIs.

    All in all, Docker’s a fantastic open-source platform that greatly helps development teams streamline workflows and manage development more effectively.

    Have you worked with Docker before? What are your thoughts on it? Let’s discuss in the comments!

  • How To Optimize Laravel for Performance (8 Expert Tips)

    How To Optimize Laravel for Performance (8 Expert Tips)

    With over a million websites powered by Laravel, Google pushing the importance of website speed, and users less & less accepting of anything other than an incredibly smooth user experience – some are giving PHP & frameworks like Laravel the reputation of being less performant than other frameworks. While there very well may be truth to this, that doesn’t mean there isn’t anything you can do about it – so, in this guide, we’ll dive deep into how you can optimize Laravel for performance.

    Expert Tips on Optimizing Laravel

    This article will go over several important tips, each with step-by-step guides to optimize your Laravel website. While some of the steps may sound technical, the steps will be easy to follow and recreate on your own screen.

    Using Artisan Commands

    Although Artisan commands are commonly listed as part of the optimization tips, it’s not really a hack. Artisan is just a Laravel command line interface that helps you execute instructions through simple commands. We’ll be using a lot of these commands later on.

    Artisan Optimize Command

    A quick search online will reveal many articles recommending the use of the Artisan Optimize Command. While this used to help, with much improved PHP op-code caching it’s no longer relevant. It was deprecated in Laravel 5.5, and since 5.6 it’s been removed completely. So don’t go looking for this solution as it will no longer exist!

    Config Caching

    Any web developer today will certainly agree that caching your files is a great way to save on loading time and increase website performance. By generating a ready, easy-to-read template of your website that your servers read instead of all your web files every time someone loads your site, loading times are cut dramatically.

    The only problem with caching is that it sets your website to a semi-permanent state. If you plan on making changes anytime soon, you’ll have to undo the cache before configuring your website and then redo it when you’re done.

    Aside from that, caching with Laravel is considerably easier than other frameworks because you can do so through caching engines that don’t involve coding.

    If you’re ready to cache your website, simply type this in the Artisan command line:

    php artisan config:cache

    Remember, any changes you make on your site after this won’t have any effect because of your cache. If you want to refresh the cache config, simply type the command again. Otherwise, you can also clear the cache by typing in:

    php artisan config:clear

    There are multiple ways you can cache with Laravel, but these two basic commands are enough to get you started.

    Route Caching

    A route cache is a collection of routes around your website that helps load your pages faster. This works by avoiding the taxing and sometimes slow process of mapping your routes from scratch. With route caching, Laravel can temporarily load the routes from a pre-compiled cache instead of starting from scratch for every new user. The cache lasts only until the user exits out of your website.

    Just like config caching, any changes you make to your website after the cache will not have any effect until you update the route cache. It’s important to remember to update the cache after making any changes to your website’s structure.

    Here’s the command that you have to run to start the route cache:

    php artisan route:cache

    To clear the cache, you use a similar command:

    php artisan route:clear

    Route caching is a simple way to make your website feel snappier and load faster.

    Use Queues

    Laravel queues work like your CPU. Whenever your computer processes a task, it does so in the most efficient way possible that doesn’t degrade the quality of the user’s experience. This means that when you’re rendering a file or doing something resource intensive, your CPU makes sure that you still have processing power left for your other tasks until its limit is reached.

    The way this works is that your CPU queues tasks after each other, with no strict adherence to order. If you’re rendering a file, then opening a browser window, your CPU will insert the browser process earlier to make sure it opens without delay. Just like a CPU, Laravel can also improve web performance by offloading time-consuming processes to a queue.

    Simple examples of this are:

    • Sending emails
    • Downloading files
    • Uploading files

    These tasks don’t need to be seen by the user and can be done as a background process.

    Queues are an in-depth trick though and we, unfortunately, don’t have the space to cover it fully within this article. Instead, you can check out the official Laravel documentation for this. If you’re curious about what the basic commands look like, here are some examples from Artisan:

    php artisan queue:work
    SendEmailJob::dispatch($to, $body);
    

    Laravel also has several queue driver support documentations and offers unique solutions for each, such as Horizon, a dashboard that monitors your queue system.

    Use Eager Loading

    Eager loading is a way of coding rather than a simple command that you can run via Artisan.

    Eager loading is the process of sending a larger, nested data structure with more than enough information for the query. Although sending a larger query might require more memory or data, since the internet is already at blazing fast speeds, several more kilobytes or even megabytes will be barely noticeable for most users. These larger data queries are better for the server since it means sending one large query, rather than processing several hundred queries just to look for the user’s data.

    The opposite of this is lazy loading, which might be what your website is utilizing by default, where single items of data are retrieved individually as and when required, resulting in many more server requests. Here’s what the query for that looks like:

    $books = App\Book::all();
    Foreach ($books as $book) {
    Echo $book->author->name;}
    

    Eager loading on the other hand looks like this:

    $books = App\Book::with(‘author’)->get();
    Foreach ($books as $book) {
    Echo $book->author->name;}
    

    A simple example where this is used is in games. Most games use eager loading when preparing levels or discrete phases. Whenever you’re loading into a map, the game loads everything in advance so that you have all the assets you need — even if you don’t explore or use all the objects inside that map.

    The main downside to eager loading has always been the amount of information users would need to download or prepare to access your site. Each query would mean sending a file that’s larger than technically necessary. However, with mobile data and home Wi-Fi fast becoming near-gigabit speeds, file sizes have gone down the priority list when it comes to optimization.

    Clear Up Unused Service

    Another tip that involves how your code is clearing up any services that are unused by the user.

    It’s common to add and start a service when your website loads, but unused services can add unnecessary burdens on your system and strain your server speed. This is especially apparent when handling larger amounts of visitors. You may even have services that were utilized at the beginning of your development process but are no longer used today.

    You can open the Laravel app and go to:

    config/app.php.

    This will show a list of all the services installed on your server. Simply comment out the services that are unused.

    NOTE: be careful with the services you’re trying to disable. You may accidentally disable a service that plays a huge role in your site, causing certain parts of your website to malfunction or not start at all.

    Run tests and check the services manually on staging machines first before disabling services you aren’t sure about.

    Remove Dev Dependencies

    Dev dependencies are often injected into your system by default when installing Laravel or a composer for the first time. While these dependencies do aid in building your website, you don’t need these dependencies when your site is up and running.

    You can input this simple command through Artisan to remove those dependencies:

    composer install --prefer-dist --no-dev -o

    After running this command a package or directory will be created (possibly a zip file or similar) which you can then use to install the release. The command specifies only to retrieve and package the official distribution, without dependencies.

    NOTE: Dev dependencies are different from dependencies that are required at runtime. Don’t delete runtime dependencies as this may affect your website’s performance or even crash certain parts of your site.

    General Web Optimization Tips

    There are also several optimization hacks that you can do for your website outside of Laravel. If you’re looking to polish every aspect of your site and increase its performance and rankings on Google, then here’s what you should do next.

    Use a Fast Host

    A fast host is undeniably the first thing you should start looking at. Is your host fast enough and can it handle the number of visitors that your website is currently receiving, or which you anticipate will be visiting following your business’s growth? This is an essential question to ask at the moment with Google actively punishing websites which it deems too slow (including speed responses measured in milliseconds).

    Going for a dedicated 3rd-party host is always the best option. Shared hosts are too slow and hosting physical servers yourself is expensive and hard to scale. 3rd-party hosts on the other hand will cost you between $25 to $150 per month on average and will provide you with blazing fast speeds, secure connections, and website optimization tools.

    Minify CSS and JS Files

    Your CSS and JS files are laid out to be easily read by default. This means your files have spaces, indentations, and other formatting that make it easy to read for us. However, your website doesn’t care about these visual syntax practices and can easily read your files without them.

    Minifying your CSS and JS files means removing all of the unnecessary spaces, indentations, and other characters that take up valuable server space. Depending on the size of your website, this can make a significant difference in server response times. Just remember to keep a separate copy of the CSS and JS files that aren’t minified, in case you ever need to edit or review your code.

    This process can be carried out very quickly by using any one of the many online CSS and JS minifiers available for free.

    Compress Your Images

    Images are one of the biggest performance leaks in websites that aren’t optimized. This is especially true for those who upload 1920×1080 images only display it in a 540×300 format. It may be that you upload an image at the largest size you think you’ll ever need, and then just have it rendered down to the actual size in the browser, but this is hugely damaging to response times, and having multiple image files set at all of the needed resolutions is far better.

    Compressing your images will not only reduce the sizes of your image files by more than half, it will also retain the quality pretty well. Typically, you’ll have to compress the images before uploading them to your website, but there are several plug-ins and online services that will compress all the images on your site for you. From our experience, a lot of these will need to be paid for.

    As either an alternative or additional solution we often recommend clients use a CDN (Content Delivery Network) which helps boost server response times too.

    Reduce the Number of HTTP Requests

    Another major performance issue is when websites make multiple HTTP requests from the server whenever a visitor loads a web page. Typically this can involve many separate calls from JavaScript files, CSS files, and images.

    HTTP requests are basically your computer asking your website for information. Each block of information, whether that’s an image, a link, or any kind of content, will require its own separate HTTP request. Larger files will mean longer request times and many files will mean more HTTP requests.

    To find out the number of HTTP requests your website needs, you can use Google Chrome’s Network panel. You should ideally aim for a number between 10 to 30 files per page. For reference, the average number of requests is typically around 60 to 75 requests.

    With Laravel, you can reduce the number of individual HTTP requests easily by using the CodeSleeve/asset-pipeline. What this will do is to combine all of your separate assets (such as JavaScript files and CSS scripts) and combine them all into one single file. This reduces the HTTP requests down to one. Not only that, but it will also minify the code (something we mentioned earlier), which will help speed up the page loading time dramatically.

    Use a CDN (Content Delivery Network)

    If your website is hosted in the US, then it may be that visitors from across most of the US will benefit from good response times, but potentially there can be significant delays for those accessing your site from other areas around the world.

    One solution to this is to use a Content Delivery Service (CDN). These provide a cached version of either your whole site, part of your site, or assets such as images/videos/audio files on various alternate servers around the world.

    When a visitor’s browser requests to load a page from your site, the CDN determines their geographic location, and serves them the page, or assets, from the server that is located closest to them, or which provides the fastest response times.

    Getting a CDN used to mean subscribing to another 3rd-party CDN service. However, most 3rd-party website hosts already offer CDNs as part of their basic packages. To reduce the number of payments and have your website set up more conveniently, we recommend looking for a host with CDN features instead of finding a 3rd-party CDN service.

    Conclusion – Optimize Laravel for Performance

    Laravel has made its name around the web-development scene because of how easy it is to use. It’s straightforward and is fast by default. However, Laravel isn’t immune to bloat and can benefit a great deal from general maintenance and optimization tips.

    By using any of the top optimization tips we’ve included here you can combine the fantastic advantages of Laravel with the ever-growing need to keep your website fast and responsive, keeping Google (and your website visitors & users!) very happy. Do you have any specific questions about Laravel? Or think we’ve missed a top optimization tip? Join the conversation by leaving a comment below. 💬

  • What is Docker And How Does it Work

    What is Docker And How Does it Work

    Software development is a process that evolves every year, but very few things in the industry have become the standard, like Docker.

    Since 2013 when it was publicly released, Docker has been used for developing, shipping, and running applications. To this day, it’s a vital part of software development that many experienced developers use.

    In this article, we’ll be covering what exactly Docker is, the advantages, and disadvantages of using it, and how it actually works.

    What is Docker?

    docker homepage

    Docker is an open-source containerization platform that develops, ships, and runs apps separate from your local or host infrastructure. It’s a platform that creates and manages containers that are isolated from one another but can communicate with each other through defined channels.

    The reason why Docker is a popular PaaS is because of the concept of containers, where they use fewer resources than VMs.

    What Are Containers and What Do They Solve?

    Before we elaborate on what Docker does, let’s first understand its components.

    All apps and programs are developed to run in specific environments. These environments either have the libraries or tools required by the app or run the software version that the app is compatible to run on.

    Containers are such environments and include all of the libraries and tools for apps to run in. What a container does is pack these apps inside containers together with the app’s libraries and tools so that it can run anywhere without having to rely on the host’s environment.

    Here’s a simple analogy:

    IKEA sells furniture that requires self-assembly. But, how do they know that all their customers have the tools to assemble their furniture? They don’t. IKEA ships the tools together with the furniture so any customer in the world can set it up the moment the IKEA package arrives on their doorstep.

    This is essentially how containers work, making developing and shipping software easier. By including all the tools necessary in the container environment, developers no longer have to worry about incompatibility issues with different servers or hosts. Another term that’s often thrown around with containers is microservices.

    What Does Docker Do?

    Docker is simply a platform that manages these containers so that you can build different, specific environments easily.

    The Docker platform lets developers and programmers use containers seamlessly throughout their workspace. Whether you’re an in-house or remote team with members around the world, using Docker to ship and run your containers is a low-cost way of building software more efficiently.

    But there are many more benefits to using Docker aside from convenience. We’ll talk more about how containerization is faster, more secure, and better suited for scaling, later on in this article.

    What Does Docker Solve?

    Docker solves the problem of creating containers yourself and managing them across an entire team. This becomes especially important when you want to optimize the workflow of your development process.

    The Advantages and Disadvantages of Using Docker

    Aside from just the managerial side, Docker also solves numerous other complex, arduous problems.

    Here are the key advantages of using Docker

    • Reliability. Containerization with Docker ensures that your apps will run virtually anywhere that has Docker installed. You don’t have to worry about having incompatible versions or manually installing dependencies.
    • Efficiency. A huge bottleneck in software development is when apps or software break down in computers without their environment. By using containers, you can get rid of these bottlenecks and streamline workflow to focus on developing software and not getting sidetracked by installing dependencies.
    • Scalability. Having the option to quickly create new containers and deploy them allows for faster patches or updates to your software. Unlike monolithic programming which typically means building into existing code and then restarting it to update the program, containers let you build on top of each other independently. This means that you can add and remove containers without damaging other containers and their functionality, making it easier to scale your software.
    • Accessible. The routine check-up and optimization process of software maintenance is also easier with containers. Since containers work independently from each other, you can configure, update, and then deploy a container without having to shut down or disturb other containers. This makes containers easily accessible.
    • Lightweight. Containers are a lightweight alternative to virtual machines that need operating systems to function. Containers avoid the need to do this by sharing the host’s resources, like RAM and CPU, instead of virtual machines that require dedicated resources even if unused.
    • Version-freedom. Since containers are isolated from each other, you can run a container with the latest version of JavaScript while another container runs an older version. There’s no perfect version for every language and programmers are more familiar with some versions than others. Having the creative freedom to use any version without damaging other lines of code through containers makes your software all the more versatile.

    Nothing is perfect and Docker is far from being the one-stop solution for everything. The platform does have its own fair share of disadvantages that you should look out for.

    Disadvantages of using Docker

    • Steep Learning Curve. Although Docker is convenient and fast, there’s no denying the learning curve it takes to become proficient with the platform. You won’t be a master at using Docker overnight and you can expect your team members to have the same struggle. You’ll also have to learn about Linux if you need to conduct maintenance or customizations on your Docker Engine.
    • Platform to platform communication. Although containers talk to each other seamlessly, the companies that work in this space don’t always see eye to eye. Rival container companies don’t often work with each other, which can be a deal-breaker if you want to expand the tech you’re using.
    • Temporary containers. Once a container’s use is finished, such as when it finishes a process and is no longer used, the container shuts down together with all the data it processed. The data isn’t saved unless you use Volumes to store your data to the Docker Engine. This isn’t necessarily a bad thing, but it’s something noteworthy for the development process of your software. Docker has no automated solution for this yet.
    • Command line interface. Docker’s interface is similar to a command line, making it a bad choice for running apps that require a graphical interface. It’s mainly optimized for apps and programs that are run through commands on a terminal.

    Lastly, a common problem new companies face with Docker is when they try to use it without understanding how to design and orchestrate development architecture first. Docker isn’t meant to be a one-size-fits-all platform and some programs are just better off without it.

    How Docker Works

    Docker works on a client-server basis. The Docker client, which is what you see, talks to the Docker daemon which takes care of executing and managing tasks.

    Docker’s Core Components and Architecture

    Beneath all that, there are more features from Docker that serve different functions. For today, we’ll only be focusing on Docker’s four core components.

    Docker Client

    The Docker client is the interface between you and the Docker daemon. This is where you’ll be inputting your commands, running programs, and mainly interacting with Docker.

    Docker Daemon

    The daemon is what manages everything on your Docker platform, whether it’s images, containers, volumes, or networks. In simpler terms, this is the mastermind behind your entire Docker operation. All the commands you send through the client are processed by the daemon and managed by it. Daemons can also connect with daemons from other servers.

    Docker Registries

    The Docker registry is an open-source system where you can store and download Docker images. You can even set up a private registry in your workspace that’s shared with your colleagues.

    Docker Images

    Docker images are read-only files with instructions for creating Docker containers. In simpler terms, it’s like a blueprint that tells the Docker daemon what environment to run. This is part of what makes container creation much easier and faster. Combined with the Docker registry, you can find presets of images that are publicly available or even create custom ones for your workspace that your colleagues can use.

    Docker or Kubernetes

    A question that’s often asked by newcomers to Docker and containerization is “What’s better, Docker or Kubernetes?”

    The answer to that is surprisingly simple: both.

    What is Kubernetes?

    kubernetes homepage

    Kubernetes is a system developed by Google to manage deployment automation and containerized services. It’s built to handle and manage containers in the hundreds or thousands, and to optimize how these containers work with each other. Kubernetes does this through nodes that are built for special functions.

    These nodes can be categorized into two things: workhorse nodes and head nodes. Workhorse nodes are responsible for anything computational and do all the heavy lifting. This requires more resources than the head nodes. On the other hand, head nodes are responsible for assigning tasks and receiving the final outputs.

    In short, Kubernetes is made to manage and optimize the entire workflow of containers with each other, and this makes it very different from Docker.

    What’s the Difference Between Docker and Kubernetes?

    Docker is a containerization platform that builds, ships, and runs containers. It’s a platform that lets you build containers just as easily as you can deploy them.

    In contrast, Kubernetes shines more on container management and efficiency. It handles lots of containers and optimizes them to work faster through nodes.

    After Action Report – Should You Use Docker?

    So, should you use Docker for your software? Well, it depends.

    Related: When And Why To Use Docker

    Docker generally has the highest impact on your development process if you need to port your environment often. The next biggest consideration for using Docker is if you’re working with large teams that have to continually test your apps back and forth. Teams that work between developers and operations managers who need to run apps on different computers would find Docker a lifesaver.

  • How To Fix The WordPress HTTP 500 Internal Server Error (Easy)

    How To Fix The WordPress HTTP 500 Internal Server Error (Easy)

    WordPress website errors can be annoying to deal with. There’s never a one-stop solution for these problems, and a vast range of causes, from themes and plugins, causing compatibility issues, to out-of-date software and even web hosting problems.

    A WordPress HTTP 500 server error is something no web developer wants to see. It can damage the rankings of your website and decrease user experience if left unattended for too long. Google is quite particular about broken links and the HTTP 500 error is counted as such.

    In this article, we’ll be going over everything you need to know about the 500 server error. We’ll talk about why it happens, the general and technical solutions you can do to fix it, and how you can avoid this error in the future.

    Let’s start troubleshooting.

    What Is WordPress HTTP 500 Internal Server Error?

    The HTTP 500 server error is when your page doesn’t load or can’t be accessible. It’s a generic error response that means the server couldn’t fulfill your request. There are multiple variations of the error. Here are some common examples:

    • 500 Internal Server Error
    • Temporary Error (500)
    • The website cannot display the page – HTTP 500

    As long as there’s a “500” attached, you can safely consider it an HTTP 500 error and the steps below should resolve this issue for you.

    What Causes HTTP 500 Internal Server Error?

    This internal server error can be caused by a lot of things, usually server and file-related cases. Example causes for this are:

    • Corrupt or badly installed WordPress theme
    • Incompatible or compromised plugins
    • PHP version incompatibility
    • Corrupt .htaccess file
    • Problem with your host server

    Thankfully, you can fix most of this yourself, but it’s always a good idea to consult with your web host from the start, just to make sure that issue is not on their end.

    General Fixes (Try These First)

    These general fixes are steps you can do that don’t involve configuring your WordPress website and changing the settings. The steps below are simple to do and are great to get out of the way before you start going into the more technical fixes below.

    Open page on a different browser or use Incognito mode

    Try opening your page or website on a different browser or by using incognito mode. Using a different browser would be best here. Better yet, try opening your webpage with someone else’s computer.

    If your website or page opens on your 2nd browser or elsewhere, then the problem might have to do with the caching or cookies of your 1st or default browser.

    Clear browser cache and delete cookies

    Browser caching stores useful webpage data in local storage, so that when you revisit that site, your local cache can load the site from there. This is especially useful since most websites don’t make huge changes and caching makes things faster for you. Unfortunately, if something does change, there’s a chance that the old information your browser is storing might cause an error on your side.

    NOTE: Clearing your browser cache and cookies will completely log you out of all the websites. Only go through this step if you can open your page on another browser or another computer.

    Clearing your browser cache and cookies will fix this problem, by loading the webpage from scratch. Now, the process for clearing cache and cookies is somewhat different for all browsers, so we’ll only cover the steps for Google Chrome since that’s the most used browser.

    1. On your Google Chrome browser, click on the top-right icon with the three dots (⋮).
    2. From there, click on More tools and go to Clear browsing data.
    3. You can choose a time range, but generally, we’d go with All time.
    4. After that, check the boxes for:
      • “Cookies and other site data”
      • “Cached images and files”
    5. Click on Clear data.

    Once you’re through with that, try loading your website now and see if you still get the HTTP 500 Error.

    Flush your DNS

    A Domain Name System or DNS is like the internet’s translator between you and servers online. Your DNS stores IP addresses that you’ve been to just like a cache system. So, when you search for sites like RunCloud.io or Facebook.com, your browser can just get the IP address from the DNS instead of searching for that IP through the internet.

    If an IP address changes or the DNS is compromised, it will result in providing an IP address that doesn’t work. Flushing a DNS is another way of clearing the DNS cache, so you can update and resolve connectivity issues like the HTTP 500 Error.

    1. Close your browsers first.
    2. Next, press the Windows + R keys to open the Run dialog box.
    3. Type in ‘cmd’ and press Enter.
    4. On the command prompt, type in command ‘ipconfig /flushdns’ and press Enter.

    For Mac users, here’s your step-by-step process:

    1. Open up Spotlight by pressing Command + Space.
    2. Type in ‘Terminal’ and press Enter.
    3. Copy-paste the following command into the Terminal: sudo dscacheutil -flushcache;sudo killall -HUP mDNSResponder and hit Enter.
    4. You’ll be asked to enter your Mac password. This is normal, the Terminal is just asking for verification.

    There’s no success or ‘operation complete’ message from Terminal when you’re done flushing your DNS, so don’t wait for one. Once you’ve completed the steps below, reload your browser and see if it fixed the issue. If the 500 Error is still there, let’s start with the more technical fixes below.

    How to Fix The HTTP 500 Error – Technical Fixes

    Contact Your Host

    Before we proceed, contact your host and ask their support team for help first. Although there’s a good chance that the problem is with your WordPress files, having your support ticket pending as early as now will help you get a reply while you tinker with the fixes below.

    Besides, there’s a good chance that your host’s support team can help you with the technical solutions anyway.

    PHP Version Incompatible

    Another reason you have this problem might be because of different PHP versions. Some hosts automatically update their PHP versions, which can result in errors if your WordPress theme or plugin is outdated. For this problem, you’ll want to talk to your host first and include this query in your ticket request.

    Backup Your Website

    Backup your website first. While the steps below shouldn’t compromise your site, it’s always better to be safe and have a backup. Depending on your provider, you may already have a daily backup that you can just fall onto if you need it.

    Otherwise, you can backup your site using a backup plugin. Here are a couple you can use:

    Learn more about performing website backups the right way in our complete guide.

    Corrupt .htaccess File

    A corrupt .htaccess file is one of the common reasons why the HTTP 500 Error happens.

    The .htaccess file controls many of your website’s configurations, including URL redirects and loading custom error pages. It’s like the directory and navigation system of your site. Getting this file corrupted can result in HTTP 500 Errors, among many other possible problems like 404 messages.

    NOTE: configuring your .htaccess file can be difficult for beginners and you may do more harm than good to your site if you mess with the file’s settings. In this fix, we’ll only be disabling the current .htaccess file so your website can make a new one. Ideally with no errors.

    1. Connect FileZilla or SFTP of choice to your website.
    2. Go to the directory that stores folders like wp-admin and wp-content, then look for the .htaccess file.
    3. When you find it, right-click the file and rename it to ‘.htaccess-old’.
    4. Refresh your website and check if the error message is gone.

    If the error is fixed, then your old .htaccess file is corrupt and producing the error. Here’s how you can create a new .htaccess file:

    1. Open the WordPress dashboard and go to Settings.
    2. After that, look for Permalinks and open that menu.
    3. Create a new .htaccess file and configure it as Plain.
    4. Click on Save Changes.
    5. Change the permalink structure to whatever works for you and click on Save Changes when you’re done.

    That should recreate a new .htaccess file for you. Reload your website and see if it fixes the issue.

    Check Your Plugins

    Did you recently install a new plugin or update a plugin’s configuration settings?

    Plugins are a great way to elevate your site, but they can be an arrow to the knee when you have too many. They may conflict with each other or be outdated from lack of maintenance. Either way, checking your plugins is a great place to begin. Start by deactivating the most recent plugin you installed and then check your website for the error. Here’s how you can do that:

    1. Open your WordPress admin panel. The URL for that is www.sample.com/wp-admin but replace ‘sample’ with your website name.
    2. From there, go to Plugins.
    3. With all your plugins listed out, look for the most recent plugin you installed and disable that.
    4. Open your website on another tab and see if it fixed the HTTP 500 Error.
    5. Repeat this until you’ve gone through most, if not all, of the plugins.

    If the error still persists, it’s safe to assume that it isn’t because of your plugins. You can reactivate them all again.

    On the other hand, if the problem is fixed and the error disappears by disabling a plugin, activate all your other plugins one-by-one until the error pops back up. The remaining disabled plugins should be the main culprits. To fix that, you can either update the plugins or replace them with an alternative.

    If updating the plugin doesn’t solve your problem, try Googling your current case. Chances are that other WordPress users have also come across your problem and may have the solution.

    Reinstall or Switch Your Themes

    Are you using a new theme or is your theme outdated?

    A new theme can break pages in a site, especially if it isn’t installed properly. Before you reinstall your theme, try switching to your old theme or with a default WordPress theme like Twenty Sixteen. Does the HTTP 500 Error still occur? If yes, then the new theme might be the problem. If not, we advise you to move to the next solution.

    Now, changing your theme can be risky if you’re inexperienced. Issues like incomplete theme files, installing the wrong version of a theme, and more can occur and possibly increase your problems. We suggest only doing this if you’re either familiar with manipulating WordPress files already or have a backup of your website that you can simply restore.

    Here’s the step-by-step guide on how to do that:

    1. Connect FileZilla or your SFTP of choice to your site.
    2. Look for your wp-content folder and then go to themes.
    3. Find the folder with the theme you’re currently using and rename the theme folder into ‘themename-oldver’. Adding ‘-oldver’ will help you identify your old theme from your new one.
    4. Now, install a fresh copy of your theme like you normally would.

    Alternatively, some drag-and-drop builders like Themify and Elementor allow you to easily re-install themes from the WordPress dashboard. The steps for these differ from builder to builder, but try looking for your theme and go over the options. The re-install button should be there.

    Once done, the fresh theme should retain all your settings and personalizations. Verify if everything works correctly and open the problematic pages that had the HTTP 500 Error. If the problem is fixed, then your old theme probably has an issue. You don’t have to delete your theme’s old copy. Keep it there just in case, you can even change the label and add a date to it.

    Check File Permissions and Make Sure Your Account is Permitted

    File permissions determine who can read, write, and execute the files of your WordPress site. If you were setting up new permissions or creating a new type of user, the permissions file may have been mishandled.

    Although fixing the permissions is pretty straightforward, it’s a repetitive process. Here’s how you can check file permissions and then set them correctly:

    1. Open up FileZilla and connect it to your website.
    2. Look for your wp-content first and right-click the folder.
    3. Select File permissions.
    4. In the new dialogue window, you can set permissions for three types of users: Owner, Group, and Public. Here’s what they mean:
      • Owner – owner of the website
      • Group – any staff you set that can handle and access the WordPress dashboard
      • Public – anyone who opens your website.
    5. As a good rule of thumb, the Owner should have all the boxes checked, and the Group and Public are only permitted to ‘Read’. You’ll want to make sure that the page with the HTTP 500 Error has the permissions set correctly.

    The Numerical value there is typically set to ‘644’ for sets and ‘755’ for directories and executables. This could be different with your host though. So, if you’re unsure about the correct values you can wait until you contact your host’s support team or Google the numerical value of your host.

    Repeat steps 3 to 5 but with the folders and files that are having the HTTP 500 Error.

    Insufficient PHP Memory Limit

    For those of you who are experiencing the HTTP 500 Error on the WordPress admin dashboard side, then this fix might help.

    The PHP memory limit for your site is usually enough for most things, but it can sometimes hit a limit when you’re uploading files or trying to publish a new post.

    1. Open your Notepad or VS Code.
    2. Type in ‘memory=64MB’ and save the file as ‘php.ini’.
    3. Open up FileZilla and connect it to your website.
    4. Look for your wp-admin folder and upload the php.ini file there.

    Reload your WordPress admin dashboard and see if the error still persists. If increasing your PHP memory limit worked for you, then you’ll have to contact your host for some extra help.

    Again, since the PHP memory limit on your site is usually enough for regular WordPress usage, hitting the limit so frequently is still a problem. You might be running a plugin that’s inefficiently coded or have a theme function that slows down your whole site. To assess this problem, we recommend asking your host to check this for you themselves. Their support team might have a better idea of what to disable and what alternatives to use.

    Fortunately, if you’re using RunCloud – this couldn’t be easier.

    You can increase your PHP memory limit straight from your RunCloud dashboard for any of the web applications you have on a server connected to RunCloud.

    Simply navigate to your Web Application’s Settings in your and increase the value for the memory_limit there. Ensure you hit Update PHP Settings so your changes are applied. And that’s it!

    PHP memory limit

    This should resolve the issue for RunCloud users.

    Restore Your Site With a Backup

    Although this step is often cited across other sources, we don’t recommend you restoring or reinstalling your entire website through a backup. The chance of your personal WordPress files causing the HTTP 500 Error is low, while the risk of restoring your site with a backup as an inexperienced WordPress user is higher.

    Some hosts backup your WordPress site for you as part of their payment plan, so just contact their customer support team. They’ll probably fix your problem before having to restore your site to a previous backup anyway.

    Reinstall Core WordPress Files

    Core WordPress files, however, are a different matter. These WordPress files are the skeletal system of your site and any issues with the files will certainly have a significant impact on your website. Thankfully, reinstalling WordPress isn’t complicated. Here’s the simplest way to do it:

    1. Open your WordPress admin dashboard.
    2. Navigate to Updates. You’ll find it below the Home tab to the left of your screen.
    3. On the WordPress Updates page, look for and click on Re-install Now.

    WordPress will automatically start downloading on your device and will reinstall with the latest version to your site. This shouldn’t take too long since the WordPress file itself is pretty small.

    If you can’t access the WordPress admin dashboard, you can try reinstalling WordPress with your SFTP. You’ll need some sort of file archiver tool to unzip the file. If you don’t have one, you can use WinRAR.

    Before you proceed with the steps below, we recommend backing up your website just to be safe. While you’ll only be overriding your old WordPress files with new ones, backing up your site is just good practice.

    1. Open up WordPress.org and download the latest WordPress version. The button will be at the top-right corner of your screen.
    2. Once the download completes, right-click the WordPress zip and look for Extract Files…. Click on that option.
    3. A prompt will appear on your screen asking for confirmation, you can say Yes to all of them so you can start extracting the files.
    4. When the file is done extracting, you’ll find a ‘wordpress-versionxxx’ folder. Open that and delete wp-content.
    5. After that, open up FileZilla or any SFTP and connect it to your website.
    6. Copy-paste all the files from the ‘wordpress-versionxxx’ folder to your root folder. This is typically named public or public_html.
    7. FileZilla or the SFTP you’re using will open a prompt saying ‘Target file already exists’. Click on the Overwrite option and select Ok.

    Your computer should start overwriting the old WordPress files with the new ones you just downloaded. This will overwrite all the core WordPress files without touching or deleting any of your themes, plugins, and overall content.

    This should be the last fix you need to fix the HTTP 500 Error once and for all. If you’re still getting the HTTP 500 Error, make sure that you’ve contacted your host’s customer support team.

    How to Prevent the HTTP 500 Error From Happening?

    Prevention is better than a cure and that’s especially true with website errors. HTTP 500 Errors can negatively impact your website’s SEO and it may take you weeks or even months before finding these errors yourself. Here are some routine tips you can use to prevent the error from happening again.

    Update your Plugins

    Make sure that all your plugins are updated. Outdated plugins that are no longer supported by your PHP version can cause these errors, even more so if that plugin is responsible for a large portion of your site.

    Keep File Permissions Up To Date

    Whenever you create a new user or try to reconfigure your permissions, make sure that everything is in order before you close SFTP. Incorrect permissions, especially when creating new roles for your staff can create these HTTP 500 Errors.

    Use WordPress Debugging

    Still getting the error? Hopefully, your host has replied by now. This step is completely optional, but it can speed up the process of either looking for other solutions or providing your host with more information.

    The debugging feature shows you specifically where the error is coming from. This will be valuable information for your host, as well as providing you with error messages you can copy-paste in Google to hopefully find someone who’s had the same specific error as you.

    Keep in mind though that the debugging logs can be intimidating to understand if you’re new to server management. If you don’t understand the logs that come out from the debugging, at least you can present them to your host or support team to help them fix your problem.

    Here’s how you can turn debugging on.

    1. Open your Secure File Transfer Protocol (SFTP) app. If you don’t have one, the industry standard is FileZilla. Download and install the client from the link provided.
      1. To connect FileZilla to your site, open FileZilla.
      2. Click File and go to Site Manager.
      3. Enter the ftp address of your website in the Host box. Here’s what that looks like: instead of http://www.sample.com the ftp address is ftp://ftp.sample.com or ftp://sample.com.
      4. After that, just leave the Port box blank. The default value there should be 21 and you don’t need to change this unless indicated otherwise.
      5. From the Logon Type box, select Normal.
      6. Next, type in your full username in the User box. This can be a proper username or an email address, it depends on how your website was set up.
      7. Finally, enter the Password.

    FileZilla should now be connected to your website after these steps.

    1. From there, look for and open the wp-config.php file. You don’t need a code editor for this step, but you can download VS Code if you prefer the cleaner interface instead of just the default Notepad.
    2. With the wp-config.php file open, add the code below:

    define( ‘WP_DEBUG_LOG’, true);

    1. Save the .php file and reload your website.

    Any errors that come out of your site should now be logged to your debug.log file. You can find that under the /wp-content/ directory with FileZilla. Don’t forget to change the value from true to false when you’re done debugging.

    Now, just send your host the debug.log file so they can fix your issue.

    After Action Report — Fixing The WordPress HTTP 500 Error

    The WordPress HTTP 500 Error is a cumbersome problem to fix. It’s vague, which makes troubleshooting rough. We’ve arranged the steps above to go in order of importance, so hopefully, you were able to resolve this issue without having to reach the very bottom.

    Which fix worked for you? If none of them did, how did you manage to resolve this issue? Let us know in the comments below!