Skip to content

Instantly share code, notes, and snippets.

@nandes2062
Forked from hollodotme/Install-php7.md
Last active June 22, 2017 02:35
Show Gist options
  • Save nandes2062/980dd892e5fbd5c3d3aadfaa80f09863 to your computer and use it in GitHub Desktop.
Save nandes2062/980dd892e5fbd5c3d3aadfaa80f09863 to your computer and use it in GitHub Desktop.

Revisions

  1. nandes2062 revised this gist Jun 22, 2017. 1 changed file with 15 additions and 15 deletions.
    30 changes: 15 additions & 15 deletions Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,14 @@
    # Install php7.0-fpm
    # Install php7.1-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 php-7.1 source list by [Ondřej Surý](https://github.com/oerdnj)
    add-apt-repository ppa:ondrej/php
    # Update index
    apt-get update
    # Install php7.0-fpm with needed extensions
    apt-get install libapache2-mod-php7.0 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
    # Install php7.1-fpm with needed extensions
    apt-get install libapache2-mod-php7.1 php7.1-fpm php7.1-cli php7.1-common php7.1-json php7.1-opcache php7.1-mysql php7.1-phpdbg php7.1-mbstring php7.1-gd php7.1-imap php7.1-ldap php7.1-pgsql php7.1-pspell php7.1-recode php7.1-snmp php7.1-tidy php7.1-dev php7.1-intl php7.1-gd php7.1-curl php7.1-zip php7.1-xml
    ```

    # UPDATE 2016-03-10
    @@ -37,18 +37,18 @@ rm -rf phpredis
    # Activate phpredis extension in fpm and cli

    ```bash
    echo "extension=redis.so" > /etc/php/7.0/mods-available/redis.ini
    echo "extension=redis.so" > /etc/php/7.1/mods-available/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/7.1/mods-available/redis.ini /etc/php/7.1/fpm/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
    ln -sf /etc/php/7.1/mods-available/redis.ini /etc/php/7.1/cli/conf.d/20-redis.ini

    service php7.0-fpm restart
    service php7.1-fpm restart
    ```

    # nginx vhost config

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

    ```bash
    service nginx restart
    @@ -73,12 +73,12 @@ make && make install
    Enable the extension:

    ```bash
    echo "zend_extension=xdebug.so" > /etc/php/7.0/mods-available/xdebug.ini
    echo "zend_extension=xdebug.so" > /etc/php/7.1/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
    ln -sf /etc/php/7.1/mods-available/xdebug.ini /etc/php/7.1/fpm/conf.d/20-xdebug.ini
    ln -sf /etc/php/7.1/mods-available/xdebug.ini /etc/php/7.1/cli/conf.d/20-xdebug.ini

    service php7.0-fpm restart
    service php7.1-fpm restart

    # Check it
    php -m | grep -i xdebug
    @@ -87,7 +87,7 @@ php -m | grep -i xdebug
    xdebug
    Xdebug
    ```
    SI UBIESE ERRORES INSTALAR
    SI UBIESE ERRORES INSTALAR
    ```bash
    sudo apt-get install snmp
    ```
    ```
  2. nandes2062 revised this gist Aug 31, 2016. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions Install-php7.md
    Original file line number Diff line number Diff line change
    @@ -86,4 +86,8 @@ php -m | grep -i xdebug
    # should print:
    xdebug
    Xdebug
    ```
    SI UBIESE ERRORES INSTALAR
    ```bash
    sudo apt-get install snmp
    ```
  3. nandes2062 revised this gist Aug 30, 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 php7.0-zip php7.0-xml
    apt-get install libapache2-mod-php7.0 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
  4. @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
  5. @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
  6. @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
  7. @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
    ```
  8. @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
  9. @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
    ```
  10. @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
  11. @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
  12. @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
  13. @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
    ```
  14. @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
    ```

  15. @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
    ```

  16. @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
    ```