• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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