Gistrec

Compiller php7

Jan 18th, 2017
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.90 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # Requirements: curl, sudo, tar, building tools
  4.  
  5. [ -z "${PREFIX}" ] && PREFIX=/usr/local
  6. [ -w "${PREFIX}" ] || SUDO=sudo
  7.  
  8. set -e
  9.  
  10. mkdir -p work
  11. cd work
  12.  
  13. curl -fsSL http://www.php.net/distributions/php-7.0.14.tar.xz | tar -xJf - --strip-components=1
  14.  
  15. ./configure \
  16.     --disable-cgi \
  17.     --enable-mbstring \
  18.     --enable-bcmath \
  19.     --enable-sockets \
  20.     --with-curl \
  21.     --with-libedit \
  22.     --with-openssl \
  23.     --with-zlib \
  24.     --enable-pcntl \
  25.     --enable-maintainer-zts \
  26.     --prefix="${PREFIX}"
  27.  
  28. make -j`nproc`
  29. $SUDO make install
  30.  
  31. $SUDO "${PREFIX}/bin/pecl" install channel://pecl.php.net/pthreads-3.1.6 channel://pecl.php.net/weakref-0.3.2 channel://pecl.php.net/yaml-2.0.0
  32. echo "phar.readonly = off
  33. extension = yaml.so
  34. extension = pthreads.so
  35. extension = weakref.so
  36. zend.assertions = -1
  37. " | $SUDO tee "${PREFIX}/lib/php.ini" > /dev/null
  38.  
  39. cd ..
  40. rm -rf work
Advertisement
Add Comment
Please, Sign In to add comment