Steps to Change PHP Version in SiteWorx
Log In to SiteWorx
- Access your SiteWorx login page, typically at https://yourdomain.com:2443/siteworx/ or you can use your Client Control Panel to login
- Enter your username and password, then click "Login."
Navigate to the Hosting Features Section:
- Once logged in, look for the "Hosting Features" section in the main dashboard.
- In the left-hand sidebar, look for the "CloudLinux" section and click on "Php Selector."
- Alternatively, you can use the search bar at the top of the page and search for “Php Selector”
Choose the PHP Version:
- In the "PHP Version" dropdown, you will see the available PHP versions (e.g., 7.0, 7.4, 8.0, etc.).
- Select the PHP version you want to use from the dropdown menu.
Apply the Changes:
- Once you’ve selected the PHP version, click the "Set as current" button to save the changes.
Configure PHP Extensions (Optional):
- Below the PHP version selection, you'll find a list of PHP extensions (such as mbstring, pdo, curl, etc.).
- You can enable or disable specific extensions based on your website’s requirements by checking or unchecking the boxes.
Save Changes:
- After enabling the required PHP extensions, the server saves automatically.
Check Your Website:
- Visit your website to ensure it’s running correctly with the new PHP version. If you encounter issues, you can return to Siteworx and switch back to a previous version.
Verify the PHP Version (optional):
- You can verify the changes by creating a PHP info file. Create a file called phpinfo.php with the following code:
<?php
phpinfo();
?>
- Upload this file to your website’s root directory and access it via your browser (yourdomain.com/phpinfo.php) to see the current PHP version running.
Notes:
- Make sure your website's applications (such as CMS, themes, and plugins) are compatible with the PHP version you choose.
- Always back up your website before making major changes to the server configuration.
In Siteworx, PHP limits refer to configurable settings that determine how PHP scripts behave on your server. These limits control the resource allocation for PHP processes, such as memory, file size, execution time, and more. Adjusting these values helps optimize performance, avoid server overloads, and ensure compatibility with certain applications (e.g., CMS platforms like WordPress or Joomla).
- While you are still on the Select PHP version page, click on “Switch to Options" Tab.
Here are the common PHP limits you can manage in Siteworx:
Memory Limit (memory_limit):
- Definition: This setting controls the maximum amount of memory a PHP script is allowed to allocate.
- Purpose: Prevents poorly written scripts from using excessive resources and crashing the server.
- Example: If you are running a CMS or e-commerce platform, increasing the memory limit might be required for complex processes like image handling or large database queries.
- Default Value: Often set between 64MB and 128MB.
- Typical Increase: 256MB, 512MB.
Upload Max Filesize (upload_max_filesize):
- Definition: Defines the maximum size of files that can be uploaded via PHP scripts.
- Purpose: Limits the size of file uploads to prevent server overloading.
- Example: If you’re uploading large media files, images, or videos, you might need to increase this value.
- Default Value: Typically set at 2MB or 8MB.
- Typical Increase: 32MB, 64MB, 128MB, depending on the server resources.
Max File Uploads (max_file_uploads):
- Definition: Limits the number of files that can be uploaded simultaneously in one request.
- Purpose: Prevents server overloads due to multiple file uploads.
- Default Value: Often set to 20.
- Typical Increase: 50, 100, or more depending on your use case.
Modify PHP Limits:
- You'll see a list of PHP directives, such as memory_limit, upload_max_filesize, post_max_size, etc.
- Click on the value next to the setting you want to change, and either type a new value or select one from the dropdown.
Save Changes.
Be cautious not to set the values too high, as this could lead to excessive resource usage on your server, affecting its performance.