install php 5.6.30 not working

Discussion in 'Installation/Configuration' started by Sergio Cesar, May 11, 2018.

  1. Sergio Cesar

    Sergio Cesar New Member

    I have followed the instructions here:
    https://www.howtoforge.com/tutorial/how-to-install-php-5-6-on-ubuntu-16-04/
    all seemed to work good but one error
    the cmd: pecl -C ./pear.conf install xdebug
    error:
    checking Check for supported PHP versions... configure: error: not supported. Need a PHP version >= 7.0.0 and < 7.3.0 (found 5.6.30)
    ERROR: `/tmp/pear/temp/xdebug/configure --with-php-config=/opt/php-5.6.30/bin/php-config' failed
    Since it is a debug I didnt think it would affect anything else
    I finished the installation OK.
    moved to configure a site I want to run with php 5.6.30 and set it to use each of the modes PH-FPM and FAST-CGI using PHP-5.6.30
    but it continue to use the original installed php 7.
    I ran phpinfo
    System Linux xxxxxxxx 4.4.0-124-generic #148-Ubuntu SMP Wed May 2 13:00:18 UTC 2018 x86_64
    Server API Apache 2.0 Handler
    Virtual Directory Support disabled
    Configuration File (php.ini) Path /etc/php/7.0/apache2
    Loaded Configuration File /etc/php/7.0/apache2/php.ini
    Scan this dir for additional .ini files /etc/php/7.0/apache2/conf.d
    I double checked the ispconfig path in the step 4 of the howto and they are correct as in the howto.
    Now what? how can I troubleshoot this?
    any logs I can look at?
    any hint would be appreciated.
     
  2. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    did you specify the 5.6 version for pecl?
    Code:
    $which pecl
    $/opt/php-5.3/bin/pecl version
    
    replace path to your php path
     
  3. Sergio Cesar

    Sergio Cesar New Member

    Thanks for your reply.
    here is what I got:
    [email protected]:/opt/php-5.6.30/etc# which pecl
    /usr/bin/pecl
    [email protected]:/opt/php-5.6.30/etc# /opt/php-5.6.30/bin/pecl version
    PEAR Version: 1.10.1
    PHP Version: 5.6.30
    Zend Engine Version: 2.6.0
    Running on: Linux nccu.ncctech.net 4.4.0-124-generic #148-Ubuntu SMP Wed May 2 13:00:18 UTC 2018 x86_64

    I have also try this:
    [email protected]:/opt/php-5.6.30/etc# /opt/php-5.6.30/bin/pecl -C ./pear.conf install xdebug
    pecl/xdebug requires PHP (version >= 7.0.0), installed version is 5.6.30
    No valid packages found
    install failed

    ------------------------------
    do I have to have the debug installed for any to work?
    I expected it to work even without the xdebug installed.
     
  4. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

  5. Sergio Cesar

    Sergio Cesar New Member

    can you be more specific?
    I followed the HOWTO step by step. I have not try anything else that is not there.
    Once again is it a must to get the xdebug working for the PH-FPM and FAST-CGI to work?
    I wish I knew enough to go try other ways but not the case with ispconfig 3 it is my first install.
    if the howto I used is not the correct one what should I have used?
     
  6. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    it is not wrong, just one way to do it.
    It also mentions xdebug is optional. It is used for ... debugging your application :)

    https://launchpad.net/~ondrej/+archive/ubuntu/php/ has some instructions what to do in order to add his repo, which gives you apt-update-able php 5.6 + fpm
     
    ahrasis likes this.
  7. Sergio Cesar

    Sergio Cesar New Member

    Thanks for the link. Unfortunately I am very new to ispconfig, the link does not provide a step by step howto I can feel comfortable attempting. I already have some 35 sites and I am not ready to shut them down if something does not work.

    With that said, I go back to my original question, I am still trying to figure out what I missed or did wrong using the howto, I posted in my first post. the installation seems to be correct the tests show OK,
    Perhaps a bug in ispconfig and apache2 was not configured somehow that is needs to use the old php but I cant find anywhere what needs to take place.
    When I select PH-FPM the file /opt/php-5.6.30/etc/php-fpm.d/web42.conf is created and it has a line
    listen = /var/lib/php7.0-fpm/web42.sock
    I would expect it to be a 5.6.30 and not 7.
    where else can I look to find what the problem is? I can not find where ispconfig configure apache when I select FAST-CGI.
     
  8. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    if you need step by step and can't have anything go wrong, don't try things on live systems. Always try in a virtual machine before deploying to productive servers! ( nope no attempt to force you to use surys repo, just in general ).

    You might have mixed up some paths while configuring your additional php version in ISPConfig.
    However, it can still work having your .sock files in the same var/run directory, ISPConfig first deletes the one for the old php version, then creates the new one.
    As long as the socket is actually created there aswell.

    Go step by step and try again if you can't find the issue. ISPConfig works very well with multiple PHP versions, I don't think a bug is involved here, maybe a bug in the howto / out of date - I don't know.
     
  9. Sergio Cesar

    Sergio Cesar New Member

    Done that a few times.
    just now I had a tiny progress,
    I deleted the site and re added again.
    my .php-fcgi-starter dows now show
    PHPRC="/opt/php-5.6.30/lib/"
    copy my phpinfo.php to the web folder and now it show
    but my site still try to use 7.:(
    ----------------------------------------------------
    PHP Version 5.6.30
    System Linux nccu....... 4.4.0-124-generic #148-Ubuntu SMP Wed May 2 13:00:18 UTC 2018 x86_64
    Build Date May 9 2018 08:28:20
    Configure Command './configure' '--prefix=/opt/php-5.6.30' '--with-pdo-pgsql' '--with-zlib-dir' '--with-freetype-dir' '--enable-mbstring' '--with-libxml-dir=/usr' '--enable-soap' '--enable-calendar' '--with-curl' '--with-mcrypt' '--with-gd' '--with-pgsql' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-zlib' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-pcntl' '--enable-mbregex' '--enable-exif' '--enable-bcmath' '--with-mhash' '--enable-zip' '--with-pcre-regex' '--with-mysql' '--with-pdo-mysql' '--with-mysqli' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--with-openssl' '--with-fpm-user=www-data' '--with-fpm-group=www-data' '--with-libdir=/lib/x86_64-linux-gnu' '--enable-ftp' '--with-imap' '--with-imap-ssl' '--with-gettext' '--with-xmlrpc' '--with-xsl' '--with-kerberos' '--enable-fpm'
    Server API CGI/FastCGI
    Virtual Directory Support disabled
    Configuration File (php.ini) Path /opt/php-5.6.30/lib
    Loaded Configuration File /opt/php-5.6.30/lib/php.ini
    ---------------------------------------------------------------------------
    That is smelling like a bug to me where if the site already exists ispconfig does not handle a switch correctly.
    should I be adding anything in the "Custom php.ini settings" on in the "Apache Directives"?
     
  10. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    I assume you're using systemd - how did you specify the path to PHP-FPM init script?
    It should just be the name - not the complete path, else what you described can happen ( doesn't mean there may be other reasons )
     
  11. Sergio Cesar

    Sergio Cesar New Member

    did just as instructed in the HOWTO
    Path to the PHP-FPM init script: php-5.6.30-fpm
    Path to the php.ini directory: /opt/php-5.6.30/lib
    Path to the PHP-FPM pool directory: /opt/php-5.6.30/etc/php-fpm.d
    It is being very stubborn and does not want to giveup v7
     
  12. ztk.me

    ztk.me ISPConfig Developer ISPConfig Developer

    indeed, xdebug is not working - you have to manually download the 2.5x release.
    Code:
    cd /tmp/
    mkdir xdebug
    cd xdebug/
    wget https://pecl.php.net/get/xdebug-2.5.5.tgz
    tar xf xdebug-2.5.5.tgz
    cd xdebug-2.5.5
    /opt/php-5.6.30/bin/phpize
    ./configure --with-php-config=/opt/php-5.6.30/bin/php-config
    make
    make install
    
    and add the extension-entry to your php.ini file if you like.

    I just created a VM with stock ubuntu 16.04, followed the perfect setup ( which is missing an apt-get install build-essentials for building metronome .... it is mentioned later but needed sooner if you choose the optional step! )

    Besides I didn't face any issue and switching php-versions back and forth works perfectly fine.
     
    till likes this.
  13. Sergio Cesar

    Sergio Cesar New Member

    that is nice. got this one done, Added the entry to the php.ini
    systemctl restart php-5.6.30-fpm.service
    no errors, so now we can do some testing.
    Thanks.
     
    ztk.me likes this.

Share This Page