Skip to content

Instantly share code, notes, and snippets.

@AlexSJ
Forked from hollodotme/Install-php7.md
Created March 23, 2016 11:19
Show Gist options
  • Save AlexSJ/a10ca896058fec8f7caa to your computer and use it in GitHub Desktop.
Save AlexSJ/a10ca896058fec8f7caa to your computer and use it in GitHub Desktop.

Revisions

  1. @hollodotme hollodotme revised this gist Mar 10, 2016. 1 changed file with 10 additions and 0 deletions.
    10 changes: 10 additions & 0 deletions Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,16 @@ apt-get update
    apt-get install php7.0-fpm php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-phpdbg php7.0-mbstring php7.0-gd php7.0-imap php7.0-ldap php7.0-pgsql php7.0-pspell php7.0-recode php7.0-snmp php7.0-tidy php7.0-dev php7.0-intl php7.0-gd php7.0-curl php7.0-zip php7.0-xml
    ```

    # UPDATE 2016-03-10

    As mentioned by @jackmcpickle php-redis can now be installed with `apt-get install php-redis` and should be equivalent to the manual installation below. After installation `phpinfo()` says: `Redis-Version 2.2.8-devphp7`

    Same with xdebug. `apt-get install php-xdebug` will install the newly released stable version 2.4.0 that has php7 support.

    So the manual installations below are not needed any longer.

    ---

    # Build phpredis extension

    ```bash
  2. @hollodotme hollodotme revised this gist Mar 6, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -63,7 +63,7 @@ make && make install
    Enable the extension:

    ```bash
    echo "zend_extension=xdebug.so"
    echo "zend_extension=xdebug.so" > /etc/php/7.0/mods-available/xdebug.ini

    ln -sf /etc/php/7.0/mods-available/xdebug.ini /etc/php/7.0/fpm/conf.d/20-xdebug.ini
    ln -sf /etc/php/7.0/mods-available/xdebug.ini /etc/php/7.0/cli/conf.d/20-xdebug.ini
  3. @hollodotme hollodotme revised this gist Mar 5, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ add-apt-repository ppa:ondrej/php
    # Update index
    apt-get update
    # Install php7.0-fpm with needed extensions
    apt-get install php7.0-fpm php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-phpdbg php7.0-mbstring php7.0-gd php7.0-imap php7.0-ldap php7.0-pgsql php7.0-pspell php7.0-recode php7.0-snmp php7.0-tidy php7.0-dev php7.0-intl php7.0-gd php7.0-curl
    apt-get install php7.0-fpm php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-phpdbg php7.0-mbstring php7.0-gd php7.0-imap php7.0-ldap php7.0-pgsql php7.0-pspell php7.0-recode php7.0-snmp php7.0-tidy php7.0-dev php7.0-intl php7.0-gd php7.0-curl php7.0-zip php7.0-xml
    ```

    # Build phpredis extension
  4. @hollodotme hollodotme revised this gist Mar 5, 2016. 1 changed file with 34 additions and 0 deletions.
    34 changes: 34 additions & 0 deletions Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -42,4 +42,38 @@ Replace `unix:/var/run/php5-fpm.sock` with `unix:/var/run/php/php7.0-fpm.sock`

    ```bash
    service nginx restart
    ```

    # Install xdebug extension

    ```bash
    # Download stable release of xdebug 2.4.0
    wget -c "http://xdebug.org/files/xdebug-2.4.0.tgz"
    # Extract archive
    tar -xf xdebug-2.4.0.tgz

    cd xdebug-2.4.0/

    # build extension
    phpize
    ./configure
    make && make install
    ```

    Enable the extension:

    ```bash
    echo "zend_extension=xdebug.so"

    ln -sf /etc/php/7.0/mods-available/xdebug.ini /etc/php/7.0/fpm/conf.d/20-xdebug.ini
    ln -sf /etc/php/7.0/mods-available/xdebug.ini /etc/php/7.0/cli/conf.d/20-xdebug.ini

    service php7.0-fpm restart

    # Check it
    php -m | grep -i xdebug

    # should print:
    xdebug
    Xdebug
    ```
  5. @hollodotme hollodotme revised this gist Mar 2, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ add-apt-repository ppa:ondrej/php
    # Update index
    apt-get update
    # Install php7.0-fpm with needed extensions
    apt-get install php7.0-fpm php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-phpdbg php7.0-dbg php7.0-gd php7.0-imap php7.0-ldap php7.0-pgsql php7.0-pspell php7.0-recode php7.0-snmp php7.0-tidy php7.0-dev php7.0-intl php7.0-gd php7.0-curl
    apt-get install php7.0-fpm php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-phpdbg php7.0-mbstring php7.0-gd php7.0-imap php7.0-ldap php7.0-pgsql php7.0-pspell php7.0-recode php7.0-snmp php7.0-tidy php7.0-dev php7.0-intl php7.0-gd php7.0-curl
    ```

    # Build phpredis extension
  6. @hollodotme hollodotme revised this gist Mar 2, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -27,11 +27,11 @@ rm -rf phpredis
    # Activate phpredis extension in fpm and cli

    ```bash
    echo "extension=redis.so" > /etc/php/mods-available/redis.ini
    echo "extension=redis.so" > /etc/php/7.0/mods-available/redis.ini

    ln -sf /etc/php/mods-available/redis.ini /etc/php/7.0/fpm/conf.d/20-redis.ini
    ln -sf /etc/php/7.0/mods-available/redis.ini /etc/php/7.0/fpm/conf.d/20-redis.ini

    ln -sf /etc/php/mods-available/redis.ini /etc/php/7.0/cli/conf.d/20-redis.ini
    ln -sf /etc/php/7.0/mods-available/redis.ini /etc/php/7.0/cli/conf.d/20-redis.ini

    service php7.0-fpm restart
    ```
  7. @hollodotme hollodotme revised this gist Mar 2, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@
    # remove php5 modules
    apt-get autoremove --purge php5-*
    # add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
    add-apt-repository ppa:ondrej/php-7.0
    add-apt-repository ppa:ondrej/php
    # Update index
    apt-get update
    # Install php7.0-fpm with needed extensions
  8. @hollodotme hollodotme revised this gist Dec 15, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ add-apt-repository ppa:ondrej/php-7.0
    # Update index
    apt-get update
    # Install php7.0-fpm with needed extensions
    apt-get install php7.0-fpm php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-phpdbg php7.0-dbg php7.0-gd php7.0-imap php7.0-ldap php7.0-pgsql php7.0-pspell php7.0-recode php7.0-snmp php7.0-tidy php7.0-dev php7.0-intl php7.0-gd
    apt-get install php7.0-fpm php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-phpdbg php7.0-dbg php7.0-gd php7.0-imap php7.0-ldap php7.0-pgsql php7.0-pspell php7.0-recode php7.0-snmp php7.0-tidy php7.0-dev php7.0-intl php7.0-gd php7.0-curl
    ```

    # Build phpredis extension
  9. @hollodotme hollodotme revised this gist Dec 9, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ add-apt-repository ppa:ondrej/php-7.0
    # Update index
    apt-get update
    # Install php7.0-fpm with needed extensions
    apt-get install php7.0-fpm php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-phpdbg php7.0-dbg php7.0-gd php7.0-imap php7.0-ldap php7.0-pgsql php7.0-pspell php7.0-recode php7.0-snmp php7.0-tidy php7.0-dev php7.0-intl
    apt-get install php7.0-fpm php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-phpdbg php7.0-dbg php7.0-gd php7.0-imap php7.0-ldap php7.0-pgsql php7.0-pspell php7.0-recode php7.0-snmp php7.0-tidy php7.0-dev php7.0-intl php7.0-gd
    ```

    # Build phpredis extension
  10. @hollodotme hollodotme revised this gist Dec 8, 2015. 1 changed file with 3 additions and 6 deletions.
    9 changes: 3 additions & 6 deletions Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -27,14 +27,11 @@ rm -rf phpredis
    # Activate phpredis extension in fpm and cli

    ```bash
    cd /etc/php/mods-available
    echo "extension=redis.so" > redis.ini
    echo "extension=redis.so" > /etc/php/mods-available/redis.ini

    cd /etc/php/7.0/fpm/conf.d/
    ln -sf /etc/php/mods-available/redis.ini ./20-redis.ini
    ln -sf /etc/php/mods-available/redis.ini /etc/php/7.0/fpm/conf.d/20-redis.ini

    cd /etc/php/7.0/cli/conf.d/
    ln -sf /etc/php/mods-available/redis.ini ./20-redis.ini
    ln -sf /etc/php/mods-available/redis.ini /etc/php/7.0/cli/conf.d/20-redis.ini

    service php7.0-fpm restart
    ```
  11. @hollodotme hollodotme revised this gist Dec 7, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -20,6 +20,7 @@ git checkout php7
    phpize
    ./configure
    make && make install
    cd ..
    rm -rf phpredis
    ```

  12. @hollodotme hollodotme revised this gist Dec 5, 2015. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,13 @@
    # Install php7-fpm
    # Install php7.0-fpm

    ```bash
    # remove php5 modules
    apt-get autoremove --purge php5-*
    # add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
    add-apt-repository ppa:ondrej/php-7.0
    # Update index
    apt-get update
    # Install php7.0-fpm with needed extensions
    apt-get install php7.0-fpm php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-phpdbg php7.0-dbg php7.0-gd php7.0-imap php7.0-ldap php7.0-pgsql php7.0-pspell php7.0-recode php7.0-snmp php7.0-tidy php7.0-dev php7.0-intl
    ```

  13. @hollodotme hollodotme created this gist Dec 5, 2015.
    43 changes: 43 additions & 0 deletions Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    # Install php7-fpm

    ```bash
    apt-get autoremove --purge php5-*
    add-apt-repository ppa:ondrej/php-7.0
    apt-get update
    apt-get install php7.0-fpm php7.0-cli php7.0-common php7.0-json php7.0-opcache php7.0-mysql php7.0-phpdbg php7.0-dbg php7.0-gd php7.0-imap php7.0-ldap php7.0-pgsql php7.0-pspell php7.0-recode php7.0-snmp php7.0-tidy php7.0-dev php7.0-intl
    ```

    # Build phpredis extension

    ```bash
    git clone https://github.com/phpredis/phpredis.git
    cd phpredis
    git checkout php7
    phpize
    ./configure
    make && make install
    rm -rf phpredis
    ```

    # Activate phpredis extension in fpm and cli

    ```bash
    cd /etc/php/mods-available
    echo "extension=redis.so" > redis.ini

    cd /etc/php/7.0/fpm/conf.d/
    ln -sf /etc/php/mods-available/redis.ini ./20-redis.ini

    cd /etc/php/7.0/cli/conf.d/
    ln -sf /etc/php/mods-available/redis.ini ./20-redis.ini

    service php7.0-fpm restart
    ```

    # nginx vhost config

    Replace `unix:/var/run/php5-fpm.sock` with `unix:/var/run/php/php7.0-fpm.sock`

    ```bash
    service nginx restart
    ```