Dev Loots Dev Loots - 5 months ago 24
PHP Question

Get and install specific php version with aptitude

Today, current PHP version is Php7.0.8 and I would like get and install Php7.0.5 with aptitude. For example, it's possible with the dotdeb repository ?

How I can get specific php version with aptitude on Debian 8 Jessie ?

Answer

You can install php7.0.5 with :

  • First, get archive for install :

    wget http://www.php.net/distributions/php-7.0.5.tar.xz
    
  • Next, extract the file :

    tar xvfJ php-7.0.5.tar.xz
    
  • Go into directory extracted :

    cd php-7.0.5
    
  • Configure your installation (You can help with the online php documentation installation configuration option)

    ./configure --prefix=/usr        \
        --sysconfdir=/etc            \
        --localstatedir=/var         \
        --datadir=/usr/share/php     \
        --mandir=/usr/share/man      \
        --enable-fpm                 \
        --with-fpm-user=www-data     \
        --with-fpm-group=www-data    \
        --with-config-file-path=/etc \
        --enable-fastcgi             \
        --enable-ftp        
    
  • Install :

    make
    
    make test
    
    make install                               
    
  • Install php.ini :

    install -v -m644 php.ini-production /etc/php.ini && mv -v /etc/php-fpm.conf{.default,} 
    

You should obtain output like that :

  • php -v :

PHP 7.0.5-1~dotdeb+8.1 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

  • php-fpm -v:

PHP 7.0.5-1~dotdeb+8.1 (fpm-fcgi) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies