2018/04/24

Installing PHP 7 from source

this post assumes you are familiar with Slackware 14.2 and have php 5.6 installed

  1. Donwload php from sources, and extract it
  2. inside the sources, create a script with this code or copy/paste on bash:
    #!/bin/bash
    ./configure \
        --with-config-file-path=/etc \
        --with-config-file-scan-dir=/etc \
        --enable-mbstring \
        --enable-zip \
        --enable-bcmath \
        --enable-pcntl \
        --enable-ftp \
        --enable-exif \
        --enable-calendar \
        --enable-sysvmsg \
        --enable-sysvsem \
        --enable-sysvshm \
        --enable-wddx \
        --enable-intl \
        --with-curl \
        --with-iconv \
        --with-gmp \
        --with-pspell \
        --with-gd \
        --with-jpeg-dir=/usr \
        --with-png-dir=/usr \
        --with-zlib-dir=/usr \
        --with-xpm-dir=/usr \
        --with-freetype-dir=/usr \
        --enable-gd-jis-conv \
        --with-openssl \
        --with-pdo-mysql=/usr \
        --with-gettext=/usr \
        --with-zlib=/usr \
        --with-bz2 \
        --with-apxs2=/usr/bin/apxs \
        --with-mysqli=/usr/bin/mysql_config \
        --with-ldap \
      --with-libdir=lib64
    edit: the long line from above as one line:
    ./configure --with-config-file-path=/etc --with-config-file-scan-dir=/etc --enable-mbstring --enable-zip --enable-bcmath --enable-pcntl --enable-ftp --enable-exif --enable-calendar --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --enable-intl --with-curl --with-iconv --with-gmp --with-pspell --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr --with-xpm-dir=/usr --with-freetype-dir=/usr --enable-gd-jis-conv --with-openssl --with-pdo-mysql=/usr --with-gettext=/usr --with-zlib=/usr --with-bz2 --with-apxs2=/usr/bin/apxs --with-mysqli=/usr/bin/mysql_config --with-ldap --with-libdir=lib64

  3. make
  4. make test
  5. su
  6. make install
  7. edit /etc/httpd/mod_php.ini and comment lib_php5.so line
  8. rc.httpd restart

No comments:

Post a Comment