How to Change the PHP Version and php.ini Settings
How to change PHP version: choosing a version in cPanel and DirectAdmin, upgrading safely, and php.ini settings like memory_limit and upload_max_filesize.

Contents
The PHP version is the version of the PHP interpreter that runs your website's code. WordPress, Laravel and other PHP software run faster and more securely with each new PHP version, while a version that has reached end of life no longer receives security updates. On shared hosting, you can change your PHP version from the control panel in a few clicks and edit settings like memory_limit and upload_max_filesize from the same place.
This guide covers upgrading the PHP version safely, choosing a version in cPanel and DirectAdmin, the most commonly changed php.ini settings and running several PHP versions on your own server.
Why keep your PHP version up to date?
- Security: Each PHP version receives security updates only for a set period. Vulnerabilities found in a version that has reached end of life are no longer fixed.
- Speed: New PHP versions usually run the same code faster and with less memory.
- Compatibility: Over time, plugins, themes and libraries drop support for old PHP versions. Staying current lets you keep your software up to date too.
You can see which versions are still supported on the Supported Versions page at php.net.
Before upgrading: safe steps
- Take a backup. Make sure you have a recent backup of your files and database.
- Update your software. Bring WordPress core, plugins and themes to their latest versions; most compatibility fixes come with these updates.
- Check compatibility. Plugins that haven't been updated in a long time and old hand-written code are the riskiest parts.
- Test first if you can. Trying the new version on a test (staging) copy prevents surprises on the live site.
- Go step by step. If you're coming from a very old version, going through the versions in between instead of jumping straight to the newest one makes problems easier to find.
Changing the PHP version in cPanel
In cPanel, the PHP version is changed per domain from the MultiPHP Manager screen:
- Open MultiPHP Manager.
- Tick your domain in the list.
- Choose the new version from the PHP Version menu at the top right and click Apply.
Servers that use CloudLinux also have a Select PHP Version screen; from there you can manage not only the version but also the enabled PHP extensions (for example intl, imagick, redis) and some settings.
Changing the PHP version in DirectAdmin
In DirectAdmin, the PHP version is chosen in the domain's settings from the versions installed on the server. In the user panel's PHP version selection or Select PHP Version section, choose your domain and the version you want, then save. The versions you can choose are limited to those your provider has installed on the server.
Checking after the change
- Open and try the home page, inner pages, forms, the admin panel and the checkout steps, if you have them.
- Look at the error log in your control panel; warnings and errors that appear with the new version show up here.
- If something goes wrong, switch back to the old version from the same screen, update or replace the problematic plugin and try again.
If the site shows a white screen or a 500 error, the steps in our HTTP error codes article will help you find the problem.
Commonly changed php.ini settings
| Setting | What it does | Common value |
|---|---|---|
memory_limit | The maximum memory a script can use | 256M |
upload_max_filesize | The maximum size of a single uploaded file | 64M |
post_max_size | The total data that can be sent with a form | 64M |
max_execution_time | The maximum time a script can run (seconds) | 120 |
max_input_vars | The maximum number of fields in a form | 3000 |
post_max_sizeshouldn't be smaller thanupload_max_filesize.- The Allowed memory size exhausted error shows that
memory_limitisn't enough, while errors on large file uploads show that the upload limits are too low. - If large menus and forms with many fields don't save, increase
max_input_vars.
In cPanel, you can change these settings from the MultiPHP INI Editor or the Select PHP Version → Options screen, and in DirectAdmin from the PHP settings section. Raise the values only as much as you need; very high limits can let a faulty script use up the server's resources.
PHP version on your own server (VPS)
On your own server, you usually connect PHP to the web server with PHP-FPM. On Ubuntu, the distribution's repository offers a single PHP version; if you need several versions, widely used third-party PHP repositories are the usual route. Each version runs as a separate service (for example php8.3-fpm), and in Nginx each site is pointed to the socket of the version it needs:
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
You can see which version is used on the command line with php -v; the version used on the command line can differ from the one the web server uses. Each version has its own settings files (for example /etc/php/8.3/fpm/php.ini); restart the matching PHP-FPM service after making changes. We cover Nginx configuration in our How to install Nginx guide.
PHP at Nodesty
On Nodesty web hosting plans, you can choose your PHP version through cPanel or DirectAdmin and edit php.ini settings from the control panel; the LiteSpeed web server and CloudLinux isolation keep your PHP sites fast and stable. If you want to fully manage several PHP versions and PHP-FPM settings yourself, our AMD Ryzen 9 9950X VPS plans give you full root access. To speed up WordPress, take a look at our How to speed up a website guide too.
Frequently Asked Questions
Which PHP version should I use?
Use the newest version that your site and plugins support and that still receives security updates. Newer versions are usually faster and more secure. A version that has reached end of life no longer receives security updates; you can see the current support schedule on the supported versions page at php.net.
Will changing the PHP version break my site?
Old plugins, themes or hand-written code can throw errors if they use features that were removed in the new PHP version. That's why you should take a backup before switching, update your plugins and check all the important pages of your site after the change. If something goes wrong, switching back to the old version takes a few clicks.
How do I find out my current PHP version?
The PHP version screen in your control panel shows the version selected for your domain. In WordPress, the Tools → Site Health page also lists the PHP version. On your own server, you can use the php -v command on the command line; however, the version used on the command line can differ from the one the web server uses.
I get a size limit error when uploading files. What should I do?
Raise the upload_max_filesize and post_max_size settings to a value larger than the file you want to upload; post_max_size shouldn't be smaller than upload_max_filesize. If you use Nginx on your own server, you also need to increase the client_max_body_size setting.
What does the "Allowed memory size exhausted" error mean?
It means a PHP script went over the memory limit set by the memory_limit setting. Raising the limit by a reasonable amount usually solves the problem. If the error continues even though the limit is already very high, the problem is most likely a plugin that wastes memory.
Can I use a different PHP version for each domain?
In cPanel's MultiPHP Manager screen and similar tools, you can choose a separate PHP version for each domain. On your own server, you can install several PHP-FPM versions and point each site to a different version. This is useful when you need to keep an old project in the same account as a new site.
About the author
Nodesty Team · Infrastructure & Support
The Nodesty team runs our servers, network and DDoS protection day to day and answers customer support requests around the clock. These guides come from that work.
Related articles

What Is a Subdomain and How Do You Create One?
What is a subdomain and how do you create one? Subdomains with DNS records, creating one in cPanel and DirectAdmin, pointing it to a game server, and SSL.

What Is Bandwidth and Traffic? Calculate Your Needs
What is bandwidth, and how does it differ from traffic? Mbps vs. MB/s, port speed, unlimited traffic, sizing for websites and game servers, and monitoring.

HTTP Error Codes: What Are 403, 404, 500, 502 and 503?
What do HTTP error codes mean? Causes and fixes for 403 Forbidden, 404 Not Found, 500 Internal Server Error, 502 Bad Gateway, 503 and 504 errors.