Multi php versions

Discussion in 'Installation/Configuration' started by Poliman, Feb 3, 2017.

  1. Poliman

    Poliman Member

    Hello. I setup multi php version using https://www.howtoforge.com/how-to-b...e-and-apcu-for-ispconfig-3-on-debian-7-wheezy and when I setup apcu like in tutorial I got warning in console:
    root@vps3424:/opt/php-5.6.30/bin# ./php --version
    PHP Warning: PHP Startup: Unable to load dynamic library '/opt/php-5.6.30/lib/php/extensions/no-debug-non-zts-20131226/apcu.so' - /opt/php-5.6.30/lib/php/extensions/no-debug-non-zts-20131226/apcu.so: cannot open shared object file: No such file or directory in Unknown on line 0
    PHP 5.6.30 (cli) (built: Feb 3 2017 08:52:44)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

    Btw how could I install xcache to this additional php version (if apcu will not work)?
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I am not so sure on how to install xcache on that optional php but acpu will normally work. To get the latest version go to its website. Basically I recently get the latest version for acpu with this:
    Code:
    pecl -C ./pear.conf update-channels
    pecl -C ./pear.conf install channel://pecl.php.net/apcu-4.0.11.tgz
    
    Make sure you are running it from your php-5.6.30 etc folder by "cd /opt/php-5.6.30/etc" first.
     
  3. Poliman

    Poliman Member

    Thank you Ahrasis for answer. What would be better - apcu or xcache? I will check fix depends on answer on this question. ;)
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    For php versions that include opcache like your custom php 5.6, I would use apcu. For older versions without opcache I would use xcache.
     
  5. Poliman

    Poliman Member

    Thank Till for suggestion. I will do like you said.
    The newest version of apcu 5.1.8 https://pecl.php.net/package/APCu will work with php 5.6.30? After use above two command is anything more what should be configured? Currently I have at the end of /opt/php-5.6.30/lib/php.ini:
    Code:
    zend_extension=opcache.so
    ;extension=apcu.so
    ;apc.enabled=1
    ;apc.shm_size=128M
    ;apc.ttl=0
    ;apc.gc_ttl=600
    ;apc.enable_cli=1
    ;apc.mmap_file_mask=/tmp/apc.XXXXXX
    ;apc.mmap_file_mask=/dev/zero
    ;apc.shm_segments = 5
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    I can't say for sure, if it compiles without error, then it should work. just try it.

    remove the ; in front of:

    ;extension=apcu.so

    and then check with e.g. phpinfo() command if you can find apcu in the output.
     
  7. Poliman

    Poliman Member

    Using this command pecl -C ./pear.conf install channel://pecl.php.net/apcu-4.0.11.tgz is compilation?
     
  8. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    acpu version 5.x.x and above is not for php 5.6 but php 7.0 and above. This is clearly stated in their site. Do not install that version. The highest version that works with php 5.6 is 4.0.11 as stated in the website and specified in the command given.
     
    Last edited: Feb 10, 2017
    till likes this.
  9. Poliman

    Poliman Member

    Ok. I will do above two commands and then will uncomment like Till said. Thank You. I will post feedback in next week. Weekend time. ;)
     
  10. Poliman

    Poliman Member

    I have following warning:
    Code:
    root@vps123:/opt/php-5.6.30/etc# pecl -C ./pear.conf install channel://pecl.php.net/apcu-4.0.11.tgz
    downloading apcu-4.0.11.tgz ...
    Starting to download apcu-4.0.11.tgz (119,535 bytes)
    ..........................done: 119,535 bytes
    43 source files, building
    WARNING: php_bin /opt/php-5.6.30/bin/php appears to have a suffix -5.6.30/bin/php, but config variable php_suffix does not match
    running: phpize
    Configuring for:
    PHP Api Version:         20131106
    Zend Module Api No:      20131226
    Zend Extension Api No:   220131226
    Enable full APC compatibility [yes] :
    Btw Should I restart something after install apcu and turn it on in php.ini file? What are possibilities to check that apcu is installed and working? I am asking because "zend_extension=opcache.so" after put to php.ini shows in ./php --version output.
     
    Last edited: Feb 13, 2017
  11. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    That is not right. Something is wrong with your optional php 5.6.30 built. I would start all over if I were you, i.e. remove and install everything again.
     
    Poliman likes this.
  12. Poliman

    Poliman Member

    The problem is that this php built works smoothly with setup website on ISP. Besides I only execute these two commands and add extension=apcu.so in php.ini.
     
  13. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    phphize is using a wrong version thus not saving your install apcu.so into /opt/php-5.6.30/lib/php/extensions/no-debug-non-zts-20131226. I think that means there are two versions of php in that built and it could be using the older one.

    Problem could be due to wrong referral to 5.6.0 instead of 5.6.30 while you are building and setting up your optional php. This happens sometimes.

    But if you think everything is fine, you can simply ignore the warning and proceed (though they will pile up in time). It's your server anyway. ;)
     
  14. Poliman

    Poliman Member

    Installation was proper but You have right with above. Phpize probably use default version of php, which is installed on the server. Probably I fixed this warn by:
    Code:
    sudo pear config-set php_ini /opt/php-5.6.30/lib/php.ini
    sudo pecl config-set bin_dir /opt/php-5.6.30/bin/
    Second thing was line
    Code:
    ;extension=apcu.so
    which I added manually but as I saw at the end of installation process "Extension apcu enabled in php.ini" this mod was automatically enabled in php.ini, so there were two lines - manually added and automatically added extension="apcu.so". But still after execute
    Code:
    ./php --version
    I haven't info about APC, only this:
    Code:
    PHP 5.6.30 (cli) (built: Feb  3 2017 08:52:44)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
        with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    
     
    Last edited: Feb 13, 2017
  15. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Always make sure when installing apcu for that php 5.6.30 you are in its directory /opt/php-5.6.30/etc. If that all is ok now, remove ; at the beginning of the acpu line in the php.ini for that 5.6.30.
     
  16. Poliman

    Poliman Member

    Yes, I did it from /opt/php-5.6.30/etc directory and I remove ";" but I still have output (should be any information about apcu?):
    Code:
    root@vps342401:/opt/php-5.6.30/bin# ./php --version
    PHP 5.6.30 (cli) (built: Feb  3 2017 08:52:44)
    Copyright (c) 1997-2016 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
        with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
    Put
    Code:
    apc.enabled=1
    in php.ini is required too and
    Code:
    service php-5.6.30-fpm restart
    ?
     
    Last edited: Feb 14, 2017

Share This Page