Last active
April 23, 2018 12:23
-
-
Save bookiu/c188f9f97112450990a7863f101ec449 to your computer and use it in GitHub Desktop.
Ubuntu下安装PHP5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update | |
apt-get install -y pkg-config libxml2-dev libssl-dev libcurl4-gnutls-dev libjpeg-dev libpng-dev libfreetype6-dev libmcrypt-dev libreadline-dev libxslt1-dev libbz2-dev | |
PHP_INSTALL_DIR="/usr/local/php56" | |
PHP_CONFIG_DIR="$PHP_INSTALL_DIR/etc" | |
PHP_CONFIG_SCAN_DIR="$PHP_CONFIG_DIR/php.d" | |
./configure \ | |
--prefix=$PHP_INSTALL_DIR \ | |
--with-config-file-path=$PHP_CONFIG_DIR \ | |
--with-config-file-scan-dir=$PHP_CONFIG_SCAN_DIR \ | |
--with-fpm-user=www \ | |
--with-fpm-group=www \ | |
--enable-fpm \ | |
--disable-ipv6 \ | |
--enable-ctype=shared \ | |
--enable-dom=shared \ | |
--enable-pdo=shared \ | |
--enable-hash=shared \ | |
--enable-json=shared \ | |
--enable-phar=shared \ | |
--enable-posix=shared \ | |
--enable-session=shared \ | |
--enable-opcache=shared \ | |
--enable-fileinfo=shared \ | |
--enable-tokenizer=shared \ | |
--enable-xml=shared \ | |
--enable-libxml=shared \ | |
--enable-simplexml=shared \ | |
--enable-xmlreader=shared \ | |
--enable-xmlwriter=shared \ | |
--enable-bcmath=shared \ | |
--enable-ftp=shared \ | |
--enable-mbstring=shared \ | |
--enable-pcntl=shared \ | |
--enable-shmop=shared \ | |
--enable-sockets=shared \ | |
--enable-zip=shared \ | |
--enable-calendar=shared \ | |
--enable-mysqlnd=shared \ | |
--enable-exif=shared \ | |
--enable-libxml=shared \ | |
--with-zlib=shared \ | |
--with-bz2=shared \ | |
--with-curl=shared \ | |
--with-gd=shared \ | |
--with-mhash=shared \ | |
--with-readline=shared \ | |
--with-openssl=shared \ | |
--with-iconv=shared \ | |
--with-pear=shared \ | |
--with-xsl=shared \ | |
--with-mysqli=shared \ | |
--with-pdo-mysql=shared \ | |
--with-sqlite3=shared \ | |
--with-pdo-sqlite=shared | |
# 下面一行为了解决错误: | |
#/usr/bin/ld: ext/mysqlnd/.libs/mysqlnd_net.o: undefined reference to symbol 'uncompress' | |
#//lib/x86_64-linux-gnu/libz.so.1: error adding symbols: DSO missing from command line | |
#collect2: error: ld returned 1 exit status | |
#make: *** [sapi/cli/php] Error 1 | |
sed -i "s/^EXTRA_LIBS.*/& -lz/g" Makefile | |
make -j 8 | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment