• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Different PHP version for users

Hasina Patrick

New Pleskian
Hello,

My problem is :
- I upgraded the php version on 7.0.16; => it's ok
- I run php on CLI with root . The version is 7.0.16 => it's ok
- But when I run php on CLI with user-no-root , the php version 5.4 (old php version) => not OK
So my question, How to change the php version of the user-no-root?
Thank you
 
What command are you running as root to see 7.0.16 as root? Just php -v? If so, that does not sound right. The default version is 5.4.16 as far as I'm aware and it should not be changed for compatibility purposes with everything else on the server. If you need to make use of different PHP versions for anything run over CLI, you should use the path to the binary file for the version installed through Plesk like:

Code:
[root@h5g5-mfnh ~]# /opt/plesk/php/7.1/bin/php -v
PHP 7.1.3 (cli) (built: Mar 17 2017 11:39:39) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.3, Copyright (c) 1999-2017, by Zend Technologies

[root@h5g5-mfnh ~]# php -v
PHP 5.4.16 (cli) (built: Nov  6 2016 00:29:02)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v5.0.18, Copyright (c) 2002-2015, by ionCube Ltd.
 
My guess ... the user-no-root belongs to a specific domain. Correct?

Go to Plesk panel, locate the domain and change the PHP-version of that domain.

75586.png
 
Thank you,

I see this and the PHP version 7.0.16.
When I do on Command line :
#php --version => it works fine for the root ie 7.0.16
but when I use the user:
user$php --version => The version of php is 5.5....

Thank you
 
Thank you,

I see this and the PHP version 7.0.16.
When I do on Command line :
#php --version => it works fine for the root ie 7.0.16
but when I use the user:
user$php --version => The version of php is 5.5....

Thank you
Just check which path to php interpreter is using for root and for user with command

# whereis php
$ whereis php
 
I send this picture of my php version

Whereis php give the same directory.
 

Attachments

  • Capture d'écran de 2017-03-24 10:54:19.jpg
    Capture d'écran de 2017-03-24 10:54:19.jpg
    135.8 KB · Views: 9
I solved this problem.
This is the way :
- /usr/bin/php link to /etc/alternatives/php
- /etc/alternatives/php link to /usr/bin/php5
So I unlink the second and make:
ln -s /opt/plesk/php/7.0/bin/php /etc/alternatives/php.

Thank you all for the collaboration
 
Back
Top