Skip to content

Register now for our Web Enablement Ecosystem webinar!

  • Contact us: +34 944 58 06 58
  • Plesk Partner Program
  • Plesk Lifecycle Policy
  • Blog
  • Contact us
  • Plesk 360
  • Contact us: +34 944 58 06 58
  • Plesk Partner Program
  • Plesk Lifecycle Policy
  • Blog
  • Contact us
  • Plesk 360
  • Solutions
    By Role
    • Developers
    • Content Managers
    • Digital Agencies
    • IT Admins
    • Web Hosters
    • Hyperscalers
    • Developers
    • Content Managers
    • Digital Agencies
    • IT Admins
    • Web Hosters
    • Hyperscalers
    By Edition
    • Web Admin Edition
    • Web Pro Edition
    • Web Host Edition
    • Business & Collaboration
    • Plesk WP Edition
    • Web Admin Edition
    • Web Pro Edition
    • Web Host Edition
    • Business & Collaboration
    • Plesk WP Edition
    By Cloud
    • Amazon Web Services
    • Microsoft Azure
    • Alibaba Cloud
    • GCP Marketplace
    • Vultr
    • DigitalOcean
    • Linode
    • UpCloud
    • Amazon Web Services
    • Microsoft Azure
    • Alibaba Cloud
    • GCP Marketplace
    • Vultr
    • DigitalOcean
    • Linode
    • UpCloud
    Partner Program
    Exclusive discounts, benefits and exposure to take your business to the next level
    Become a partner
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    Explore Features
    • Everyone
    • Admins & Web Hosters
    • Developers
    • Designers & Agencies
    • Plesk Features
    • Everyone
    • Admins & Web Hosters
    • Developers
    • Designers & Agencies
    • Plesk Features
    Key Topics
    • SocialBee
    • WP Toolkit
    • Sitejet Builder
    • SEO Toolkit
    • Joomla! Toolkit
    • Plesk Premium Email
    • Plesk Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder
    • SEO Toolkit
    • Joomla! Toolkit
    • Plesk Premium Email
    • Plesk Email Security
    Feature Packs
    • Business & Collaboration
    • WP Pack
    • Hosting Pack
    • Power Pack
    • Language Pack
    • Business & Collaboration
    • WP Pack
    • Hosting Pack
    • Power Pack
    • Language Pack
    Featured Extension
    SocialBee
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • Extension
  • Pricing
  • Extensions
  • Help Center
  • More
    • Careers
    • Events
    • Plesk University
  • FREE TRIAL
  • Solutions
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder
      • SEO Toolkit
      • Joomla! Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • SocialBee
  • Pricing
  • Extensions
  • Help center
  • More
    • Careers
    • Events
    • Plesk University
    • Blog
    • Plesk Partner Program
    • Contact Us
  • FREE TRIAL
  • Solutions
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder
      • SEO Toolkit
      • Joomla! Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • SocialBee
  • Pricing
  • Extensions
  • Help center
  • More
    • Careers
    • Events
    • Plesk University
    • Blog
    • Plesk Partner Program
    • Contact Us
  • 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

Industry
Partners

industry-partner_ALIBABA
industry-partner_GOOGLEPARTNER
industry-partner_MICROSOFT
industry-partner_REDHAT-r2
industry-partner_ALIBABA
industry-partner_AUTOMATTIC
industry-partner_AWS
industry-partner_DIGITALOCEAN
industry-partner_SCALEWAY
Follow us:
Facebook Twitter Linkedin Youtube Github

COMPANY

About Plesk
Our Brand
Legal
Careers
Impressum

PRODUCT

Pricing 
Extensions
What’s new

KNOWLEDGE BASE

Documentation
Help Center
Migrate to Plesk
Contact Us
Hosting Wiki
Preview releases

PROGRAMS

Contributor Program NEW
Partner Program
Affiliate ProgramNEW

COMMUNITY

Blog
Forums 
Plesk University

First defaul

Company

About Plesk
Our Brand
Legal
Careers
Impressum

PRODUCT

Pricing 
Extensions
What’s new

KNOWLEDGE BASE​

Documentation
Help Center
Migrate to Plesk
Contact Us
Hosting Wiki
Preview releases

PROGRAMS​

Contributor Program NEW
Partner Program
Affiliate ProgramNEW

COMMUNITY​

Blog
Forums
Plesk University

Follow us:
Facebook Twitter Linkedin Youtube Github

© 2025 WebPros International GmbH. All rights reserved. Plesk and the Plesk logo are trademarks of WebPros International GmbH.

Managed with love with Plesk WP Toolkit