UnderHost
Knowledgebase Docs

How to change PHP version in aaPanel

Install multiple PHP versions in aaPanel and assign a different version per website. Adjust PHP settings like memory_limit and upload_max_filesize through th...

On this page

aaPanel supports multiple PHP versions simultaneously. Each website can run a different PHP version. You install PHP versions from the App Store, then assign them per site from Website settings.

Install a PHP version

  1. Log in to aaPanel and go to App Store
  2. Search for PHP or browse the Runtime Environment section
  3. Find the PHP version you need (e.g., PHP 8.1) and click Install
  4. Wait for the installation to complete-this may take a few minutes

You can install as many PHP versions as your server RAM can support. Each version runs as a separate PHP-FPM service.

Assign PHP version per site

  1. Go to aaPanel → Website
  2. Find your site and click on the site name to open settings
  3. Click the PHP version tab or option
  4. Select the PHP version from the dropdown
  5. Click Save

The change takes effect immediately-PHP-FPM for the site switches to the selected version. Reload your site in a browser and verify it is working.

Adjust PHP settings

PHP configuration is managed per version in aaPanel. Settings adjusted here apply to all sites using that PHP version:

  1. Go to App Store → Installed → PHP X.X → Settings
  2. Click php.ini to view and edit the raw configuration file
  3. Or use the configuration form if your aaPanel version provides one

Common settings to adjust:

SettingRecommended value for WordPress
memory_limit256M
upload_max_filesize64M
post_max_size64M
max_execution_time120
max_input_vars5000

After changing php.ini, restart PHP-FPM: aaPanel → App Store → PHP X.X → Reload.

Per-site PHP settings override

If you need different settings for one site, create a user.ini file in the site's document root (/www/wwwroot/yourdomain.com/) with the overrides. PHP-FPM reads this file and applies it to that site only. Use the same format as php.ini.

Enable PHP extensions

Extensions are enabled in php.ini. To enable an extension that is already compiled but not active, add a line in the extension section:

extension=redis
extension=imagick

If an extension is not installed at all, install it from the App Store (search for the extension name). After installing, add the directive and reload PHP-FPM.

Verify the active PHP version

Create a temporary phpinfo.php file in the site's document root:

<?php phpinfo(); ?>

Access it at https://yourdomain.com/phpinfo.php. The first line shows the active PHP version. Delete the file immediately after checking-it exposes server configuration details.

Related: Create a website in aaPanel | aaPanel troubleshooting-common issues and fixes | Change PHP version in cPanel | Change PHP version in CloudPanel

Was this article helpful?

Need aaPanel hosting?

Install aaPanel on an UnderHost VPS or dedicated server when you want a simple web interface for sites, databases, SSL, and apps.

Related articles

Back to aaPanel