Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
How to install/remove additional PHP versions provided by Plesk?
Answer
Note: The list of PHP versions available for installation via Plesk Installer is available in this KB article.
Note: Make sure that port 8447 is opened in firewall. If it is closed and cannot be opened, use the command-line instructions below.
-
In Plesk, go to Tools & Settings and click Updates (under Plesk).
-
On the Updates and Upgrades page, click Add/Remove Components.
-
On the Add/Remove Components page, expand:
-
Web hosting > PHP interpreter versions section, if this is a Linux server.
-
Plesk hosting feature section, if this is a Windows server.
-
-
Select required PHP versions for installation/uninstallation and click Continue.
-
Connect to a Plesk server via SSH (Linux) / RDP (Windows Server).
-
Get the list of all available Plesk components (on Windows Server, use a command prompt as an Administrator):
MYSQL_LIN: plesk installer --select-release-current --show-components
-
Install/remove additional PHP versions using the component name from step 2.
Example of the command to install PHP 8.2:
-
for Linux:
# plesk installer add --components php8.2
-
for Windows Server:
C:\> plesk installer add --components php82
Example of the command to remove PHP 5.6:
-
for Linux:
# plesk installer remove --components php5.6
-
for Windows Server:
C:\> plesk installer remove --components php56
-
Comments
16 comments
Hi - this is all fine for the FPM and CGI versions but how do you install the latest PHP-CLI builds? I need these for running symphony etc apps.
Hi @Hywel Jones,
PHP-CLI should be there when you install it as additional component via Plesk. For example, on Debian 9:
# apt search php-cli
Sorting... Done
Full Text Search... Done
php-cli/stable,stable 1:7.0+49 all
command-line interpreter for the PHP scripting language (default)
php-cli-prompt/stable,stable 1.0.2+dfsg-1 all
tiny helper prompting for user input
plesk-php70-cli/stretch,now 7.0.32-debian9.0.18091413 amd64 [installed]
Command-line interface for PHP
plesk-php71-cli/stretch,now 7.1.22-debian9.0.18091413 amd64 [installed]
Command-line interface for PHP
plesk-php72-cli/stretch,now 1:7.2.10-debian9.0.18091411 amd64 [installed]
Command-line interface for PHP
# dpkg-query -L plesk-php72-cli
/.
/etc
/etc/psa
/etc/psa/php_versions.d
/etc/psa/php_versions.d/plesk-php72-cgi.conf
/etc/psa/php_versions.d/plesk-php72-fastcgi.conf
/opt
/opt/plesk
/opt/plesk/php
/opt/plesk/php/7.2
/opt/plesk/php/7.2/bin
/opt/plesk/php/7.2/bin/lsphp
/opt/plesk/php/7.2/bin/phar.phar
/opt/plesk/php/7.2/bin/php
/opt/plesk/php/7.2/bin/php-cgi
/opt/plesk/php/7.2/bin/phpdbg
/opt/plesk/php/7.2/bin/phar
So all binaries are located at /opt/plesk/php/7.2/bin/ (for PHP 7.2). This is actual for other operation systems as well.
@ Alexandr Shadrin
Thanks - that all works fine now - for some reason the day I made the query I was getting the PHP FPM version afting setting PATH=/opt/plesk/php/7.2/bin:$PATH and typing php -v - my Laravel artisan commands were failing with weird errors. Today it is all good !
How can I donwload PHP 7.4?
I have the newest Plesk version:
Plesk Obsidian 18.0.21 Update 4 has been installed
PHP 7.4 is not showing
Hi @Richie Tjin,
I've just checked it on Ubuntu 18 with Plesk Obsidian 18.0.21.4 and it shows for me.
Please try one more time.
Note: php 7.4 isn't supported on CentOS 6, Red Hat Enterprise Linux 6, and CloudLinux 6.
@... and Debian 8 ?
Can't install atm.
@Lenor
I has it in Plesk Obsidian 18.0.23 on Debian 8:
Try to update Plesk to 18.0.23, if still isn't:
So - I too am wanting PHP 7.4
Thanks to Denis from above, I note that I can manually upgrade plesk using command line.
I'm left wondering why I can't see an upgrade being offered on the web interface?
Also the command to upgrade that is listed. Isn't working for me.
Error: `ERROR: Selector 'PLESK_18_0_28' does not match any product ID, release ID, release tier, or release version. Use either 'list' or 'list-all' command to list known entities.`
It might be because operating system you have does not support 18 version. Please check for supported operating systems:
https://docs.plesk.com/release-notes/obsidian/software-requirements/#s2
Another reason might be custom repository, please check if it so using this article.
Can I remove PHP 5 from OS vendor? will it affect my server? I have no websites that use PHP 5.
Spiral arts
Plesk 18 (Obsidian) doesn't use OS PHP. So, update Obsidian in case Plesk Onyx is used and feel free to remove OS PHP.
This Code work for Me.
I use origin repo, because my connection is good to reach that repo.
I want to install PHP 8.0
So i use this code
plesk installer --select-release-latest --install-component php8.0 --download-retry-count 50 --source http://ch.origin.autoinstall.plesk.com/
====
plesk installer --select-release-current --show-components
...
php8.0 [install] - PHP 8.0
php7.4 [up2date] - PHP 7.4
php7.3 [up2date] - PHP 7.3
php7.2 [up2date] - PHP 7.2 (outdated)
php7.1 [up2date] - PHP 7.1 (outdated)
php7.0 [up2date] - PHP 7.0 (outdated)
php5.6 [up2date] - PHP 5.6 (outdated)
php5.5 [up2date] - PHP 5.5 (outdated)
php5.4 [up2date] - PHP 5.4 (outdated)
php5.3 [up2date] - PHP 5.3 (outdated)
php5.2 [up2date] - PHP 5.2 (outdated)
...
@Khairul Fajri
WOW
Olá
Engraçado que só existe repositório de versões antigas para linux.
Onde está o repositório php para versões plesk menores que 5.6?
Thank you
Hello,
I need to add php 7.0 in our Plesk Obsidian 18.0.48 - Debian 10.13
Tried many solutions but still not able to see php7.0 as selectable option in Plesk.
Can someone help?
Hello,
I would like to import a wordpress site on my dedicated server. It's an old site that runs on PHP 5.6.40. How do I install PHP 5.6.40. on my dedicated server?
Debian 11.6 x86_64
Plesk Obsidian Web Host Edition 18.0.48
If you have a command under ssh that allows me to display this php version, that would be really great. Because for the moment the version is not available in the list.
Thank you for your precious help.
Please sign in to leave a comment.