PHP 8 version set in panel, but terminal says it’s not installed !

Discussion in 'Installation/Configuration' started by Keoz, Feb 13, 2021.

  1. Keoz

    Keoz Member

    *** PRODUCTION ENV ***
    Machine : remote VPS 2vCore
    OS distro : Ubuntu 20.04
    Web server : apache 2.4
    Cpanel : ISPConfig 3.2.2

    Hello,

    Memchache is an extension required as one of the prerequisite to install an application.
    I have been trying to install it from command line “pecl install memcache“, and was returned the following output :

    S~# pecl install memcache
    pecl/memcache requires PHP (version >= 8.0.0), installed version is 7.4.15
    No valid packages found

    I then went on verifying what PHP versions are set in ISPConfig, and found that PHP 8 already was.

    *** Q1 ***
    How do I get PHP 8 version activated
    “specifically“ for the application I wish to install… ?

    *** Q2 ***

    After I have read this in another thread on this forum : To get a list of all available php 8 packages after activating the sury repo, you can use: apt-cache search php8

    Do I need sury repo to be installed and activated if planning to make use of PHP 8 version ?
    If yes, how do I get this done ?

    Regards,
     
    Last edited: Feb 13, 2021
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Last edited: Feb 14, 2021
  3. Keoz

    Keoz Member

    I you mean to install sury repo, I did it in the meantime, following instructions from this page :
    https://computingforgeeks.com/how-to-install-php-on-ubuntu-2/
    I also installed memcached this way :
    https://www.howtoforge.com/how-to-install-memcached-on-ubuntu-2004-lts/

    But afterward it makes no difference, the output remains the following, as result for “pecl installl memcache“ command line :

    S~# pecl install memcache
    pecl/memcache requires PHP (version >= 8.0.0), installed version is 7.4.15
    No valid packages found

    *** Q1 ***
    Why do the output still requires to install PHP 8
    (that is by default already set in ISPConfig / system section) ?

    *** Q2 ***
    Could it be that the way I installed memcache (see first link above) is redundant with command line “pecl installl memcache“ instructed by the provider of the application that I am trying to install ?
     
    Last edited: Feb 15, 2021
  4. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Why do you still need to use pecl? Have you done apt install php-memcached? If it is already installed, it should be available already. I am not sure if there is a specific php8.0-memcached as stated by the first tutorial, but if there is and you also need it, you can try to install it. I believe second tutorial got it right already which is what I said earlier, php-memcached.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    You can't use PHP 8 as the default PHP version, PHP 8 is not really downwards compatible with PHP 7.x so many websites will fail, and also ISPConfig will fail if you would set default PHP to 8, so don't change the default PHP version of the OS. You can use PHP 8 as additional PHP version for websites, see:

    https://www.howtoforge.com/tutorial...fig-3-from-debian-packages-on-debian-8-and-9/

    The difference for Ubuntu systems is that you use the sury ppa instead of the debian sury repo.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Btw, the guide from computingforgeeks will break your ISPConfig setup as it replaces the default PHP version, to fix it, set the default php version back to the original one.
     
  7. Keoz

    Keoz Member

    Because “apt install memcache“ installs memcache itself and that “pecl instal memcache“ installs memcache extension for PHP, that is required as a prerequisite prior to install Horde Groupware Webmail Edition (section 5/ Additionnal PECL modules) : https://www.horde.org/apps/webmail/docs/INSTALL

    More info found here for memcache (step 1) and for memcache extension (step 4) :
    https://www.techoism.com/install-memcached-with-pecl-memcache-on-ubuntu/

    Yes I did, but it does not prevent the following output for “pecl install memcache“.

    After further browses on the web, this is what I found that partly explains why the output for “pecl install memcache“ says No valid packages found :

    Uploading this package to my server should solved the issue, but I can’t find on the web how to do so :
    • What command line ?
    • Or in what location to load the package if I use my FTP client ?

    So that I am now requiring help for this now.

     
    Last edited: Feb 15, 2021
  8. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    You clearly read @ahrasis' post, as you replied to the first question. Please re-read and reply to the next question. You might even try the advised 'apt install php-memcached'. I'll note there is a second memcache module already packaged for Ubuntu, 'php-memcache', which would also be simple to try if 'php-memcached' doesn't work.

    That doesn't say it is a prerequisite, the actual verbage is, 'RECOMMENDED to be installed if you need advanced functionality.' That's fine, go ahead and install memcache support - but you seem to ignore the advice given here and go about things the hard way, and do not respond to direct questions that would help others help you. That is frustrating to those who take time trying to help you.
     
  9. Keoz

    Keoz Member

    I already knew from reading some of your other posts that I should not install PHP 8 on my server…,.

    That said, all PHP versions (including PHP 8) are by default already set in ISPConfig / system (just like shown in the web page that you gave me this link of).

    As I was also advised to install the sury repo, these are my related questions :

    *** Q ***
    • Is the sury repo role to trigger the activation of PHP 8 for a specific application program ?
    • Am I supposed to do something to help this get done ?
    • If not, how do I make use of the sury repo (what is it needed for) ?
    In other words, how may I verify that PHP 8 is activated for a specific application program ?

     
  10. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Adding that repo allows you to easily install pre-compiled php versions/modules.
    Once you have installed the php versions you want/need, they should be configured as "Additional PHP Versions" in ISPConfig. Then you create a website in which you are installing your application (horde), and select the PHP version for it which you wish to use.
     
  11. Keoz

    Keoz Member

    If you read my post right before the one where @ahrasis' asked me questions, you will note that he was informed yet that I did already install memcached !

    Thank you for this observation !
    I have been mistaking
    and indicated section 4 instead of section 5 of the prerequisites (Additionnal PECL modules) : https://www.horde.org/apps/webmail/docs/INSTALL
    I just made the correction in the targeted post....

    Thank U, I will shortly give this a try, as soon as I get a reply to my today's post at 5:12 PM, upon package “memcache-8.0.tgz“

    Regards,
     
    Last edited: Feb 15, 2021
  12. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    This seems like a simple misunderstanding, you installed memcached - the memcache server - and he suggested installing php-memcached, which is the php (client) side. Checking the tutorial you mentioned, it actually has you install php-memcached under the Configure PHP to Use Memcached section. (Note: I would not install mod_php there, ie. leave the 'libapache2-mod-php' package off the install command, if you don't have it in use, you certainly don't want to needlessly install it.)
     
  13. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Well, I do not think I was confused and in the first post I give a straight answer on how to install php8.0 and memcache extension for php8.0 which is via adding and using Ondrej Sury repo which he claimed he cannot install using pecl.

    Yes, your long answers and questions in your reply to my first reply might be a little too confusing which need a little confirmation, may be because at first you said you did it, following two different guides but yet you still use pecl command to install the extension, while php8.0 and php-memcached are to be installed via apt command?

    But I did say the mentioned howtoforge tutorial has the same guide for php-memcached extension.

    Your latest reply seems to suggest you want to manually compile and install the required extensions, and while I am not against it, do note that you may have to do that again and again manually in the future updates.

    On the other hand, using what are shipped with the OS and its extended repos may save you times in maintaining such future updates.
     
  14. Keoz

    Keoz Member

    Hi

    Hereafter is the check-list of all items that have been installed or added (hope nothing was forgotten) ; and in ISPConfig, I additionally I changed the relevant website php setting from default to PHP8 (e.g. “groupware.domain-name.net“)

    1) memcache server : apt-get install memcached libmemcached-tools -y
    https://www.howtoforge.com/how-to-install-memcached-on-ubuntu-2004-lts/

    2) memcache php client :
    apt-get install apache2 libapache2-mod-php php php-cli php-memcached -y
    https://www.howtoforge.com/how-to-i...untu-2004-lts/#configure-php-to-use-memcached

    3) Ondřej Surý PPA repo : apt-get install apache2 libapache2-mod-php php php-cli php-memcached -y
    https://computingforgeeks.com/how-to-install-php-on-ubuntu-2/

    *** Q ***
    Would you say that it is now redundant to execute the “pecl install memcache“ command, (as instructed in the Horde installation prerequisites), or that I should not pay attention to what this command outputs (here below) ?

    S~# pecl install memcache
    pecl/memcache requires PHP (version >= 8.0.0), installed version is 7.4.15
    No valid packages found

    This was because I though it could help me to get rid of the output described under my question right above.
    But that’s probably not the solution, and I effectively prefer to avoid doing this at each update.
     
  15. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    not sure it'll help with your wider issues, but for pecl memcache try:
    Code:
    pecl -d php_suffix=8.0 install memcache
    pecl uninstall -r memcache
    
    The uninstall line is necessary otherwise installing it will remove any previously installed version, even if it was for a different PHP version (ex: Installing an extension for PHP 7.0 would remove the 5.6 version if the package was still registered as installed).
     
  16. Keoz

    Keoz Member

    Hello,

    Memcached server being already installed, I now first try to understand if Configure PHP to use memcache (case 1) is or not the same thing as in cases below.

    Unless the missing of php.ini directive information in tutorials of cases 1 and 2 means that the settings will apply whatever the website php version is, the tutorials of cases 2 and 4 seems more reliable ways to achieve installing memecache extension, because they do provide php.ini directive and php version related informations :
    I am skill limited upon such a choice, so maybe someone else has a better understanding of what may be most reliable, or may better match with the use of ISPConfig panel.

    Regards,
     
    Last edited: Mar 1, 2021
  17. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    If case 2 resolves things, that's what I'd do, as it's simple and you don't have to maintain locally installed extensions.
     
    ahrasis likes this.
  18. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I agree with @Jesse Norell as that is what I was trying to say before.
     

Share This Page