• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Changing PHP CLI version (with symlinks), is that good or bad?

HHawk

Regular Pleskian
Hi all,

I have a question, probably a bit silly, but still I want to make sure.

We are using the following script from Github to change our PHP CLI version. It's a simple script which creates symlinks for the desired PHP version. By default PHP 5.4 is installed as CLI. We also install several other versions of PHP (with the Plesk installer ofcourse). After that we run the script to change it to the desired version, for example PHP 7.0.x.

I never had any issues with this and it's something I personally use on many servers. However someone told me this is "very bad". I don't understand why it's bad. Maybe someone can explain that to me, or is the other person full of nonsense?

I personally don't think there is any harm done by changing the CLI version of PHP through the use of symlinks, but then again, I am no expert on this...
 
* small bump *

I was hoping to get an answer of my question, though it might sound "stupid", I really wish to know this?
 
I think that if something works for you, then this should be enough. If you have problems with the script, come here and Plesk community will help you. Guessing what that dude was talking about is an ungrateful thing.
 
Thanks for replying. His comment was made after I tried to install Installatron. It wouldn't install and he said it was because of I changed the PHP version due to CLI.
However I doubt this is the issue and I have done it several times. Heck, there is even a workaround for it, when PHP 7.0 wasn't yet supported by Installatron.

The "work-around" by Installatron team is explained here: Installatron Troubleshooting Guide

Also that solution didn't work on this server, but I doubt it was caused by me because I created symlinks. But I wanted to make sure.
Because if he is *actually* right, I won't be using this symlink solution anymore.
 
I was setting up a new server (for ourselves) for hosting accounts and therefor I needed to install Installatron once again.
So, as usual, I set up the new server in the same way I normally do, including changing the PHP CLI version with symlinks.

For your information, if I run "php -v" I get the following output now:

Code:
PHP 7.0.25 (cli) (built: Oct 27 2017 12:00:26) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v6.0.7, Copyright (c) 2002-2016, by ionCube Ltd.
    with Zend OPcache v7.0.25, Copyright (c) 1999-2017, by Zend Technologies

In other words I changed the default PHP version to 7.0.

Next I had to install Installatron. And as I mentioned in my previous post, it supports installation on PHP 7.0 (the only version it doesn't support is PHP 7.1).
Installation from SSH, the normal/regular way, went fine without any issues being displayed. See below:

Code:
<snip>
Finished Installing Installatron Plugin!
Installatron Plugin is now accessible as a plug-in/module inside Plesk.
<snip>

But when I go into the Plesk Onyx panel, there is no Installatron button/extension anywhere to be found.

So next I checked the Installatron log and it showed the following error:

Code:
[02-Nov-2017 07:33:17 UTC] PHP Fatal error:  The file /usr/local/installatron/lib/ioncube-encoded-file.php was encoded by the ionCube Encoder for PHP 5.4 and cannot run under PHP 7.0.
 Please ask the provider of the script to provide a version encoded with the ionCube Encoder for PHP 5.6. in Unknown on line 0
[02-Nov-2017 07:33:18 UTC] PHP Warning:  Declaration of Repair_Fetcher::execError($errstr) should be compatible with Fetcher::execError($errstr, $doSkipRemoval = ) in /usr/local/installatron/lib/repair2.php on line 0

I don't understand why it returns this? Because if I check the requirements page of Installatron (Installatron Plugin Frequently Asked Questions) it says and I quote: "PHP 5.6 or 7.0 (at the time of writing (2017-10-21) many of the applications do not yet support PHP 7.1 or newer)"

So PHP 7.0 should actually work right, even if I switched to PHP 7.0 by using symlinks.

Hopefully this provides some insight and maybe someone has an idea?

Thanks in advance.
 
Back
Top