Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

How to change PHP version / handler for a domain or all domains in Plesk

 
domainsfastcgigohostingphp

Question

How to change PHP version / handler for a domain or all domains?

Answer

 

For a domain
For selected/all domains in Plesk for Linux
For selected/all domains in Plesk for Windows Server

 

  1. Log in to Plesk.

  2. Go to Domains > example.com > PHP Settings.

  3. Select required PHP version and/or PHP handler from the drop-down list.

  4. Apply the changes.

 

  1. Connect to the Plesk server via SSH.

  2. Generate a file with all domains:

    # plesk bin site --list > domains.txt

  3. (Optional) Open the file in a text editor and remove those domains that should not have their PHP version/handler changed.

  4. List all installed PHP handlers:

    # plesk bin php_handler --list

  5. Change PHP version/handler for the domains listed in domains.txt file using the command below:

    Note: Replace <php_handler> with <id> of a PHP handler from step 4.

    # cat domains.txt | while read i; do echo "[+] Updating domain: $i"; plesk bin domain -u $i -php_handler_id <php_handler>; done

    In the example below, the command will assign Plesk PHP 8.3 served by PHP-FPM:

    # cat domains.txt | while read i; do echo "[+] Updating domain: $i"; plesk bin domain -u $i -php_handler_id plesk-php83-fpm; done

     

To change the PHP version for all domains that use a specific PHP version, follow these steps:

  1. Create a list with the names of all domains that use a particular PHP version (in this example, PHP 7.4 FastCGI):

    # plesk db -sNe "select name from hosting h,domains dom where dom.id = h.dom_id and php = 'true' AND php_handler_id LIKE 'plesk-php74-cgi'" > domains.txt

  2. Switch these domains to another PHP version (in this example, PHP 8.3 FastCGI):

    # cat domains.txt | while read i; do echo "[+] Updating domain: $i"; plesk bin domain -u $i -php_handler_id plesk-php83-fpm; done

 

 

  1. Connect to the Plesk server via RDP.

  2. Start a command prompt as an Administrator.

  3. Generate a file with all domains:

    C:> plesk bin site --list > C:domains.txt

  4. (Optional) Open the file in a text editor and remove those domains that should not have their PHP version/handler changed.

  5. List all installed PHP handlers:

    # plesk bin php_handler --list

  6. Change PHP version/handler for the domains listed in domains.txt file using the command below:

    Note: Replace <php_handler> with <id> of a PHP handler from step 5.

    C:> for /f "tokens=*" %d in ('type C:domains.txt') do plesk bin domain -u %d -php_handler_id <php_handler>

    In the example below, the command will assign Plesk PHP 8.3:

    # for /f "tokens=*" %d in ('type C:domains.txt') do plesk bin domain -u %d -php_handler_id fastcgi-8.3

 

To change PHP version / handler for all domains that use a specific PHP version, follow these steps:

  1. Create a list with the names of all domains that use a particular PHP version (in this example, PHP 5.6 FastCGI):

    C:> plesk db -sNe "select name from hosting…

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Securing the WordPress Frontier with WP Guardian

Read More »

Introducing WP Guardian Vulnerability Protection: Now available for WP Toolkit

Read More »

Ruby on Rails vs PHP: Which one’s right for your needs?

Read More »
Knowledge Base

How to find and edit PHP configuration files in Plesk for a domain or for global PHP handler

Read More »

Which PHP version and PHP handler should be chosen for the domain in Plesk

Read More »

Websites on PHP-FPM are not available and there is a php-fpm process that consumes 100% CPU on Plesk server

Read More »

 An operation fails in Plesk: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘X’ for key ‘PRIMARY’

Read More »

Hosting Wiki

  • Django
  • Server Redundancy
  • Google Cloud CDN
  • CGI
  • Bare Metal Server
  • PhpMyAdmin
  • phpPgAdmin
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • PHP
  • MongoDB
  • Domain
  • Hosting Control Panel
  • Plesk
  • Web Server
  • DNS Server
  • SSH
  • Colocation Hosting
  • Reseller Hosting
  • Cloud Hosting
  • VPS Hosting
  • Dedicated Hosting
  • Shared Hosting
  • Free Hosting
  • Managed Hosting
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family