Blog

  • How MailHog Can Transform Your Local Email Testing Process

    How MailHog Can Transform Your Local Email Testing Process

    Email testing is an essential part of any email marketing campaign. It allows you to check the quality, functionality, and deliverability of your emails before you send them to your subscribers.

    However, email testing can also be a frustrating and time-consuming process, and this is where local email testing can help.

    Local email testing means that you send your emails from your local development environment to your own email address, or to a test email account. This way, you can see how your emails look and behave in different email clients and devices without affecting your actual subscribers – or your reputation.

    Caveats with Traditional Email Testing

    It’s important to be aware that email testing can come with some common problems or challenges, such as:

    • Spam filters: Your emails may end up in the spam folder or be blocked by the email provider due to various reasons, such as invalid sender address, poor content quality, suspicious links, etc.
    • Delay in SMTP servers: Your emails may not be sent or received at all due to the limitations or errors of the SMTP server that you use to send your emails locally. You may have to configure the SMTP settings manually or use a third-party service to send your emails.

    These problems can make email testing a tedious and unreliable process. You may waste a lot of time and effort in testing your emails locally without getting the results that you want.

    That’s why you need a better way to test your emails locally.

    That’s where MailHog comes in.

    By the end of this article, you will be able to use MailHog to test your emails locally with maximum effectiveness. This will significantly help you improve the quality, functionality, and deliverability of your emails before you send them to your subscribers.

    Are you ready to learn how to use MailHog to test your emails locally? Let’s get started!

    What is MailHog?

    MailHog is a simple and powerful tool that can transform your local email testing process. It can easily help you test your emails locally without any hassle or headache, and can help you fix the problems that you’re currently facing when testing your emails locally.

    Why use MailHog?

    Local email testing can help you improve the quality, functionality, and deliverability of your emails before you send them to your subscribers. It can also save you time and hassle in testing your emails. Here are some of the benefits of local email testing:

    • It is instantaneous: You don’t need to wait for network delays or server issues to see how your emails look and behave. You can test your emails in real time and get immediate feedback.
    • It saves email quota. Sending too many emails might reduce your spam score or trigger spam filters. By testing your emails locally, you can avoid wasting your email quota or damaging your email reputation.
    • It prevents accidentally sending to real customers if there is a bug in your code. Sometimes, you may have errors or typos in your code that could cause your emails to be sent to the wrong recipients or with the wrong content. By testing your emails locally, you can catch these mistakes before they cause any harm or embarrassment.
    • It allows you to simulate situations where the communication between your program and the email server is interrupted or degraded due to various reasons, such as network congestion, packet loss, latency, etc. These faults can cause your emails to be delayed, corrupted, or lost. By testing emails locally you can create and control these network faults and test how your program behaves under these conditions.

    Jim: The Chaos Monkey

    MailHog comes with an interesting extension, Jim – a chaos monkey. It’s a tool that simulates random failures and disruptions in your email system. This is useful for testing the resilience and reliability of your email system, as well as your ability to handle, and recover from, unexpected errors.

    By inviting Jim to your email testing, you can expose and fix any weaknesses or vulnerabilities in your email system. You can also learn how to build better automatic recovery mechanisms, and improve the quality, functionality, and deliverability of your emails.

    For example, you can test how your program handles the following scenarios:

    • Rejecting incoming connections with a certain probability
    • Disconnecting sessions randomly
    • Applying a rate limit to connections
    • Rejecting authentication attempts
    • Rejecting a sender’s or recipient’s address

    By using these tools, you can see how your program reacts to different types of network faults – and whether it can recover from them gracefully. You can also improve your error handling and logging mechanisms and make your program more robust and resilient.

    How To Use MailHog

    Here is a step-by-step guide on how to install and set up MailHog on your local machine, and configure it to capture and display the emails that you send from your application:

    1. Download MailHog from its GitHub repository. You can choose the version that suits your operating system and architecture. For example, if you are using Windows 10 64-bit, you can download the file named mailhog_windows_amd64.exe.
    2. Save the downloaded file in a folder of your choice. For example, you can create a folder named mailhog in your C:\ drive and save the file there.
    3. Open a command prompt window and navigate to the folder where you saved the MailHog file. For example, you can type cd C:\mailhog and press ‘Enter’.
    4. Run the MailHog file by typing its name and pressing ‘Enter’. For example, you can type mailhog_windows_amd64.exe and press ‘Enter’. You should see a message saying that MailHog is listening on port 1025 for SMTP and port 8025 for HTTP.
    1. Open a web browser and go to http://localhost:8025. You should see the MailHog web interface, which shows the list of emails that MailHog has captured.
    1.  Configure your application to send emails to MailHog instead of your actual SMTP server. You can do this by changing the SMTP settings in your application to use localhost as the host name and 1025 as the port number.
      You can also use any username and password for authentication, as MailHog doesn’t check them. 

    For WordPress Sites

    There are many WordPress plugins that allow you to send emails using a specific mail server. You can configure them to use MailHog to test your email. After sending the email, you can view the email in the MailHog dashboard.

    For Generic PHP Applications

    If you are using PHPMailer to send emails from your PHP application, you can use the following code snippet to send emails to MailHog server:

    <?php
    // Load PHPMailer library
    require 'PHPMailerAutoload.php';
    // Create a new PHPMailer instance
    $mail = new PHPMailer;
    // Set Mailer to use SMTP
    $mail->isSMTP();
    // Set SMTP host name
    $mail->Host = 'localhost';
    // Set SMTP port number
    $mail->Port = 1025;
    // Set SMTP username
    $mail->Username = 'anyusername';
    // Set SMTP password
    $mail->Password = 'anypassword';
    // Set email subject
    $mail->Subject = 'Test email from MailHog';
    // Set email body
    $mail->Body = 'This is a test email sent from MailHog';
    // Set email sender address
    $mail->setFrom('sender@example.com', 'Sender Name');
    // Set email recipient address
    $mail->addAddress('recipient@example.com', 'Recipient Name');
    // Send email
    if ($mail->send()) {
        echo 'Email sent successfully';
    } else {
        echo 'Email sending failed: ' . $mail->ErrorInfo;
    } ?>
    1. Test your application by sending an email from it. You should see the email appear in the MailHog web interface. You can also open the email and check its content, layout, design, attachments, links, etc.
    MailHog dashboard

    Conclusion

    MailHog is a simple and powerful tool that can transform your local email testing process. In this article we have shown how to use MailHog to test your emails locally and fix the common problems or challenges that developers face when testing emails locally, such as spam filters, email clients, SMTP servers, etc.

    If you are looking for a great cloud management platform that saves time and doesn’t require you to be a Linux expert, we recommend you check out RunCloud.

    RunCloud is a modern web server panel designed to help you manage your PHP web applications and websites.

    With RunCloud, you don’t need to be a Linux expert to build a website, and you can host it on a cloud provider of your choice such as Vultr, Linode, UpCloud, Hetzner, AWS, Google Cloud or DigitalOcean.

    Start your free trial today and see for yourself how RunCloud can make your cloud hosting experience easier and better.

  • Setting Up Local WordPress Dev in Minutes Using Laravel Valet

    Setting Up Local WordPress Dev in Minutes Using Laravel Valet

    Laravel Valet is a local development environment for Mac users who want to create WordPress sites quickly and easily. It’s a lightweight, minimalist tool that uses the built-in PHP server and Nginx to serve your WordPress sites.

    Unlike other local development tools, such as MAMP, XAMPP, or Local by Flywheel, Laravel Valet does not require you to configure a virtual host, a database, or a port for each site.

    Instead, you can simply create a new site in any directory, and link it to a custom domain name (such as .test) with one command. It also provides automatic HTTPS for your sites, so you can test them securely and avoid browser warnings.

    Some of the features and benefits of Laravel Valet are:

    • Fast and easy installation: You can install Laravel Valet with Composer and Homebrew in only a few minutes. You don’t need to download or install any bulky software or packages.
    • Automatic HTTPS: Laravel Valet uses the mkcert utility to generate and trust SSL certificates for your sites. You can access your sites with HTTPS without any configuration or hassle.
    • Custom domain names: Laravel Valet allows you to use any domain name (such as .test, .dev, or .local) for your sites. You can link any directory to a domain name with one command, and access it in the browser.
    • Multiple PHP versions: Laravel Valet lets you switch between different PHP versions (such as 7.3, 7.4, or 8.0) with just one command. This enables you to test your sites with different PHP versions without affecting other sites or settings.
    • Custom drivers: Laravel Valet supports various frameworks and applications, such as WordPress, Laravel, Symfony, Drupal, etc. You can also create your own custom drivers for any application that you want to use with Valet.

    Laravel Valet is a great tool for WordPress developers who want to work locally with speed and simplicity. It’s especially useful for developers who work on multiple WordPress sites or projects at the same time.

    In this article, we will show you how to use Laravel Valet to set up a local WordPress dev environment in only a few minutes.

    Prerequisites

    Before you can use Laravel Valet to create and run WordPress sites, you need to have the following requirements:

    • A Mac computer: Laravel Valet is only compatible with macOS. You’ll need to have a Mac computer with macOS Sierra (10.12) or higher.
    • Port 80 is free: The websites will be served port 80 of your computer. You should make sure that no other programs, such as Apache or Nginx, are binding to your local machine’s port 80.
    • Supported PHP Version: Laravel Valet requires PHP 7.3 or higher to work. You can check your PHP version by running php -v in the terminal.
    • Composer: Composer is a dependency manager for PHP. You’ll need to have Composer installed on your Mac in order to install Laravel Valet and other tools.
    • Homebrew: Homebrew is a package manager for macOS. You’ll need to have Homebrew installed on your Mac to install some of the dependencies of Laravel Valet, such as Nginx and MySQL.

    These are the main prerequisites for using Laravel Valet. If you already have them, you can proceed to the next section. If not, you can follow the links provided to install them on your Mac.

    Installing Laravel Valet

    To install Laravel Valet on your Mac, you need to follow these steps:

    • Open the terminal and run the following command to install Laravel Valet using Composer:
    composer global require laravel/valet
    • Run the following command to install and start Valet:
    valet install
    • This command will install Nginx and Dnsmasq using Homebrew, and configure your Mac to use Valet’s drivers. It will also register Valet’s daemon to launch when your system starts.
    • By default, Valet will use the .test domain for your sites. If you want to use a different domain, such as .dev or .local, you can run the following command:
    valet domain <tld-name>

    For example, if you’d like to use .app instead of .test, run valet domain app and Valet will start serving your projects at *.app automatically.

    • To check if Valet is running properly, you can run the following command:
    valet status
    • This command will show you the status of Valet’s services, such as Nginx, Dnsmasq, and PHP. You should see something like this:
    Valet services are running:
    [OK] Nginx is running
    [OK] Dnsmasq is running
    [OK] PHP 7.4 is running
    • If you see any errors or warnings, you can run the following command to restart Valet:
    valet restart

    That’s it! You have successfully installed Laravel Valet on your Mac. You are now ready to create and run WordPress sites with Valet.

    Installing WordPress

    To create a new WordPress site using Laravel Valet, you need to follow these steps:

    • Choose a directory where you want to store your WordPress site. For example, you can create a directory called wordpress in your Sites folder:
    cd ~/Sites
    mkdir wordpress
    • Go to the directory and install WordPress using WP-CLI or Composer. You can use either of them to download and install WordPress core files and dependencies. For example, you can use WP-CLI to install WordPress with the following command:
    wp core download
    • Alternatively, you can use Composer to install WordPress with the following command:
    composer create-project roots/wordpress
    • Both commands will create a wp-config.php file in your directory. You can edit this file to configure your database settings and other options. You can also use WP-CLI or Composer to install plugins, themes, and other components for your WordPress site.
    • Use Valet to link your site directory to a custom domain name. For example, if you want to use wordpress.test as your domain name, you can run the following command:
    valet link wordpress
    valet open
    • This command will create a symbolic link between your site directory and the .test domain. You can also use a different domain name if you want.
    • Access your site in the browser. You can now visit your site by typing wordpress.test in the browser. You should see the WordPress installation screen where you can enter your site title, username, password, and email address. After completing the installation, you can log in to your WordPress dashboard and start building your site.
    • Use Valet to secure your site with HTTPS. If you want to use HTTPS for your site, you can run the following command:
    valet secure wordpress
    • This command will generate and trust an SSL certificate for your site using the mkcert utility. You can then access your site with HTTPS by typing https://wordpress.test in the browser. You should see a green lock icon in the address bar indicating that your site is secure.

    You have successfully created a new WordPress site using Laravel Valet. You can now enjoy the benefits of a fast and easy local development environment for WordPress.

    Troubleshoot Common Issues

    If you encounter any problems with Valet or WordPress, you can try some of the following solutions:

    • Restart Valet by running valet restart.
    • Check the status of Valet by running valet status.
    • Check the logs of Valet by running valet logs.
    • Check the configuration of Valet by running valet config.
    • Unlink and relink your site by running valet unlink wordpress and valet link wordpress.
    • Unsecure and resecure your site by running valet unsecure wordpress and valet secure wordpress.
    • Update Valet by running composer global update.
    • Update WordPress by running wp core update or composer update.

    Final Thoughts

    In this article, we have covered how to use Laravel Valet to set up a local WordPress dev environment in minutes. Laravel Valet is a great tool for WordPress developers who want to work locally with speed and simplicity. It’s especially useful for developers who work on multiple WordPress sites or projects at the same time.

    You can start using Laravel Valet to keep your site directories organized and consistent, such as using a naming convention or a folder structure to group your sites by type, client, or status. For example, you can use clientname-projectname.test as your domain name, or create a clients folder to store all your client sites. For more information and documentation on Laravel Valet, you can visit the official documentation.

    Another quick and easy way to set up a testing environment is by creating a staging site on RunCloud. RunCloud lets you focus on your product and takes care of server management. You don’t need to be a Linux expert to host a successful website, start using RunCloud today and see for yourself.

  • How To Set Up Free Self-Hosted Mailbox Using FreeScout On Your VPS [Open Source]

    How To Set Up Free Self-Hosted Mailbox Using FreeScout On Your VPS [Open Source]

    If you’re looking for a free and open-source solution to manage your customers, you might want to check out FreeScout.

    FreeScout is a web-based customer support system that lets you manage your email conversations with your clients and customers. You can also add modules for live chat, knowledge base, reports, and more.

    The official Wiki page provides detailed instructions and tips for installing FreeScout on a fresh server. However, if you’re using RunCloud to manage your servers, this process is much simpler. You don’t need to worry about installing and configuring any server software, such as Nginx, PHP, and MySQL. You can just create a web app on RunCloud – and follow the steps in this article to install FreeScout in minutes.

    By the end of this article, you’ll have a fully functional FreeScout system that you can use to provide awesome customer service. Sounds good? Then let’s get started!

    Step 1: Create an Empty Web Application

    First, you need to create a blank web app on RunCloud. A web app is a way of telling RunCloud how to run your website. To do this, you’ll first need to log in to your RunCloud dashboard.

    On the RunCloud dashboard, you will see a button that says “Create Web Application”. Click on it, and you will see a form where you can enter some details about your web app.

    You need to enter a name for your web app, such as “FreeScout”. You also need to enter a domain name for your web app, such as “freescout.example.com”. This is the address where people can access your website. You can either use your own domain name, or get a free one from RunCloud for testing purposes.

    After you enter the name and the domain, you will see some options for the application type and the public path. These are settings that tell RunCloud how to run your web app. For now, leave them as they are and click on “Create Web Application”. RunCloud will create a blank web app for you and show you some information about it.

    Step 2: Log in via SSH

    You’ll next need to connect to your server using SSH. After logging in, the first thing you need to do is change the directory to the web app root directory. This is the folder where your web app files are stored. You can do this by typing cd <path> and pressing “Enter“, where <path> is the path to the root directory of your web application – you can get this from your RunCloud dashboard.

    Step 3: Download FreeScout

    After that, you need to download the latest version of FreeScout on your server. To download FreeScout, visit https://github.com/freescout-helpdesk/freescout/releases/latest and copy the download link for the latest release. It should look something like https://github.com/freescout-helpdesk/freescout/archive/refs/tags/1.8.86.tar.gz.

    Next, you’ll need to use wget to download the zip file to your server. To use wget, type “wget” followed by the download link and press “Enter“.

    For example:

    wget https://github.com/freescout-helpdesk/freescout/archive/refs/tags/1.8.86.tar.gz.

    Step 4: Extract the Archive

    After downloading the file, type ls and press “Enter“. This will show you a list of everything that is present in the current directory. If you followed the steps correctly, your output will look something like this:

    Next, you’ll need to extract the files from the archive file. To extract the files, type tar -xf followed by the name of the archive file, and press “Enter“.

    For example:

    tar -xf 1.8.86.tar.gz.

    This will create a folder named freescout-x.x.xx, where x.x.xx is the version number of FreeScout. Inside this folder, you will find all the files and folders that make up FreeScout.

    Step 5: Move the Contents

    Next, you should move the files from the freescout-x.x.xx folder to the root of your application. You can do this by using cp -r followed by ./freescout-x.x.xx/* and . and press “Enter“. For example, your command should look something like this:

    cp -r ./freescout-1.8.86/* .

    This will copy all the files and folders from the freescout-x.x.xx folder to the current directory. After that, you can delete the downloaded file and the freescout-x.x.xx folder because you don’t need them anymore. You can also remove the default index.html file. You can do this by using rm -rf and then the name of the file or folder, and press “Enter“.

    rm -rf freescout-1.8.86/
    rm 1.8.86.tar.gz
    rm index.html

    Step 6: Create the .env File

    The next step us to create a file named .env.example in the current directory. This file will store your FreeScout configuration settings, such as your database name and password. To create this file, run the following command: touch .env.example.

    Step 7: Update the Application Settings

    Next, you’ll need to update your web application settings. Go back to your RunCloud dashboard and click on the “Settings” tab. Under the “Stack” sub-section, you will see a option for the application type and the public path. These are settings that tell RunCloud how to run your web app.

    FreeScout uses the Laravel framework to run. The public path is the folder where your web app files are accessible from the internet. You should change the application type to Laravel and set the public path to /public.

    After you change these settings, click on “Update Stack”. RunCloud will apply the changes and restart your web app. As a result, you will see a new section of Laravel settings in the left menu.

    Next, scroll down to the PHP settings section, and look for the symlink function in the disabled functions list and delete it – make sure you delete the trailing comma as well.

    After removing the function from the disabled list, click on the “Update PHP Settings” button to save the settings.

    Step 8: Create a Database and User

    Finally, you’ll need to finish the installation by opening your web browser and going to your web app domain. You should see the FreeScout installation wizard. This is a page where you can enter some details about your FreeScout system, such as your email and password. You also need to create a database and a user for FreeScout.

    To create a database and a user, you can use RunCloud’s database manager. You can find this in the RunCloud dashboard under the “Database” tab. Follow our tutorial on creating a database to learn more.

    After creating the user, granting them access to a database, and connecting that database to your web application, go back to the FreeScout installation wizard and enter the same details that you used to create the database and the user. Make sure you have selected the MySQL option in the database connection drop-down, and leave the hostname and port as default.

    If everything is okay, you can proceed with the installation by clicking on “Install”. FreeScout will install itself on your server and then show you a success message.

    Final Thoughts

    As you can see, installing FreeScout on Ubuntu using RunCloud is easy and fast. You don’t need to be a Linux expert or spend hours configuring your server. You can leave the hard work to us and focus on your projects.

    RunCloud lets you manage your web apps with a simple and intuitive interface. You can create, deploy, and scale your web apps with just a few clicks. You can also monitor your server performance, secure your web apps, and automate your tasks with RunCloud.

    With RunCloud, you can save time, money, and hassle. You can run any web app on any cloud server provider, such as DigitalOcean, AWS, Google Cloud, and more. You can also enjoy the benefits of RunCloud’s features, such as:

    • One-click SSL certificates
    • Custom domain names
    • Automatic backups
    • Firewall and malware protection
    • Cron job scheduler
    • Git deployment
    • And more!

    Whether you’re a developer, a freelancer, or a business owner, RunCloud is the perfect solution for you. You can manage your web apps with ease and get support from our friendly team anytime you need it. Sign up for RunCloud today and see how it increases your productivity.

  • Everything You Need To Know About wp-config.php File

    Everything You Need To Know About wp-config.php File

    The wp-config file is one of the core WordPress files, which means that understanding how you can navigate it, and make subtle but essential changes, can make a massive difference to your site.

    Responsible for establishing the connections between your WordPress site and the database, the wp-config file is an essential element in determining how smoothly and error-free your site runs.

    In this article, we’ll show you how to navigate your WordPress site’s wp-config file safely, and how to make simple changes that will help improve the security and performance of your site. Let’s get started!

    What Is wp-config.php?

    The wp-config.php file is a configuration file used by WordPress to initialize various settings and options for the website. The file is typically located in the root directory of a WordPress installation and is automatically created when WordPress is first installed. Alternatively, you can create it manually by renaming the wp-config-sample.php file and editing it with your own details.

    Basic Settings in wp-config.php

    The wp-config.php file plays a crucial role in the functioning of a WordPress website, providing the base configuration details, including:

    • WordPress database connection settings: This includes the database name, username, password, and host. Without this information, your WordPress website will not work, and you will get the “error establishing database connection” error.
    • WordPress salts & keys: These are random strings of characters that are used to enhance the security of your WordPress site. They are used to encrypt information stored in cookies, such as user passwords and authentication data.
    • WordPress database table prefix: This is a prefix that is added to each table name in your WordPress database. By default, it is set to `wp_`, but you can change it to anything you want. Changing the table prefix can help prevent SQL injection attacks and conflicts with other applications that use the same database.
    • ABSPATH: This is a constant that defines the absolute path to the WordPress directory on your server. It is used by WordPress to locate files and directories.

    In addition to its core functions, the wp-config.php file also allows for advanced customization of a WordPress website. For example, it can be used to enable debugging and caching options, set up a multi-site installation, and configure environmental variables.

    Advanced Settings in wp-config.php

    The wp-config.php file also allows you to customize various aspects of your WordPress site by defining constants and variables. Some of these are optional, but some are required for certain features or functions to work properly. For example, you can:

    • Enable or disable WordPress debugging mode: This is a mode that displays errors and notices on your website for troubleshooting purposes. By default, it is disabled, but you can enable it by setting the WP_DEBUG constant to true.
    • Increase memory allocated to PHP: This allows you to increase the amount of memory that PHP can use when running your WordPress site. By default, WordPress tries to increase the memory limit to 40MB for single sites and 64MB for multisites, but this may not be enough for some plugins or themes. You can increase the memory limit by defining the WP_MEMORY_LIMIT constant.
    • Disable or enable cron jobs: Cron jobs are scheduled tasks that run at specific intervals on your WordPress site. For example, cron jobs are used to check for updates, publish scheduled posts, and send pingbacks. By default, WordPress uses a pseudo-cron system that runs when a page is loaded. You can disable this system by defining the DISABLE_WP_CRON constant as true.
    • Change file permissions: File permissions are rules that determine who can read, write, or execute files on your server. By default, WordPress uses the file permissions set by your server, but you can override them by defining constants such as FS_CHMOD_FILE, FS_CHMOD_DIR, and FS_METHOD.

    These are just some examples of what you can do with the wp-config.php file. There are many more constants and variables that you can define or modify to customize your WordPress site.

    Where To Find The wp-config.php File

    Locating the wp-config.php file in a WordPress installation is simple. Here are the steps to follow:

    1. Log in to your web hosting account and access the file manager, or use an FTP client.
    2. Locate the root directory of your WordPress installation. This is typically where you installed WordPress, such as public_html or www. RunCloud users can see the path of their web application in the RunCloud dashboard.
    3. Look for the wp-config.php file in the root directory. It should be located alongside other core WordPress files, such as wp-content and wp-includes.
    1. If you can’t find the file in the root directory, check the subdirectories. Sometimes, the wp-config.php file can be located in a subdirectory, such as /wp/.
    2. If you still can’t find the file, try searching for it using the search feature in your file manager or FTP client.

    What Happens If the wp-config.php File Is Missing

    If the wp-config.php file is missing from your WordPress directory, you won’t be able to access your WordPress site or dashboard. Instead, you will be redirected to /wp-admin/setup-config.php.

    This setup page will ask about your database connection details and other basic settings. Once you submit the form, WordPress will create a wp-config.php file for you, and install WordPress.

    Alternatively, you can manually create the wp-config.php file by copying the wp-config-sample.php file from your WordPress directory, renaming it to wp-config.php, and then editing it with your own details.

    If you want to generate nonce keys and salts, refer to our Salts and Keys section.

    Understanding the Structure and Format of the wp-config.php File

    The structure and format of the wp-config.php file are as follows:

    • PHP Tags: wp-config.php is a php file that contains PHP code which defines the configuration settings for WordPress. All PHP files start with <?php and (optionally) end with ?>.
    <?php
    // content
    ?>
    • Comments: These are lines of text that are ignored by PHP and are used for information purposes only. They start with // for single-line comments or /* */ for multi-line comments. For example:
    // MySQL settings 
    /* The name of the database for WordPress */
    • Constants: These are names that represent fixed values that can’t be changed. They’re defined using the define() function, which takes two parameters: the constant name and the constant value. The constant name is usually written in uppercase letters and underscores, and the constant value can be a string, a number, a boolean, or an array. For example:
    define( 'DB_NAME', 'database_name_here' ); // Database name
    define( 'WP_DEBUG', true ); // Debugging mode
    • Variables: These are names that represent values that can be changed. They are assigned using the = operator, and they start with a $ sign. The variable name can be any combination of letters, numbers, and underscores, and the variable value can be any data type supported by PHP. For example:
    $table_prefix = 'wp_'; // Database table prefix
    • Require statements: These are statements that include or require another PHP file to be executed. They use the require_once() function, which takes one parameter: the file path of the file to be included or required. The file path can be absolute or relative to the wp-config.php file. For example:
    require_once( ABSPATH . 'wp-settings.php' ); // WordPress settings file
    require_once( dirname( __FILE__ ) . '/local-config.php' ); // Local configuration file

    Editing The wp-config.php File

    It’s important to edit the wp-config.php carefully to avoid causing any issues. Here are the steps to do this safely:

    1. Back up your website: Before making any changes to your site, it’s essential to create a backup of your website in case something goes wrong. You can use a backup plugin or ask your hosting provider for backup options.
      If you don’t have a backup plugin installed on your site, you can simply copy the old file using the cp command and change the name, so it is abundantly clear which file is the old one, such as wp-config-BACKUP.
    1. Open the file in a text editor: After backing up the wp-config.php file, open it in a text editor, such as VS Code, Sublime Text, or nano.
    2. Make your changes: Once a file is open in a text editor, be cautious, as a small mistake can cause significant problems with your site.
    3. Save the file: Once you have made your changes, save the file and close the text editor.
    4. Test your site: After saving the changes, you should check your website to ensure it is functioning correctly. You can revert to the backup you created if there are any issues.

    It’s important to remember that even small changes to the wp-config.php file can have a significant impact on your website, so be careful when making edits. If you’re not familiar with editing files, or are unsure about a change, it’s best to consult a developer or seek support from your hosting provider.

    General Settings in wp-config.php File

    Here are the most important settings that should be configured in the wp-config.php file relating to the functionality and security of your site:

    Database Connection Settings

    These settings define the connection to your database, and store information such as the database name, username, password, and host.

    The database connection settings must match the information for your database, or you will receive an error message when trying to access your site.

    You can define these settings as follows:

    editing wp-config.php file

    Security Keys and Salts

    These keys are random strings of data that enhance the security of your site by adding an extra layer of protection against hacking attempts. They are used to encrypt information stored in cookies, such as user passwords and authentication data.

    By changing these keys and salts periodically, you can invalidate any existing cookies and force users to log in again. This can help prevent cookie hijacking attacks and improve security.

    salts in wp-config.php file

    You can generate new security keys and salts in several different ways:

    • By visiting https://api.wordpress.org/secret-key/1.1/salt/ and copying the generated keys and salts. Then, you can paste them into your wp-config.php file, replacing the existing ones.
    • You can also use a WP CLI command to generate new security keys and salts without visiting any website. To do so, you need to:
      • Connect to your server via SSH or use a control panel.
      • Navigate to your WordPress installation directory with cd /path/to/wordpress.
      • Run the following command: wp config shuffle-salts.
    • You can also use a plugin to generate new security keys and salts without editing any file. One such plugin is Salt Shaker, which allows you to either change the keys and salts manually, or automatically on a schedule.

    WP_CACHE Setting

    This setting controls whether caching is enabled in WordPress. Caching can improve the performance of a WordPress site by storing frequently accessed data in a cache memory, which is significantly faster than re-processing it every time the page is loaded.

    However, caching can also serve stale or outdated data, which can lead to an inconsistent user experience. Therefore, you should set this value carefully depending on your content and caching plugin. Read our deep dive on WordPress object caching to learn more. 

    By default, WP_CACHE is not defined, which means caching is disabled in WordPress. You can set it to true to enable caching in WordPress, which will use the caching plugin that you have installed and activated on your site.

    define( 'WP_CACHE', true ); // Enable caching in WordPress

    File Permissions Setting

    This flag determines how WordPress interacts with the file system of your web server. The file system is where your WordPress files and folders are stored and accessed.

    The default value of FS_METHOD is “direct”, which means WordPress accesses the file system directly without using any protocol.

    This is usually sufficient for most hosting environments, but in some cases, you may need to change this value to resolve file permission issues. The possible values of FS_METHOD are:

    • direct: WordPress accesses the file system directly
    • ssh2: WordPress uses the Secure Shell (SSH) protocol to access the file system
    • ftpext: WordPress uses the File Transfer Protocol (FTP) to access the file system
    • ftpsockets: WordPress uses the FTP Secure (FTPS) protocol to access the file system

    For example, you can define this setting as follows:

    define( 'FS_METHOD', 'ssh2' ); // Use SSH to access the file system

    Multi-site Setup

    A multi-site installation allows you to create a network of multiple sites using a single WordPress installation. This can be useful if you want to run multiple websites with different themes and plugins, or if you want to manage multiple sites from a single dashboard. You can read more about WordPress multisite in our blog post.

    You can enable multi-site by defining the WP_ALLOW_MULTISITE constant in your wp-config.php file. By default, this flag is not defined, which means multi-site functionality is disabled in WordPress. You can define this setting as follows:

    define( 'WP_ALLOW_MULTISITE', true ); // Enable multi-site functionality in WordPress

    After defining this setting, you need to log in to your WordPress dashboard and navigate to the “Tools” menu. You should see the “NetworkSetup” option, which will guide you through the process of creating and configuring your network of sites.

    Disabling Automatic Updates

    You can edit your wp-config.php file to disable automatic updates for WordPress core releases, translations, themes, and plugins. While these updates can help keep your site secure and up-to-date, they can also cause compatibility issues – or break your site if something goes wrong.

    Moreover, if you have customized your themes or plugins, automatic updates can overwrite your changes and erase your work.

    // Disable all automatic updates
    define( 'AUTOMATIC_UPDATER_DISABLED', true );
    // Disable automatic updates for core
    define( 'WP_AUTO_UPDATE_CORE', false );
    // Disable automatic updates for themes
    add_filter( 'auto_update_theme', '__return_false' );
    // Disable automatic updates for plugins
    add_filter( 'auto_update_plugin', '__return_false' );

    These lines will disable all types of automatic updates for your WordPress site. If you want to enable only specific types of automatic updates, you can modify the corresponding lines. For example, if you want to enable automatic updates for minor core releases only, you can change WP_AUTO_UPDATE_CORE to minor.

    Reading Environmental Variables

    Environmental variables are a way to store configuration data that can be easily managed and changed without affecting the codebase. This is particularly useful in WordPress, where you might want to use different settings in different environments.

    These variables are set outside of the WordPress code, usually in the server configuration or the .env file – very different from WordPress constants. WordPress constants are defined inside the WordPress code, usually in the wp-config.php file or a custom plugin.

    Environment variables can be different for different environments (such as development, staging, or production), while WordPress constants are usually the same for all environments (unless they are conditionally defined).

    One reason why someone would load their database credentials from environment variables is to keep them secure and out of the version control system. This way, they can avoid exposing sensitive information to unauthorized users or hackers.

    Another reason is to make it easier to switch between different environments without having to edit either the wp-config.php file or the database.

    For example, if you use a .env file for storing your database credentials, you can simply change the values in that file when you move your site from development to production, without affecting the rest of your WordPress code.

    To retrieve the environmental variables in wp-config.php, you can use the PHP function getenv(). For example, if you have an environmental variable named “DB_PASSWORD”, you can retrieve it in wp-config.php using the following code in wp-config.php:

    define( 'DB_PASSWORD', getenv('DB_PASSWORD'));

    It’s essential to remember that environmental variables should be stored securely, and never included in either version control or shared publicly, as they often contain sensitive information.

    Configure WordPress Environment

    The WP_ENVIRONMENT_TYPE variable controls the environment type for a WordPress site. The possible values are local, development, staging, and production. The value of the environment type can affect how WordPress behaves, and how plugins and themes handle specific functionality.

    There are two ways to set the WP_ENVIRONMENT_TYPE variable for your WordPress site:

    • Using a PHP environment variable: This can be done using various methods, depending on your server configuration and hosting provider.
    • Using a WordPress constant: To do this, you need to add the following line to your wp-config.php file:
    define( 'WP_ENVIRONMENT_TYPE', 'production' );

    Once you have set the WP_ENVIRONMENT_TYPE variable for your WordPress site, you can use it in various ways to customize and optimize your site’s behavior and functionality. For example, you can use it to enable or disable debugging features, automatic updates, caching, specific plugins or themes, and more.

    To use the WP_ENVIRONMENT_TYPE variable in your code, you can use the wp_get_environment_type() function, which returns the current environment type as a string. For example, you can write something like this:

    switch ( wp_get_environment_type() ) {
    case 'local':
    // do something for local sites
    break;
    case 'development':
    // do something for development sites
    break;
    case 'staging':
    // do something for staging sites
    break;
    case 'production':
    default:
    // do something for production sites or any other sites
    break;
    }

    This way, you can conditionally execute different code blocks depending on the environment type of your WordPress site.

    Modify the Location of WordPress Folders

    Change the content folder

    WordPress stores all your themes, plugins, uploads, and other files in the wp-content folder by default. You can change this folder name and location by defining the WP_CONTENT_DIR and WP_CONTENT_URL constants in your wp-config.php file. Here is an example:

    define( 'WP_CONTENT_DIR', $_SERVER['DOCUMENT_ROOT'] . '/assets' ); // Change content folder name and location
    define( 'WP_CONTENT_URL', 'https://example.com/assets' ); // Change content folder URL

    Change the plugins folder

    WordPress stores all your plugins in the wp-content/plugins folder by default. You can change this folder name and location by defining the WP_PLUGIN_DIR and WP_PLUGIN_URL constants in your wp-config.php file.

    define( 'WP_PLUGIN_DIR', $_SERVER['DOCUMENT_ROOT'] . '/assets/extensions' ); // Change plugins folder name and location
    define( 'WP_PLUGIN_URL', 'https://example.com/assets/extensions' ); // Change plugins folder URL

    Change the uploads folder

    WordPress stores all your media files in the wp-content/uploads folder by default. You can change this folder name and location by defining the UPLOADS constant in your wp-config.php file. For example, to rename the uploads folder to ‘media’ and move it to the assets folder, you can add this line:

    define( 'UPLOADS', 'assets/media' ); // Change uploads folder name and location

    Set a Custom Default Theme

    WordPress uses the latest default theme (such as Twenty Twenty-One) as the fallback theme when no other theme is available or active. You can define a custom default theme by using the WP_DEFAULT_THEME constant in your wp-config.php file. For example, to use a theme named ‘MyTheme’ as the default theme, you can add this line:

    define( 'WP_DEFAULT_THEME', 'mytheme' ); // Use MyTheme as the default theme

    Configuring Developer Settings

    The wp-config.php file also allows you to configure some developer settings that can help you debug and optimize your WordPress site. Some of the most useful developer settings are:

    Enabling Debugging

    You can turn on the WP_DEBUG constant to display PHP errors and notices on your site. This can help you identify and fix any coding issues or compatibility problems.

    By default, WP_DEBUG is set to false, which means the debugging mode is off. You can set it to true in order to turn on debugging mode. This will log errors and warnings to a file, and display them on your site.

    You can also set WP_DEBUG_LOG to true to specify that debugging information should be logged to a file, and set WP_DEBUG_DISPLAY to false to hide debugging information from being displayed on your site. For example, you can define these flags as follows:

    define( 'WP_DEBUG', true ); // Turn on debugging mode in WordPress
    define( 'WP_DEBUG_LOG', true ); // Log debugging information to a file
    define( 'WP_DEBUG_DISPLAY', false ); // Hide debugging information from being displayed on the site
    define('SCRIPT_DEBUG', true); //loads the development (non-minified) versions of all scripts and CSS, and disables compression and concatenation.

    Controlling Script Concatenation and Minification

    WordPress concatenates (combines) and minifies (reduces) some of its core scripts and stylesheets to improve performance and reduce HTTP requests. However, this can sometimes cause issues with some plugins or themes that rely on specific scripts or styles. You can disable script concatenation and minification by adding the following line to your wp-config.php file:

    define( 'CONCATENATE_SCRIPTS', true );
    define('COMPRESS_SCRIPTS', true);
    define('COMPRESS_CSS', true);
    define('ENFORCE_GZIP', true); //forces gzip for compression instead of deflate

    Logging SQL queries

    WordPress uses SQL queries to interact with the database and fetch data for your site. Sometimes, you may want to see what queries are being executed and how long they take. This can help you troubleshoot any database issues or optimize your site for speed. You can log SQL queries by adding the following lines to your wp-config.php file:

    define( 'SAVEQUERIES', true );
    global $wpdb;
    print_r( $wpdb->queries );

    Use Different Table Names for Users and Usermeta Tables

    Change the users table name

    WordPress uses the wp_users table to store user information by default. You can change this table name by defining the CUSTOM_USER_TABLE constant in your wp-config.php file. For example, to use a table named my_users instead of wp_users, you can add this line:

    define( 'CUSTOM_USER_TABLE', $table_prefix . 'my_users' ); // Use my_users instead of wp_users

    Change the usermeta table name

    WordPress uses the wp_usermeta table to store user metadata by default. You can change this table name by defining the CUSTOM_USER_META_TABLE constant in your wp-config.php file. For example, to use a table named my_usermeta instead of wp_usermeta, you can add this line:

    define( 'CUSTOM_USER_META_TABLE', $table_prefix . 'my_usermeta' ); // Use my_usermeta instead of wp_usermeta

    Repairing and Optimizing The Database

    Sometimes, your WordPress database may get corrupted or damaged due to various reasons, such as server errors, hacking attempts, plugin conflicts, or power failures. This can cause your site to malfunction or display errors.

    To fix your database, you can use the WP_ALLOW_REPAIR constant in your wp-config.php file. This will enable a database repair and optimization feature that you can access by visiting this URL: https://example.com/wp-admin/maint/repair.php

    To enable this feature, add the following line to your wp-config.php file:

    define( 'WP_ALLOW_REPAIR', true );

    After visiting the URL, you can choose to either repair your database, or repair and optimize your database.

    Once the process is complete, you should remove the WP_ALLOW_REPAIR line from your wp-config.php file to prevent anyone else from accessing the feature.

    Disabling Table Updates

    WordPress updates its database tables whenever a new version of WordPress is released, or when a plugin or theme requires a database change. This ensures that your site is compatible with the latest features and security patches.

    However, sometimes you may want to disable table updates for various reasons, such as:

    • You have a large site with many tables, and updating them may take a long time or cause downtime.
    • You have a staging or development site that mirrors your live site and you don’t want to update the tables until you are ready to deploy the changes.
    • You have a specific scenario where updating the tables may break something on your site, or cause conflicts with other plugins or themes.

    To disable table updates, you can add the following line to your wp-config.php file:

    define( 'DO_NOT_UPGRADE_GLOBAL_TABLES', true );

    This will prevent WordPress from updating any of the global tables, such as wp_users, wp_usermeta, wp_blogs, etc. However, this may also prevent some plugins or themes from working properly, so use this option with caution – and only when necessary.

    Database Collation

    WordPress does not create the database on installation. This is important to know because all tables within a database will inherit their charset and collation from the database setting. So you should ensure that the database’s charset and collation is properly set before WordPress is installed.

    The default charset is ‘utf8’ and its collation is ‘utf8_general_ci’, which means case-insensitive comparison using the general rules of Unicode.

    To change the database collation in wp-config.php you can simply modify the value of the DB_COLLATE constant to match your desired collation. For example, if you want to use ‘utf8mb4_unicode_ci’, you can write:

    define( 'DB_COLLATE', 'utf8mb4_unicode_ci' );

    Security and Performance

    The wp-config.php file is not only a configuration file, but also a security file. It contains sensitive information that can compromise your WordPress site if exposed to unauthorized users or malicious attacks. Therefore, it is essential to protect the wp-config.php file from visitors and hackers, and to optimize it for better security and performance.

    Protecting Access to wp-config.php by Visitors

    If an attacker gains access to this file, they can compromise your site and database. Therefore, you need to protect the wp-config.php file from visitors by using one of the following methods:

    • Moving the wp-config.php file: One of the simplest ways to protect the wp-config.php file from visitors is to move it to a higher level, outside the public directory of your WordPress installation. This way, the file will not be accessible via a web browser, and only WordPress will be able to locate it. WordPress will automatically look for the file in the parent directory if it is not found in the root directory.
    • Block access to the file: Another way to protect the wp-config.php file from visitors is to use directives in .htaccess or Nginx configuration files. These are files that control how your server handles requests and responses. By adding some rules to these files, you can deny access to the wp-config.php file. If someone tries to access it, they will get a 403 Forbidden error.

    Disabling File Editors

    Another way to improve the security and performance of your WordPress site is to disable the file editors. These are the theme editor and the plugin editor that allow you to edit the code of your themes and plugins from within the WordPress dashboard.

    While these editors can be useful for quick changes, they can also pose both a security risk and a performance issue. If someone gains access to your WordPress dashboard, they can use the file editors to inject malicious code or delete important files. Moreover, if you make a mistake while editing the code, you can break your site or introduce vulnerabilities.

    To disable the file editors, you need to add the following line in your wp-config. php file:

    define( 'DISALLOW_FILE_EDIT', true );

    This line will remove the theme editor and the plugin editor from the WordPress dashboard. If you want to edit your themes or plugins, you will need to use an FTP client or a file manager.

    Blocking External HTTP Requests

    Another way to improve the security and performance of your WordPress site is to block external HTTP requests. These are requests that WordPress makes to other domains or servers for various purposes, such as checking for updates, fetching feeds, or loading scripts.

    While some of these requests are necessary and beneficial, some of them may be unwanted, unnecessary, or malicious. Blocking external HTTP requests can help prevent unauthorized access, reduce bandwidth usage, and speed up your site.

    To block external HTTP requests, you need to add the following line to your config file:

    define( 'WP_HTTP_BLOCK_EXTERNAL', true );

    This line will block all external HTTP requests made by WordPress, except for localhost and your own domain. This will make your site more secure and faster.

    However, blocking all external HTTP requests may also break some features or functions of your WordPress site that rely on them. For example, you may not be able to check for updates, install themes or plugins, or use third-party services.

    To allow some external HTTP requests, you can use another constant called WP_ACCESSIBLE_HOSTS. This constant allows you to specify a comma-separated list of domains or hosts that are allowed to make external HTTP requests. You can also use wildcards to allow subdomains. For example:

    define( 'WP_ACCESSIBLE_HOSTS', 'api.wordpress.org,*.github.com' );

    This line will allow external HTTP requests to api.wordpress.org and any subdomain of github.com. You can add or remove domains or hosts as per your needs.

    Forcing SSL for Login Pages and the Dashboard

    Although virtually all websites these days use HTTPS, some websites still might be serving content on HTTP for legacy reasons. You can improve the security and performance of your WordPress site by forcing SSL for login pages and the dashboard.

    This prevents anyone from intercepting or tampering with your data, such as usernames, passwords, cookies, and other sensitive information. SSL also improves the performance of your site by enabling HTTP/2 – a faster and more efficient version of HTTP.

    The following line of code will force SSL for login pages and the dashboard:

    fine( 'FORCE_SSL_ADMIN', true );

    Note: You’ll need to obtain an SSL certificate for your domain name, install it, and activate the SSL certificate on your server before enabling this setting. You may need to contact your hosting provider for assistance with this step.

    Optimize WordPress Performance via wp-config.php

    Empty the trash more frequently

    WordPress moves deleted posts, pages, comments, and other items to the trash, where they remain for 30 days by default. You can change this duration by defining the EMPTY_TRASH_DAYS constant in your wp-config.php file.

    For example, to empty the trash every 7 days, you can add this line:

    define( 'EMPTY_TRASH_DAYS', 7 ); // Empty trash every 7 days

    Disable revisions

    WordPress saves a copy of every post or page revision, which can increase the size of your database and slow down your site. You can disable revisions completely by defining the WP_POST_REVISIONS constant in your wp-config.php file. For example, to disable revisions, you can add either of these lines:

    define( 'WP_POST_REVISIONS', false ); // Disable revisions
    define( 'WP_POST_REVISIONS', 5 ); // Limit revisions to 5

    Handling memory limitations

    WordPress requires a certain amount of memory to run smoothly and efficiently. The default memory limit for WordPress is 40 MB for single sites, and 64 MB for Multisite installations. However, sometimes you may need more memory for your site, especially if you have a high number of plugins or themes installed, have complex functionality, or high traffic.

    To increase the memory limit for WordPress, you can use the WP_MEMORY_LIMIT constant in your wp-config.php file. For example, to increase the memory limit to 128 MB, add the following line:

    define( 'WP_MEMORY_LIMIT', '128M' );

    You can also use the WP_MAX_MEMORY_LIMIT constant to set the maximum memory limit that WordPress can use for intensive tasks, such as image editing or cron jobs. For example, to set the maximum memory limit to 256 MB, add the following line:

    define( 'WP_MAX_MEMORY_LIMIT', '256M' );

    Note that these constants may not work if your server has a lower memory limit set by PHP or Apache. In that case, you may need to contact your hosting provider, or edit your php.ini or .htaccess files to increase the server memory limit.

    Change the autosave interval

    WordPress autosaves your posts and pages every 60 seconds by default, which can be annoying or helpful, depending on your preference. You can change the autosave interval by defining the AUTOSAVE_INTERVAL constant in your wp-config.php file.

    For example, to change the autosave interval to 120 seconds, you can add this line:

    define( 'AUTOSAVE_INTERVAL', 120 ); // Change autosave interval to 120 seconds

    The WP Loading Process – When wp-config Loads (and What’s Already Loaded)

    The wp-config.php file is one of the first files that WordPress loads when a page is requested. It’s loaded even before WordPress initializes its core functions, classes, and hooks.

    The WP loading process is as follows:

    1. When a page is requested, WordPress looks for the .htaccess file in the root directory of your WordPress installation. This file contains rules that rewrite URLs and direct them to the index.php file.
    2. The index.php file requires another file called wp-blog-header.php.
    3. The wp-blog-header.php file requires another file called wp-load.php.
    4. The wp-load.php file is a bootstrap file that loads the WordPress environment and template. It looks for the wp-config.php file in two locations:
      • The root folder of your WordPress installation.
      • One directory above the root folder, if the file is not found in the root folder.
    5. If wp-config.php is missing, it starts a fresh installation.

    To learn more about this topic, we recommend two articles – WordPress loading sequence and How WordPress Core Loads.

    After Action Report – Managing wp-config.php

    The wp-config.php file is a vital part of a WordPress website, and must be appropriately configured for the website to function correctly. It’s essential to understand how to locate and edit the file, and troubleshoot any issues that may arise.

    With RunCloud, you can easily set up and manage your servers, including configuring your wp-config.php file, with just a few clicks.

    RunCloud also offers a variety of features, such as automatic backups, monitoring, and scaling options to help ensure your site runs smoothly – all through a secure and user-friendly management panel.Don’t waste any more time on complicated server management – sign up for RunCloud today!

  • Scaling RAM & CPU Cores – How They Affect WordPress Performance

    Scaling RAM & CPU Cores – How They Affect WordPress Performance

    Did you know that a one-second delay in page load time can reduce conversions by 7%?

    Or, that Google penalizes slow sites in its search rankings?

    These are just some of the consequences of having a poorly performing WordPress site. And one of the main factors that affects your site’s performance is the amount of RAM and number of CPU cores that your hosting plan provides.

    But what are RAM and CPU cores, and how do they relate to WordPress hosting?

    How can you tell if your site needs more or less of them? And how can you scale them up or down to optimize your site’s performance?

    In this article, we’ll answer all of these questions, and more. We will explain what RAM and CPU cores are, how they work, and why they matter for your WordPress site. We will also give you some examples of WordPress sites that require high RAM and CPU resources, and how to scale them accordingly. Finally, we will share some tips and best practices to improve your site’s performance, and avoid wasting resources.

    If you want to learn how to make your WordPress site faster, smoother, and more reliable, read on!

    Why Do Sites Need RAM and CPU?

    RAM and CPU are the main components of your hosting server that determine how fast and reliable your WordPress site is. Let’s see what they do and why they matter.

    What is RAM?

    RAM stands for Random Access Memory, and is the temporary storage space that your WordPress site uses to load and process data. Every time someone visits your site, WordPress needs to access the database, load the files, and execute the code. All these operations require RAM to store the data temporarily.

    RAM is typically measured in Megabytes and Gigabytes. Most cloud providers allow you to configure the amount of RAM available on your server. The more RAM you have, the more data your site can handle at once. This means your site can load faster, handle more traffic, and run more plugins – without crashing or slowing down.

    What is a CPU?

    CPU stands for Central Processing Unit, and is the “brain” of your WordPress site that executes commands and calculations. Every time someone visits your site, WordPress needs to perform some logic and calculations to generate the output. For example, it needs to check the user’s permissions, apply the theme’s settings, run the plugins’ functions, and so on. All these operations require a CPU to process the commands.

    The CPU is measured in the number of cores. The more CPU cores you have, the more commands your site can execute at once. This means your site can perform faster, handle more complex tasks, and run more plugins without errors or delays.

    As you can see, both RAM and CPU are essential for your WordPress site to function properly.

    However, they also have limits.

    The more RAM and CPU cores you have, the more processes you can run simultaneously, and the faster your site can respond to visitors. If your site receives a lot of traffic or runs complex tasks, it might need more RAM and CPU resources than are available on your current hosting plan. This can result in slow loading times, errors, or even crashes.

    That’s why you need to choose a hosting plan that provides enough RAM and CPU resources for your WordPress site. You also need to monitor your site’s performance and usage regularly, and scale your resources up or down as needed. In this way, you can ensure that your WordPress site runs smoothly and efficiently at all times.

    Which Sites Benefit From More RAM and CPU?

    Not all WordPress sites need the same amount of RAM and CPU resources. Some sites are more demanding and complex than others, and they can benefit from having more RAM and CPU resources to run smoothly and efficiently.

    Some examples of WordPress sites that require high RAM and CPU resources are:

    • E-commerce sites that handle a lot of transactions and inventory. These sites need to load and process a lot of data, such as product details, prices, images, reviews, cart items, payment methods, and so on. They also need to handle a lot of user requests, such as adding items to the cart, checking out, updating orders, etc. All these operations require a lot of server resources to avoid slow loading times, errors, or crashes.
    • Membership sites that have a lot of users and content. These sites need to store and manage a lot of user data, such as profiles, preferences, subscriptions, activities, etc. They also need to load and display a lot of content, such as posts, pages, videos, podcasts, courses, etc. A large amount of traffic will put additional strain on a server’s resources.
    • Media sites that stream or download large files. These sites need to handle a lot of bandwidth and storage for the media files, such as images, audio, video, etc. They also need to encode and decode the files for different formats and devices. All these operations require a lot of RAM and CPU resources to deliver high-quality media without buffering, lagging, or breaking.
    • Multisite networks that run multiple WordPress sites on one server. These sites need to share the same server resources for all of the sub-sites in the network. This means that each sub-site needs to have enough RAM and CPU resources to function properly without affecting the other sub-sites. Running multiple sites requires a large amount of server resources.
    • If your site experiences a sudden surge in traffic, such as during a launch, promotion, or viral event, you might need to scale up your RAM and CPU resources to handle the increased load. In this way, you can avoid slow loading times, errors, or crashes that can frustrate your users and hurt your conversions.
    • If your site runs complex plugins or tasks, you might need to scale up your RAM and CPU resources to run them smoothly and efficiently. In this way, you can avoid performance issues, bugs, or conflicts that can affect your site’s functionality and user experience.

    Measuring Performance Gains

    It’s widely believed that “a bigger server will obviously outperform a smaller server”.

    To put this to test, we created 3 identical websites on 3 fresh servers using WordPress 6.2. All of the servers had identical configurations – except the CPU and RAM.

    We ran load testing benchmarks using Grafana k6 to stress test the performance of our website, and measure the impact in 95 percentile response times. Since the purpose of this test is to put strain on CPU and RAM, we didn’t use any optimization techniques such as caching that are used in real world applications.

    1v CPU 2 GB RAM

    Our smallest server used the cheapest hosting plan offered by the cloud provider. It consisted of only 1 virtual CPU and 2 GB of RAM. Despite this, it was able to serve nearly 20 requests per second and had a p95 response time of 815ms. This is not bad considering it only costs <$5 to run. Most users will be able to afford it and will be satisfied with it – as long as the site doesn’t get too much traffic.

    2v CPU and 8 GB RAM

    Our second server was moderately priced, this one consisted of 2 virtual CPU cores and 8GB of RAM. This server size is probably unnecessary if you’re running a hobby site, but if you use your site for critical business transactions, then you should consider this.

    Just by slightly increasing the resources, we were able to see a massive jump in the performance. The server completed nearly 36 requests every second with a p95 response time of 104ms. These numbers suggest that our server was limited by the number of resources during our first test. Let’s crank it up further and see if the numbers scale proportionally.

    8v CPU 32 GB RAM

    Our third server was the most expensive of the three, it contained 8 virtual CPUs and a whopping 32 GB of RAM. However, when we look at the numbers, they tell a different story. The number of requests per second metric saw only a minor bump from 36 to 39; furthermore, the p95 response time metric didn’t improve.

    Trade Offs to Consider While Scaling RAM and CPU

    You also need to be aware of the potential drawbacks or challenges of scaling RAM and CPU cores.

    Unexpected Crashes

    Scaling RAM and CPU cores might cause some unexpected issues or conflicts that can break your site.

    For example, you might encounter compatibility problems with some plugins or themes that are not optimized for the new resources. Or you might face some server errors or configuration issues that prevent your site from loading properly.

    These issues or conflicts can make your site inaccessible or unusable until you fix them, or revert to the previous state.

    Planned Downtime

    Furthermore, many hosting providers require you to shut down your server before you can increase or decrease your server’s RAM and CPU.

    This means that your site will be offline for the duration of the upgrade. Although most providers will be able to scale up your server within a few minutes, this does vary from vendor to vendor, and depends on availability.

    Increase in Hosting Costs

    Finally, scaling RAM and CPU cores can also affect the price of your hosting plan. Some providers and plans might offer flexible or scalable pricing that adjusts to your resource usage. Others might charge you a fixed or flat rate regardless of your resource usage. And others might have different tiers or levels of pricing that correspond to different amounts of resources.

    You need to weigh the costs and benefits of scaling, and find the best balance for your site’s budget and needs.

    You need to consider how much scaling will improve your site’s performance and user experience, and how much it will increase your hosting expenses. You should also compare different providers and plans to find the one that offers the best value and quality for your site.

    More Resources Might Not Benefit the Site

    Simply adding more RAM and CPU cores does not guarantee better performance if there are other limiting factors such as network speed, disk speed, or PHP workers.

    PHP workers are processes that handle PHP requests on your WordPress site. Some hosting providers limit the number of PHP workers available on your server. If you have too few PHP workers, your site may become slow or unresponsive when there are many concurrent visitors or complex tasks. If you have too many PHP workers, they may consume too much RAM and CPU resources, and cause your server to crash.

    Final Thoughts – Thinking Beyond RAM and CPU

    It’s clear that you can’t keep scaling up the hardware and expect proportional increase in performance.

    Throwing money at the problem only works up to a point.

    Beyond that, you need to fine tune your application to consume fewer resources, and find the optimal balance between RAM, CPU cores, and PHP workers for your WordPress site based on your traffic, content, and plugins. There are several ways to do this:

    • You can use caching, a technique that can improve your WordPress performance by storing frequently accessed data in memory or on disk, and serving it faster to visitors without invoking PHP workers.

    There are different types of caching such as page caching, object caching, edge caching, etc. You need to choose the right caching solution for your WordPress site, depending on your needs and preferences.

    If you’re tired of managing your own servers, you might want to check out RunCloud (yep, that’s us!).

    RunCloud is built for developers that want to focus on shipping great work, not on managing their infrastructure. Experience what a painless server configuration feels like – get started with RunCloud today, and get up and running in minutes.

  • What is WHMCS and How Is It Used?

    What is WHMCS and How Is It Used?

    If you’re running a web hosting business, you know how challenging and time-consuming it can be to manage your clients, billing, support, domains, and more.

    You need a solution that can automate your tasks and make your life easier.

    That’s where WHMCS comes in.

    WHMCS is a powerful and popular web hosting automation platform that can help you run your business smoothly and effectively. But how do you install WHMCS on RunCloud, the best cloud server management platform?

    In this article, we will explain what WHMCS is and how it works, and then we will guide you through the quick and simple steps of installing it on RunCloud. You’ll also learn about some of the best alternatives to WHMCS that can offer you more features and benefits for your web hosting business. Read on to find out more!

    What Is WHMCS

    WHMCS is short for Web Host Manager Complete Solution. It’s a management platform that simplifies the process of selling domain names and hosting services online. WHMCS provides a suite of tools that can automate daily operations such as billing, invoicing, client management, and support requests.

    WHMCS was first introduced back in 2005, and since then it has become a popular choice for web hosting companies to manage their online business. It’s an invaluable tool for such hosting companies, as it helps them to manage their businesses more efficiently and effectively.

    If you’re looking for alternatives to WHMCS, you might want to check out this article: The Best WHMCS Alternatives (Free, Open Source & Premium). It will give you an overview of some of the most popular and promising options for web hosting automation. You might find a solution that suits your needs and budget better than WHMCS.

    Key Features Of WHMCS

    1. Billing and Invoicing: WHMCS can automate the process of generating invoices, and allows users to manage their finances and payments easily. You can also configure recurring billing, payment reminders and promotional discounts to boost your sales.
      There are mechanisms set in place to handle multi-currency transactions, as well as initiating refunds in case of a dispute.
    2. Client Management: It provides a centralized location to manage client data and information such as order history, support tickets, and billing information. Having a unified dashboard which tracks everything streamlines the operations process, and improves productivity.
    3. Product and Service Management: WHMCS allows you to manage your products and services quickly and easily. You can add new products, set up pricing, packages, and use custom options to provide additional offerings to your customers.
    4. Support Ticket System: There is a built-in support ticket system for managing customer support requests and inquiries. This system can be organized to replicate the hierarchy of support staff, and organize them in departments to segregate responsibilities.
      It’s possible to open and communicate in a ticket via email or directly from the web interface. The ticketing system also supports attachments, and you can set up additional escalation rules to perform automated actions and enforce SLAs.
    5. Integrations: WHMCS has built-in support for various payment gateways such as PayPal, Stripe, Skrill, eWay, etc. It can integrate with various domain registrars, including GoDaddy, ResellerClub, NameCheap, and more.
      It can send notifications via Slack and Hipchat, which makes it easier for users to manage all aspects of their business.
    6. Customizable: One of the key features of WHMCS is its modular architecture which allows for unlimited customizations. It offers a powerful API that supports both XML and JSON to execute actions within WHMCS from third party code. There are themes and templates available, which can be used to create a professional and branded experience for clients.

    Benefits of using WHMCS

    1. Improved Efficiency: WHMCS can automate various business operations, thereby reducing manual work, saving time and improving efficiency. This will free up time for businesses to focus on growth and improving overall efficiency.
    2. Streamlined Financial Management: The platform facilitates billing and invoicing automatically for a large number of clients, allowing businesses to manage their finances and maximize their revenue.
    3. Improves Customer Experience: With WHMCS, you get a centralized location to manage your client accounts and manage support tickets. Having a user friendly interface that makes it easy to perform the desired actions, and ask questions from support staff, leads to improved customer satisfaction.
    4. Easy to Use: WHMCS consolidates multiple tools and features into a single platform. This eliminates the need to switch between multiple tools to manage business operations. It also provides tutorials, guides, and support resources to help users quickly get up to speed with the platform.

    How Install WHMCS on RunCloud

    Creating an Empty Web app

    Log in to your RunCloud dashboard, and select the server you want to use. Click on the Web Application tab and then click on the “Deploy New Web Application” button.

    Choose a name for your web app, such as whmcs-app, and then select the web application owner. We recommend creating a new owner for each web application.

    Next, choose a domain name for your web app, such as whmcs.example.com, and make sure you have pointed it to your server’s IP address or hostname.

    Select the PHP version that you want to use. At the time of writing, WHMCS recommends using PHP 8.1. Finally, click on the Create Web Application button, and wait until your web app is created and ready to use.

    After creating the web application, you need to log into your server as the owner of the application via SSH, and navigate to the root directory of your web application. If you are not sure how to do this, we recommend reading How To Add a SSH Key and How To Use SSH Keys with PuTTY.

    Download WHMCS Binaries

    Prerequisite: You need to install and enable ionCube first. Follow our tutorial on installing ionCube Loader and confirm that you have it installed.

    After installing the ionCube Loader, you need to download and extract the WHMCS installation archive on your server. You can either download it to your personal computer and then move it to your server via FileZilla, or you can follow the instructions below to download it directly to your server if you’re feeling adventurous!

    To download the binary directly to your server, we will use the curl command. First, go to https://download.whmcs.com/ and open the DevTools page in your browser.

    In the DevTools windows, switch to the “Network” tab – any web requests that you make on download.whmcs.com will be recorded here.

    Next, go back to the download page and download the latest available binary – you need to have a valid license key to access this page.

    Choose the Full Release option, and click on the Download button. This will start downloading the zip file to your local computer. You can cancel the download if you like as we won’t be using the downloaded file.In the network tab, you should see a single request – this is the request that was made to download the zip file. Right click on the request, and go to Copy > Copy as Curl. If you are using Windows, you might see two options – select the “Copy as Curl (bash)”.

    If you followed the instructions correctly, you will have copied the curl request that contains the necessary cookies and request headers that are specific to your license key. We can paste this into your server terminal to make the same request again (i.e. download the file). After pasting it in the terminal, we need to specify the name of the file that will be downloaded. To do this, write -o whmcs_87.zip at the end of the command. The resulting command should look something like this:

    The above command will download the file to your server and save it as whmcs_87.zip. You can use the ll command to list all the files in the current directory.

    The above screenshot shows that a new zip file was created on the server. We can extract it using the unzip command. This will create another folder inside our application folder.

    We can quickly copy the necessary files to the root of the application folder, and remove the obsolete files such as the default index.html file and downloaded archive. We can also set permissions for the configuration file.

    You can execute the following commands to perform the above tasks, and terminate the session.

    unzip whmcs_87.zip # Unzip the downloaded file
    cp -r whmcs/* . # Copy installation files to correct directory
    rm -rf whmcs/ index.html whmcs_87.zip # Remove unnecessary files
    mv configuration.php.new configuration.php # Rename file
    chmod 400 configuration.php # Set Permissions
    exit # Close the SSH connection

    After executing the above commands, you can begin the installation process.

    Open your website in a web browser – you’ll see a welcome screen. Click on the install button to start the installation process.

    Note: If you receive an error message asking you to install ionCube loader, you should refer to our blog post: How To Install ionCube Loader (Step-by-Step Tutorial).

    On the next screen, you will need to provide your License key for the WHMCS installation – you can get this from the WHMCS dashboard under Services > My Licenses menu.Next you need to create a database and link it to your web application.

    After the installation is complete, you will see a success message, along with a list of steps to secure your installation. If you were not able to complete the installation successfully, you can refer to the troubleshooting guide by WHMCS.

    Logging in to the Dashboard

    After the installation is complete, you can log in to your dashboard to check everything is working properly. Go to the “PHP Version Compatibility” section in the left menu to confirm that everything is configured correctly.

    Next, click on the wrench icon on the top right and go to the “System Health” page to check your installation. Here you will see a list of warnings. We will resolve them one-by-one to secure your WHMCS installation.

    Securing WHMCS Installation

    Deleting the Installation Directory

    WHMCS recommends deleting the “install” directory after installation is complete. Go to the RunCloud file manager and click on the checkbox next to the “Install” directory, and then press “Delete”.

    Enable Necessary PHP Functions

    You might need to enable certain PHP functions that are blocked on RunCloud by default.

    Go to the “Settings” tab of your web application and scroll down to the “PHP settings” section. You can delete the required functions from the “disable_functions” list, and it will be enabled for that particular web application on your server.Don’t forget to click “Update PHP Settings” for the changes to take effect.

    Change Permissions for configuration.php

    If you are getting the “Insecure Permissions Check” message, you can update the file permissions using the RunCloud file manager.

    Simply click on the configuration.php file and then set the permissions to read only. Click on the “Change Permissions” to save the changes, and then refresh the WHMCS dashboard to see the changes.Note: If you configured the permissions via the command line earlier during installation, you won’t need to do this again.

    Rename Sensitive Directories

    We can further enhance the security of our WHMCS installation by moving certain sensitive directories to a different location. Although you can move the directories, a quick and easy way to achieve a similar level of security is by just renaming them to something obscure.

    Go to the RunCloud file manager and rename the following folders to anything you like:

    • templates_c
    • cons
    • admin

    We recommend adding a random string of alphanumeric characters either at the beginning or the end, rather than completely renaming it.

    After renaming the folders, we need to tell WHMCS where the new folders are located. To do this, add the following code snippet at the end of your configuration.php file. Make sure to replace the name of the folder with the name that you chose.

    $templates_compiledir = "/home/whmcs/webapps/whmcs/templates_c_22";
    $crons_dir = "/home/whmcs/webapps/whmcs/3f002g_crons/";
    $customadminpath = "3fw0047_admin";

    In the above example:

    • the templates_c directory was renamed to templates_c_22
    • the crons directory was renamed to 3f002g_crons
    • the admin directory was renamed to 3fw0047_admin

    Note: You don’t need to specify the entire path from the root of the server when changing the custom admin path.

    After editing, your configuration file should look similar to the following example:

    Save the file and refresh the WHMCS dashboard. Since we changed the admin directory, this will log you out of the dashboard.

    Log in to the dashboard again by navigating to the new admin URL in your browser. For example, if you renamed your admin folder to 3fw0047_admin then your login page will be located at example.com/3fw0047_admin/.

    Setting Up Cron Jobs

    WHMCS needs to execute certain code at regular intervals to function correctly. We need to configure a cron job to handle this.

    Click on the “Automation Status” (three cogs) button on the top right of the screen. This will show you the status of your cron jobs. Since we have just configured the server, the status might be okay but it will definitely show an error message after a few hours if you don’t configure the cron job.

    To configure the cron job, click on the “OK” card in the middle of the screen. This will show a pop-up that displays the status of your cron jobs, along with the command that you need to execute. Copy this command.

    Next, you need to navigate back to the RunCloud dashboard and click on the “Cronjob” button in the left-menu.

    Give your job a descriptive name, and provide the name of the web application owner that you specified while creating the application.

    Select the version of the PHP that your WHMCS installation is using, and then paste the copied command in the text box provided below. Make sure to remove the “php” from the start of the command as we have already specified a custom version of PHP for this.Finally, you need to specify the frequency of the job. From the drop-down menu, select “Use Custom Settings” and then type */5 in the minute text box.

    Click on the “Save Cron Job” to add it to your server. Check the WHMCS dashboard in a couple of hours – if the cron status is still “ok” then you have performed this step successfully.

    Block Access to Sensitive Directories

    WHMCS recommends blocking requests that are served directly from the vendor. We can create a new rule on our server that will deny access to visitors.

    On LiteSpeed servers, you can do this quickly by adding the following code to your LiteSpeed configuration:

    context /vendor/ {
    allowBrowse 0
    }

    After adding these lines, the configuration file should look something like this:

    For Nginx servers, you need to create a custom configuration to do this. Go to the “Nginx Config” page on your RunCloud dashboard, and create a new configuration. Provide a suitable name for the configuration, and then paste the following code:

    location ^~ /vendor/ {
        deny all;
        return 403;
    }

    After adding the configuration, you can press “Run and Debug” to test the configuration. If you get a success message, you can click “Save” to add the configuration to your server.

    Securing The Attachments and Downloads Directory

    You need to secure the attachments and downloads directory. This is where WHMCS will store any files that you upload or attach to your invoices, tickets, products, etc.

    The way you secure these files and directories will depend on how you want to store them.

    You might want to attach a different drive to your server to store this data, or save it on an S3 compatible storage service, such as AWS S3, DigitalOcean Spaces, etc. You can also use the default location inside your web app root directory, but you need to make sure it is not accessible from the web.

    We recommend referring to the official WHMCS documentation for this step, as it will guide you through the different options and scenarios.

    After Action Report

    WHMCS is a powerful and popular web hosting automation platform that can help you manage your clients, billing, support, domains, and more. However, it is not without its challenges and limitations. You might encounter issues with maintaining or upgrading your server.

    That’s why you need a reliable and efficient web hosting control panel to run your WHMCS web app.

    RunCloud is a cloud-based server management platform that can help you deploy, configure, optimize, and secure your web app on any cloud server. You can choose from various web application stacks and enjoy features such as SSL certificates, firewall, backup, cron jobs, SSH keys, and more.

    Working with RunCloud is easy and intuitive. You can create and manage your web app from a user-friendly dashboard, or use the API and CLI tools for more advanced tasks.

    You can also monitor your server’s health and performance with real-time graphs and alerts.

    RunCloud also provides excellent customer support and documentation to help you with any questions or issues.

    By using RunCloud to run your WHMCS web app, or any other web hosting automation platform, you can save time and improve your productivity. You can focus on growing your business and providing value to your customers, while RunCloud takes care of the technical aspects of your web app.

    RunCloud is the ultimate partner for web hosting automation – get started with RunCloud today!

  • How To Install ionCube Loader (Step-by-Step Tutorial)

    How To Install ionCube Loader (Step-by-Step Tutorial)

    Did you know that a large number of PHP applications are encoded with ionCube?

    If you want to use any of these applications on your web server, you need to install ionCube Loader – a PHP extension that allows you to run ionCube-encoded PHP files. But how do you install ionCube Loader on your web server? Is it easy or complicated? Do you need any technical skills or experience?

    In this article, we will show you how to install ionCube Loader in less than 10 minutes with our step-by-step tutorial. You will learn:

    • How to download the right Loader package
    • How to extract and copy the Loader file
    • How to edit the php.ini file
    • How to restart your web server.

    By the end of this article, you will be able to run any ionCube-encoded PHP application on your web server without any hassle. Sounds good? Then let’s get started.

    What is ionCube Loader?

    The ionCube Loader is a PHP extension that allows you to run ionCube-encoded PHP files on your web server. ionCube-encoded PHP files are files that have been protected with the ionCube PHP Encoder – a widely used tool that allows developers to encrypt their PHP code and add security features such as license management, malware protection, and code optimization.

    The loader is supplied as a PHP extension module for Windows, Linux, and macOS, and can be installed into a PHP installation. It is also freely redistributable. By installing ionCube Loader on your web server, you can benefit from the following advantages:

    • You can use third-party PHP applications that are encoded with ionCube, such as WordPress plugins, e-commerce platforms, or CMS systems.
    • You can protect your own PHP code from being stolen, modified, or reverse engineered by encoding it with ionCube PHP Encoder and running it with ionCube Loader.
    • You can improve the performance and reliability of your PHP code by using the ionCube PHP Encoder’s features such as code compression, error reporting, and vulnerability protection.

    If you are using PHP 7.4 on the OpenLiteSpeed server, ioncube Loader should be enabled by default. You can check it using the instructions provided at the end of this article. If it is not installed, you can quickly install it by running apt install lsphp74-ioncube for PHP 7.4 and apt install lsphp81-ioncube for PHP 8.1.

    You should note that ionCube does not support PHP 8.0 and ionCube Loader for PHP 8.2 is still in beta development. Since PHP 7 has reached the end of life, we will only cover the instructions to install the ionCube loader for PHP 8.1.

    Installing ionCube Loader

    Before you begin installing the ionCube Loader you’ll need to know which PHP version your website is running on. At RunCloud, we offer multiple versions of PHP, from 7.0 right up to the latest 8.2 release. If you’re not sure which PHP version your website is on, log in to your dashboard, and head over to ‘Settings’ on the left:

    installing ioncube loader

    So, as an example, if you find that your website is currently running PHP version 7.4, then you’ll need to make sure you install the 7.4 version of ionCube.

    On Containerized Servers

    If you are running a Containerized server on RunCloud, you can quickly install ionCube Loader with a few clicks. Go to the “Services” tab of your server and scroll down to the PHP images. Here you can see the PHP images that are available for your server.

    You need to install ionCube Loader on each PHP version separately. If an image is already “in use”, click on the “…” next to it and select “Change Environment Variables“. If the image is not being used on your server, you can click on “Add to stack“.

    This will open a pop-up window on your screen. Under the third party extensions menu, make sure to Check the box next to ionCube.

    Next, click on “Update Environment Variables” or “Add to Stack“, depending upon your setup.

    You need to perform the above step for each PHP version that needs ionCube Loader.

    After making the necessary changes, scroll back to the top of the services page and click on “Deploy” to save the changes. This will create new container images on your server, and all the existing (as well as new) applications on your server will be able to use the ionCube Loader.

    On OpenLiteSpeed Servers

    If you are using OpenLiteSpeed servers, you will need to log in to your server via SSH. After logging in to your server, you need to download the ionCube Loader archive from the official website, and extract it. To do this, you can run the following commands:

    cd /tmp/
    wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
    tar -zxvf ioncube_loaders_lin_x86-64.tar.gz

    The previous command should show an output similar to the above screenshot. After extracting the archive, it will be available in the /tmp directory. However, we need to install it in our PHP environment.

    In this section, we have provided the instructions to install ionCube Loader on PHP 8.1, but the steps are similar for any other version of PHP.

    To install ionCube, you need to copy the relevant shared library file in the PHP’s directory. Change into the installation directory of PHP 8.1 using the following command:

    cd /usr/local/lsws/lsphp81/lib/php
    ls

    After navigating to the correct directory, you can browse its contents. In the above screenshot, we can see it has two folders, one named 20210902 and the other is named 8.1.

    Execute the following commands to copy the shared library file of ionCube Loader for PHP 8.1 into the folder named 20210902. These commands will also create an entry in the mods-available directory to load the ionCube Loader next time PHP is reloaded.

    cp /tmp/ioncube/ioncube_loader_lin_8.1.so 20210902/
    echo "zend_extension=ioncube_loader_lin_8.1.so" > /usr/local/lsws/lsphp81/etc/php/8.1/mods-available/ioncube.ini

    If you want to install the loader for multiple PHP versions, you need to perform the above step for each version. Finally, you need to restart the PHP environments for the changes to take effect – run the following commands to do this:

    # For OpenLiteSpeed servers
    systemctl restart lsws-rc
    killall lsphp

    On Nginx Servers

    Similar for OpenLiteSpeed servers, to install ionCube Loader on Nginx servers, you need to log in to your web server as root, and run the following commands to download and extract the archive:

    cd /tmp/
    wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
    tar -zxvf ioncube_loaders_lin_x86-64.tar.gz

    Once you’ve extracted the archive, you’re ready to install the ionCube Loader. Execute the following commands to copy the shared library files in the correct location, update the relevant configuration, and to restart the PHP-fpm:

    (Again, we have only provided the commands for PHP 8.1 but the process is similar for all versions of PHP. )

    cp ioncube/ioncube_loader_lin_8.1.so /RunCloud/Packages/php81rc/lib/php/extensions/no-debug-non-zts-20210902
    echo "zend_extension=ioncube_loader_lin_8.1.so" > /etc/php81rc/conf.d/ioncube.ini
    systemctl restart php81rc-fpm

    Checking ionCube Installation

    Once you’ve installed ionCube, you may want to verify that it’s installed properly and that everything is running correctly. To do this you simply need to run one line of code, which will vary depending on your PHP version, as shown below:

    For OpenLiteSpeed

    /usr/local/lsws/lsphp81/bin/php -m | grep -i ioncube

    For Nginx

    /RunCloud/Packages/php81rc/bin/php -m | grep -i ioncube

    The above command will use the specified version of PHP to list out all the installed modules and display all the lines that contain the word ionCube. If your installation was successful, you will see the following output:

    For All PHP Versions and Server Stacks

    If you don’t want to check the installed modules via the command line, you can also do it using the web interface. This method will work on all the PHP versions, regardless of your server stack.

    After installing the module, make sure you have restarted your web server. Next, go to your RunCloud dashboard and select the application where you want to use ionCube Loader. Click on the “File Manager” tab on the left, and then create a new PHP file. You can name it anything – for example abcd.php.

    Next, click on the newly created file, which will open up a text editor in a new window. You need to edit this file by pasting in the following code, and saving it:

    <?php phpinfo(); ?>

    Open this file in your browser. For example, if the URL of your site is www.example.com, you need to visit www.example.com/abcd.php to open it. You should see something like the screenshot below. Scroll down to find the version of ionCube Loader.

    In the above screenshot, we can see that the ionCube Loader is being displayed, therefore it was installed correctly. If the page fails to load or the entry is missing, then it was not installed correctly.

    After checking the installation, we strongly recommend deleting this configuration file. It reveals sensitive information about your server to the internet that can be used by hackers to target you.

    Backwards Compatibility And Limitations

    If you’re upgrading your version of PHP, it may not always be necessary to remove ionCube and install a newer version.

    Encoded files can, in general, run on versions of PHP equal to or greater than the source language of the Encoder used to produce them.

    So a file produced by the Encoder for PHP 7.2 can be run by the Loaders for PHP 7.2, 7.3, and 7.4, but not 7.1. This means that the Loaders offer good backwards compatibility. However, there are the following limitations:

    • The Loader for PHP 8.1 can only run files produced by the version 12 Encoder for PHP 8.1.
    • The Loaders for PHP 7.1 through 7.4 can only run files produced by the Encoders for PHP 7.
    • The Loader for PHP 7.0 can only run files produced by the Encoder for PHP 5.6.

    Conclusion

    ionCube’s tools are hugely valuable in both protecting and optimizing your PHP code. By encrypting and obfuscating your code, you are guarding it from prying eyes, and protecting your intellectual property from being used without permission, or in any way you don’t approve of.

    By using the ionCube tools your PHP code will no longer be able to be reverse engineered, copied, or stolen. But as well as this, it will also help speed up your code.

    It achieves this by compressing the code before sending it back to the clients requesting that particular resource. This compression results in faster load times for end users who are trying to view or interact with your application from their browser, making for a more enjoyable user experiences overall.

  • Everything You Need To Know About WordPress Object Caching

    Everything You Need To Know About WordPress Object Caching

    Tired of slow page load times and constant frustration with your WordPress site’s performance? The solution might just be something called ‘Object Caching’.

    In this article we’ll dive into exactly what Object Caching is and how it works. Most importantly, we’ll guide you through the steps you’ll need to go through to start using Object Caching to significantly improve the speed and efficiency of your website.

    Say ‘goodbye’ to sluggish load times, and ‘hello’ to a lightning-fast, smooth user experience.

    Let’s get started!

    What is Caching?

    Caching is a technique used to store frequently accessed information in a more accessible and responsive location. If processing a website request takes a large amount of time then it can degrade the user’s experience, potentially impacting your sales and conversions on a regular basis.

    Caching can help solve this problem by storing the frequently required data in a fast-to-access storage location. Any data that is accessed frequently and can be stored for a while is a good candidate for caching.

    Caching is often associated with RAM, but it can be used with any storage media. For example, if downloading information from a server over the network takes ten seconds, you can save time by caching the file on your hard disk.

    If reading the data from a hard disk takes too long, you can speed it up by caching the file in your RAM, which is many orders of magnitude faster than a hard disk.

    Taking this one step further, you can even cache some vital information directly in the cache memory of your CPU if the delay caused by reading the data from RAM is unacceptable.

    An infographic depicting the hierarchy of computer memory.

    Although it is useful, caching is not a silver bullet. Cached data becomes outdated after a period of time, and this can cause unexpected glitches in the application. To ensure proper functioning of your application it will be necessary to constantly replace the old copy of data with a fresh copy at regular intervals.

    One more thing to keep in mind is that as we shift towards faster storage media, the capacity decreases drastically along with the exponential increase in the cost. For example, cloud storage costs a few dollars a month for hundreds of GBs of storage. Modern SSDs are getting cheaper, but still cost hundreds of dollars for a single terabyte of storage. RAM is much faster than an SSD, but most modern computers only have about 16GB of RAM. As a surprise to no one, the cache memory size of a CPU is even lower. The Intel Core i9-13900 processor – the latest offering from Intel – still only offers 36MB of cache memory.

    Overview of Different Types of Caching

    • Server caching: When the server processing the requests caches the queries, then it is called server caching. In WordPress, there are two main types of server caching techniques:

      • Object Caching: In this, WordPress stores the results of frequent database queries and other API requests. It is called Object Caching because the result of the query is often an object (such as an item of data from a database, a row from a table, or a document).

        If you want to display the result of a complex database query, such as the number of 5 star reviews on a particular product, then Object Caching is the right choice for you as the number of reviews are likely to remain the same when a page is refreshed.

      • Page caching: This type of caching involves generating complete static pages and storing them. When a server receives a request, it serves this statically generated page instead of rendering a fresh copy of it.

        If you are serving pages that mostly remain the same, but are heavily requested by your users, then you should use this. The homepage or the pricing page of your site are unlikely to change often and are a good fit for this type of caching.

    • CDN caching: This is a good option for caching static content, such as images, fonts, CSS, JS libraries, and HTML pages, on a content delivery network (CDN). If your site uses a CDN, then all of your customers’ requests will be routed through a CDN. If the CDN has a cached copy then it serves that, otherwise it asks your server for a fresh copy, serves that, and also stores it for future use. When the cached copy gets too old, it is automatically deleted and the CDN asks for a fresh copy.

      Although this might seem like extra effort, this drastically reduces the number of requests that reach your server, and it also serves content faster to your visitors.

    • Browser caching: This is somewhat similar to CDN caching, but it happens in the user’s browser. If a user is visiting your site for the first time, they won’t notice a difference. However, returning users would already have a cached copy of your data and won’t need to make network requests; this can drastically reduce the request time.

      Sometimes, even first time users will be able to take advantage of browser caching. For example, if you use third party assets such as Google Fonts or Google Analytics on your site, and the visitor has previously visited a different site that also uses these same assets, then the browser will already have a cached copy of them, and can use those.

    What is Object Caching?

    In WordPress, Object Caching is the technique of storing the results of complex database queries in memory. These saved results are then reused when executing subsequent requests and, since the results are already computed, it takes less time to serve those requests.

    Object Caching reduces the load on the database and improves the overall performance and responsiveness of a WordPress site. As a result, you can serve more customers without needing to scale up the infrastructure, helping to save on server costs (and significantly improve the user experience).

    When Do You Need Object Caching?

    If you already have a CDN configured on your site then you might be thinking that you don’t need to use Object Caching. While a CDN does help in reducing the server load, it can’t replace Object Caching – no one particular caching solution can solve 100% of your problems.

    A way to think about caching is as a series of nested filters, where each filter catches smaller and smaller things at each level. As data passes through each level of caching, it is checked against increasingly specific and targeted rules until only the most relevant and frequently accessed data remains in the cache.

    Any WordPress site that receives a high volume of traffic, has complex queries, or requires fast and reliable performance, can benefit from Object Caching. Here are some scenarios where Object Caching can be especially beneficial:

    • High-traffic websites: Publishers and news sites that receive a high volume of traffic can benefit from Object Caching to improve page load times and reduce server load. Object Caching can help reduce the number of database queries required to load a page, which can make a big difference when dealing with large amounts of traffic.
    • eCommerce sites: Online stores that use WordPress plugins such as WooCommerce, Easy Digital Downloads, or NorthCommerce can benefit from Object Caching to improve the performance of their product pages, shopping cart, and checkout pages.
    • Course websites: WordPress sites that use a learning management system (LMS) such as LifterLMS, LearnDash, or SenseiLMS can benefit from Object Caching to improve the performance of their course pages, quizzes, and other interactive features. 
    • WordPress multisite networks: Websites that use WordPress multisite networks can benefit from Object Caching and improve the performance of their entire network. Object Caching can help reduce the number of database queries required to load pages across the network, which can improve the overall speed and responsiveness of the sites.

    What Are the Benefits of Using Object Caching?

    Object Caching can offer several benefits for WordPress sites:

    • Improved Performance: Enabling Object Caching can significantly improve the performance of WordPress sites by reducing the amount of time it takes to serve a request. By caching commonly accessed data, such as queries or API calls, Object Caching can eliminate the need to repeatedly fetch the same data from the database. This can improve the speed and responsiveness of the site, resulting in a better user experience.
    • Better Lighthouse Scores: Object Caching can directly impact your Lighthouse Scores. A properly implemented caching strategy will reduce Time To First Byte (TTFB) and First Contentful Paint (FCP) – these metrics are important factors in determining Lighthouse scores. Having a good Lighthouse score is essential for a snappy user experience – and it also improves SEO.
    • Reduced Server Costs: Object Caching can also help to reduce the load on the server. Caching the response of commonly requested database queries leads to a reduction in the number of requests sent to the database. This reduces the load on the server, and ultimately reduces the amount of resources needed to serve the site. This can result in lower hosting costs and better scalability for WordPress sites.

    What is WP_Object_Cache?

    The WordPress engine provides a built-in Object Caching functionality that can be accessed via the WP_Object_Cache class, (a ‘class’ being a blueprint for a way data should be structured). This class acts as a layer between the programmer and the underlying architecture where data is processed. It’s not recommended to use the class directly – you can use pre-defined functions to set, clear, add, and update cache values.

    Object Caching is typically achieved through the use of an external caching solution, such as Redis or Memcached, which acts as a fast, in-memory data store for cached objects. When used correctly, Object Caching can result in significant improvements in page load times, increased website stability, and a better user experience.

    What Are Redis And Memcached?

    Redis and Memcached are open-source database technologies. These are key value store databases which can each be thought of as a dictionary. In other databases, such as MySQL or MongoDB, you can store multiple values in one record, but in a key value database you can only store one value in each record.

    For example, an SQL database can be thought of as a table that contains all the test scores of a student. The student might have scored well in the last exam, or they could have been absent. All this information can be stored in the table, the design of which can be modified to add or remove information.

    SQL table:

    In the case of a key-value database such as Redis there is only one field, and it cannot be modified. This is best visualized by imagining a dictionary which can only hold one definition for one word, and nothing else.

    In this example, a key value store saves the value of a complex query which was run on above database:

    No_of_students_absent2
    Avg_marks_of_Steve24.3

    Redis stores the data in RAM for much faster access compared with storing it on the hard disk. This simple architecture makes Redis, and other similar databases, ideal for storing cached data.

    Both Redis and Memcached are designed to be used with a variety of programming languages and platforms. The key difference between the two is that Redis supports more advanced data structures, such as lists and hashes, while Memcached is simpler and focuses on the efficient storage and retrieval of key-value pairs.

    Object Cache Pro – A Better Caching Solution

    Object Cache Pro is a high-performance Object Caching plugin designed to meet the needs of mission-critical businesses. It offers a combination of performance, scalability, and reliability, which are essential for any high-traffic website. The development team uses test-driven development methodology with over 1,000 unit tests to ensure every update is safe and offers warnings about plugins that can lead to data loss.

    It’s designed to provide a smooth user experience, with tools to help identify issues, built-in query monitoring, and logging. Additionally, it’s fully customizable and works even when Redis is not on the same machine, making it ideal for horizontally scaled environments of two servers or more.

    How To Use Object Caching With WordPress

    If you’re already a RunCloud customer then getting started with Object Caching is very straightforward, as our RunCloud Hub enables you to turn on caching with a few simple clicks.

    With RunCloud Hub you don’t need the expertise of a server administrator to reap the benefits of caching – you can do so by simply installing the RunCloud Hub plugin and enabling the caching option. This installs all of the dependencies automatically, and configures them on your WordPress website.

    For a more detailed guide on configuring caching, refer to our other articles:

    If you’re not using RunCloud yet, you can still use Object Caching in WordPress by installing either the Redis Object Cache or Memcached Object Cache plugin.

    Both of these are popular choices for Object Caching in WordPress, and the decision of which one to use depends on the server environment. Redis Object Cache is known to work well on servers with high CPU usage, while Memcached Object Cache is better suited for servers with limited memory.

    Although these plugins provide a caching functionality for WordPress, they do require you to have access to a caching server. If you are using a shared hosting service you may need to contact your hosting provider for this. If that’s the case, then you should consider switching to RunCloud which makes it easy to manage your servers – and allows you to set up caching with only a few clicks. Sign up for managed hosting with RunCloud today!

    After Action Report – Get All The Benefits of Object Caching When You Deploy With RunCloud

    Improving website loading times is crucial for delivering a positive and responsive user experience, and can directly impact your website’s search engine rankings. Using caching is a smart and cost-effective solution to achieve faster website speeds without having to spend more money on hardware or infrastructure upgrades.

    An absolute essential for any mission-critical business site, let alone any serious website – caching can significantly reduce the load on your database and improve load times by storing the results of expensive computations.

    Whether you choose to set up caching on your server using Redis or Memcached plugins, or use an all-in-one solution such as RunCloud Hub, we’re sure you’ll be pleased to see the benefits of object caching.

    If you aren’t quite comfortable with the idea of deploying servers and setting up object caching entirely from scratch, we’d love for you to give RunCloud a try (for free).

    We built RunCloud so you don’t need to be a system administrator or Linux expert to manage your cloud infrastructure. With everything from backups, staging, cloning, atomic (Git) deployments, and more – we’re on a mission to make it truly enjoyable to manage your own production-grade infrastructure. Learn more & get started today.

    If you have any questions about Object Caching or need help getting started, leave a comment below or tweet us on Twitter. We’ll be happy to help!

  • How to Clone a WordPress Website (An Easy, Step-by-Step Guide)

    How to Clone a WordPress Website (An Easy, Step-by-Step Guide)

    Have you ever wondered how to create a duplicate WordPress website with all of the identical settings and configurations?

    This is where website cloning comes in.

    Website cloning is the process of creating an exact replica of an existing website. It’s a popular practice among website developers and designers to clone websites for both testing new features or designs, and building new websites faster.

    In this article, we’ll provide you with an easy, step-by-step guide on how to clone a WordPress website. Whether you’re a web developer, designer, or simply curious about cloning your website, this guide will show you exactly how to achieve this.

    How To Clone A WordPress Website

    To clone your WordPress website on RunCloud, you don’t need to install any additional plugins. The entire process from cloning the database to setting up the domain can be done entirely from within the RunCloud dashboard itself – and all within 60 seconds!

    Let’s see how to clone a WordPress site with RunCloud in under a minute.

    Go to your RunCloud dashboard and open the menu of the website that you want to clone. In the left submenu, look for the “Cloning” button to make a duplicate copy of your website.

    Cloning an application on RunCLoud

    If you have more than one server connected to your RunCloud account, you can deploy the clone to a different server. In the “Clone Web Application” submenu, select the name of the server where you want to deploy your new application.

    Next, make sure you check the “Clone Database” option to create a new database with all of the posts and comments. Once you check it off, a new dropdown menu will appear asking you to select the database that you want to clone – select the database starting with the name of your existing application.

    After selecting the database, you will need to give a descriptive name to it, and provide a suitable name for the web application (website).

    Cloning a website using RunCloud utility

    Once you have configured all the above settings, you’ll need to specify the owner of this new application. If this is a test website, we highly recommend you create a new user – this isolates the application in the event of a security breach – minimizing the exposure of other applications on the same server.

    Next, you need to configure the domain of your website. Specify the domain name that you want to use, and configure the DNS records for it. If you are using RunCloud’s Cloudflare integration, domain names can be configured automatically for your domain.

    However, if you don’t have a registered domain name yet, you can use RunCloud’s test domain and follow along with this tutorial.

    Configuring RunCloud cloning

    After you have added all of the necessary details, click on the “Clone Webapp” button to create a duplicate application and deploy it.

    Once you have cloned the app, you will be redirected back to the dashboard of your original WordPress site. Navigate back to the “Web Applications” tab of your server to see your newly created app.

    listing cloned applications on RunCloud

    After Action Report

    We hope this article on how to clone a WordPress website using RunCloud has been helpful to you. With our step-by-step instructions, you can easily clone any website and make changes to it without affecting the original site.

    If you are interested in learning how to create a WordPress staging site to test new features, we recommend reading our article on How to Create a Staging WordPress Site.

    We encourage you to start using RunCloud to manage your servers. With RunCloud, you don’t need the experience of a Linux administrator to manage your servers – you can easily clone websites, set up a staging environment, and launch your websites without ever needing to open up a Linux terminal. Start using RunCloud today!

    We hope you found this article useful and informative. Don’t hesitate to leave a comment or reach out to us on Twitter if you have any questions or feedback.

  • WordPress Multisite vs. Multiple Sites – Which Is Better?

    WordPress Multisite vs. Multiple Sites – Which Is Better?

    WordPress Multisite is a feature of WordPress that allows you to create and manage multiple websites from a single WordPress installation. It can be a powerful and convenient solution for website owners who want to expand their online presence and reach more customers.

    But how does WordPress Multisite compare to setting up separate WordPress sites for each of your domains?

    Whether you’re a blogger, a small business owner, a large corporation, or a university, you might benefit from using WordPress Multisite to create and run multiple websites with ease.

    In this article, we’ll explain what WordPress Multisite is and how it works. We’ll also explore the advantages and disadvantages of using it compared with using multiple WordPress sites.

    We’ll help you understand the differences between the two approaches and how they affect your website performance, security, maintenance, and scalability. By the end of this article, you’ll be able to decide which option is better for your needs and goals.

    What Is WordPress Multisite?

    WordPress Multisite is a feature that allows you to run and manage multiple websites on a single WordPress installation. In this setup, the sites are not standalone, i.e. they are all interconnected in one way or another. This means that you can create and manage a network of websites from a single dashboard.

    Usually, there is one main site, sometimes also called root site, which is managed by the network administrator. This administrator can create as many sites as needed, and grant access to other users to manage one or more of those sites. This can be configured in such a way that each site has either its own subdomain, or has its own directory.

    One of the biggest advantages of using WordPress Multisite is centralized management. With this approach, you can manage all of your websites from one dashboard. This makes it easy to update plugins, themes, and core WordPress files across all of your sites simultaneously.

    Additionally, you can manage user roles and permissions across your entire network, which saves considerable time and effort.

    Since you’re only using one WordPress installation, a Multisite Network is cost-effective. You don’t need to purchase additional hosting for each site. This can reduce operating costs significantly, especially if you’re managing a large number of sites.

    Since you are using only one server for all your sites with WordPress Multisite, it will be a lot easier to manage and update it. Instead of securing each server separately, you can focus your efforts on hardening one server and keeping it updated. Using a common server saves time and reduces the risk of conflicts that might occur when updating sites individually.

    Multisite networks allow you to build consistency in your brand and design, giving it a more professional look. The ability to update plugins or themes across all websites from a single dashboard also saves a great deal of time, and ensures that your branding and design remain consistent.

    However, while WordPress Multisite has many advantages, there are some potential drawbacks to consider as well. For example, some plugins may not be compatible with WordPress Multisite, and you may need to use separate plugins for certain functionality.

    Additionally, if one site on your network experiences an issue, it can potentially affect all of the sites on your network.

    With that being said, WordPress Multisite is ideal for institutions where each individual needs their own websites. For example, in a university, all professors can have their own website where they publish their course curriculum. Similarly, in a blog about sports, a different site can be given to different people, each with an expertise in a different sport.

    If you want to learn more, read our guide on How to Install and Setup A WordPress Multisite Network.

    Using Multiple Sites in WordPress

    One way of creating and managing multiple websites is to use separate WordPress installations for each of them. This means that each website will have its own database, files, plugins, themes, and settings. If you prefer to have more control over each of your websites, then using multiple sites might be a better option.

    The primary reason for using multiple sites is more control over each individual site. Since each has its own installation, you get more control over the site’s design, functionality, and content. This can be especially important if you have specific requirements for each of them.

    Using multiple WordPress sites is a great option for businesses who want to create niche affiliate marketing websites. This way, you can have more control and flexibility over each site, and tailor it to your specific niche and audience. You can also use different themes, plugins, and settings for each site to optimize them for conversions. If you’re looking for a better way to run multiple niche affiliate marketing websites, this approach is for you.

    When using multiple WordPress sites, you have the option to either host them on the same server, or on different servers. This gives you more flexibility and control over your hosting resources and performance. Since these are independent sites, each site administrator can choose any plugins or themes that they want.

    When you are running sites on separate servers, you have the flexibility to scale server resources for each site depending upon its needs. This can help ensure that each site is running optimally, and doesn’t experience any performance issues.

    Moreover, having sites on different servers isolates them. If one of your sites gets hacked, you might have a fighting chance to save all the other sites. You can even take extreme steps such as taking down the entire website without worrying about its impact on other sites.

    Using multiple WordPress sites can have some benefits, but it also comes with some challenges. You may need to spend more time and resources managing multiple installations, and may need to hire more technical staff. You may also have to buy separate licenses for some themes or plugins for each site, depending on the developer’s policy.

    In contrast, with a multisite network, some plugins such as PublishPress may allow you to use a single license for the whole multisite network, while other plugins such as WPForms or The Events Calendar may require you to purchase a multisite license or a license for each site in the network. You should always check the terms and conditions of the theme or plugin before using it on multiple sites.

    How to Choose Between Multisite and Multiple Sites

    After considering the two approaches, it’s clear that both have their advantages and disadvantages. Let’s take a look at additional factors that you should consider when deciding to host your website.

    How Related Are the Sites?

    A major factor to consider is how related the sites are to each other. A multisite network only makes sense if all your sites belong to an umbrella organization or follow a common objective.

    For example, you might use a multisite network to create sites for different departments, locations, or products of your business. Or you might use it to create sites for different courses, faculties, or student groups at your school.

    However, if you plan to host vastly different content from different sources and audiences, a multisite network is not the right choice.

    For example, if you want to create sites for different clients, niches, or projects that have nothing to do with each other, a multisite network will not be beneficial. In fact, it might cause more problems than it solves. The sites will share the same database, files, plugins, and themes, which can create conflicts and potentially present security risks. The sites will also be harder to manage and maintain as the network grows.

    Budget

    The cost of running the sites can vary dramatically depending on your setup, such as the hosting plan, the number of sites, and the resources they consume. If you are using a cloud provider, they will charge you separately for each server, storage, network traffic, and IP address. This can add up quickly if you have many sites on different servers.

    If you want to save some money, you might consider hosting all of the sites on one server and sharing the resources. You can do this by using either a multisite network or multiple sites. However, keep in mind that a multisite network can only run on one server, while multiple sites can be moved to different servers later if needed.

    Scalability

    Another key factor to consider is how well your sites can handle traffic spikes. If you use a multisite network, you’ll have to share the same server resources for all the sites in the network.

    This means that if you need to scale your server up (or down), you will affect all of the sites at once. But if you use multiple sites on different servers, you can easily scale up individual sites without impacting the performance of other sites.

    How Often You Need to Create New Sites

    If you will need to frequently set up more sites in the future, WordPress Multisite is the right choice for that, as it makes adding new sites easy and doesn’t require creating new WordPress installations from scratch.

    Maintenance

    If you use multiple WordPress sites, the process of managing them will become more difficult as you add more sites. You will have to log in to each site separately, update the plugins and themes, and perform backups and security checks.

    Moreover, if you host your sites on different servers, you might accidentally delete a server that hosts a site that you still need.

    WordPress Multisite can be easier to maintain because you can manage all of your sites from one dashboard. You can update the plugins and themes for the entire network, perform network-wide backups, and monitor the security of all your sites.

    Control and Functionality

    If you want to have full control over each site and customize it to your specific needs, you might prefer to use separate WordPress installations for each site. This way, you or the site administrator can make changes to the site without affecting other sites. You can choose the plugins, themes, and settings that work best for your site and its audience.

    However, if you want to have a more convenient and efficient way to manage all of the sites at once, you might want to use WordPress Multisite. This feature allows you to create and run multiple sites from a single WordPress installation and dashboard. You can access all the sites from the My Sites menu and perform network-wide tasks such as updating plugins, themes, and WordPress core.

    Here are some screenshots that show what a multisite dashboard looks like and how you can perform basic maintenance tasks:

    Viewing all websites on WordPress Multisite network

    This is the multisite dashboard, where you can see an overview of your network and access the network settings.

    In the My Sites menu, you can see all of the sites in your network and quickly switch between them.

    Installing themes on a WordPress network

    This is the Network Themes screen, where the admin can update and install themes for the entire network.

    Conclusion

    As you can see, WordPress offers you two options for creating multiple websites – a Multisite Network or separate installations. Each option has its pros and cons, so you need to consider your needs and goals before choosing one.

    Whether you want to run a large network of sites, or just a few, WordPress has you covered.

    After you have made the decision, you can continue learning – by reading our other articles on WordPress:

    1. How To Install WordPress With RunCloud | Step-By-Step Guide
    2. How to Install and Setup A WordPress Multisite Network
    3. Load Balancing For WordPress — What It Is & How It Works
    4. Install And Configure Object Cache Pro for WordPress

    RunCloud is the ultimate solution for managing multiple WordPress websites or WordPress Multisite networks.

    With RunCloud, you can control all of your servers and web apps from a single dashboard, saving you time and hassle. You can also enjoy features such as automated backups, security scans, performance optimization, and more.

    Don’t miss this chance to take your WordPress management to the next level. Sign up for RunCloud today!