Install PHP7 on Ubuntu Server 15.10, 15.04 & 14.04 using PPA

PHP 7.0 was released on December 3, 2015. PHP development team fixes several bugs. To check list of bug fixes please refer this page.
Install PHP7

See Also:

  • Install PHP 7 on CentOS/RHEL 5/6/7

    This article will help you to install PHP 7 on Ubuntu Servers.

    Add PPA for PHP 7

    Say thanks to Ondřej Surý for maintaining PPA of most the popular PHP versions. Use the following command to add PPA for PHP 7:

    # sudo add-apt-repository ppa:ondrej/php-7.0
    

    Install PHP 7

    Use the following command to install PHP 7 on your system.

    # sudo apt-get update
    $ sudo apt-get install -y php7.0
    

    Verify PHP Version

    Now use the following command to check php version on your system.

    # php -v
    
    PHP 7.0.1-2+deb.sury.org~trusty+1 (cli) ( NTS )
    Copyright (c) 1997-2015 The PHP Group
    Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
        with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies
    

    Find PHP Modules

    To find out other available php modules use the following command.

    # sudo apt-cache search php7
    

    Sample Output:

    php7.0-common - Common files for packages built from the PHP source
    libapache2-mod-php7.0 - server-side, HTML-embedded scripting language (Apache 2 module)
    php7.0-cgi - server-side, HTML-embedded scripting language (CGI binary)
    php7.0-cli - command-line interpreter for the PHP scripting language
    php7.0-phpdbg - server-side, HTML-embedded scripting language (PHPDBG binary)
    php7.0-fpm - server-side, HTML-embedded scripting language (FPM-CGI binary)
    libphp7.0-embed - HTML-embedded scripting language (Embedded SAPI library)
    php7.0-dev - Files for PHP7.0 module development
    php7.0-dbg - Debug symbols for PHP7.0
    php7.0-curl - CURL module for PHP
    php7.0-gd - GD module for PHP
    php7.0-imap - IMAP module for PHP
    php7.0-interbase - Interbase module for PHP
    php7.0-intl - Internationalisation module for PHP
    php7.0-ldap - LDAP module for PHP
    php7.0-mcrypt - libmcrypt module for PHP
    php7.0-readline - readline module for PHP
    php7.0-odbc - ODBC module for PHP
    php7.0-pgsql - PostgreSQL module for PHP
    php7.0-pspell - pspell module for PHP
    php7.0-recode - recode module for PHP
    php7.0-snmp - SNMP module for PHP
    php7.0-tidy - tidy module for PHP
    php7.0-xmlrpc - XMLRPC-EPI module for PHP
    php7.0 - server-side, HTML-embedded scripting language (metapackage)
    php7.0-json - JSON module for PHP
    php-all-dev - package depending on all supported PHP development packages
    php7.0-sybase - Sybase module for PHP
    php7.0-modules-source - PHP 7.0 modules source package
    php7.0-sqlite3 - SQLite3 module for PHP
    php7.0-mysql - MySQL module for PHP
    php7.0-opcache - Zend OpCache module for PHP
    php7.0-bz2 - bzip2 module for PHP
    

    Install PHP Modules

    If you want to install any additional php modules based on your requirements installed as below:

    # apt-get install php7.0-common php7.0-sqlite3 php7.0-mysql php7.0-ldap
    # apt-get install php7.0-gd php7.0-curl php7.0-snmp
    

    Enjoy it!

  • No Responses

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

    The reCAPTCHA verification period has expired. Please reload the page.