@gabe
2018-06-25T20:00:36.000000Z
字数 1720
阅读 1032
未分类
在此输入正文
安装依赖
sudo apt-get install libxml2-dev libssl-dev pkg-config libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev libfreetype6-dev libicu-dev build-essential libmcrypt-dev libreadline-dev libxslt1-dev -y
ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h
./configure --prefix=/usr/local/php56 \
--with-mysql-sock --with-mysqli \
--enable-fpm --enable-soap \
--with-libxml-dir --with-openssl \
--with-mcrypt --with-mhash \
--with-pcre-regex --with-zlib \
--enable-bcmath --with-iconv \
--with-bz2 --enable-calendar \
--with-curl --with-cdb --enable-dom \
--enable-exif --enable-fileinfo \
--enable-filter --with-pcre-dir \
--enable-ftp --with-gd \
--with-openssl-dir --with-jpeg-dir \
--with-png-dir --with-zlib-dir \
--with-freetype-dir \
--enable-gd-native-ttf \
--enable-gd-jis-conv --with-gettext \
--with-gmp --with-mhash \
--enable-json --enable-mbstring \
--enable-mbregex \
--enable-mbregex-backtrack \
--with-libmbfl --with-onig \
--enable-pdo --with-pdo-mysql \
--with-zlib-dir --with-readline \
--enable-session --enable-shmop \
--enable-simplexml --enable-sockets \
--enable-sysvmsg --enable-sysvsem \
--enable-sysvshm --enable-wddx \
--with-libxml-dir --with-xsl \
--enable-zip \
--enable-mysqlnd-compression-support \
--with-pear --enable-intl
把php56加入到系统环境变量中,做个软链即可
ln -sf /usr/local/php56/bin/php /usr/local/bin/php56
添加php.ini,如果是生产环境则cp对应的php.ini-production
cp php.ini-development /usr/local/php56/lib/php.ini
配置php-fpm,先添加配置文件
cp /usr/local/php56/etc/php-fpm.conf.default /usr/local/php56/etc/php-fpm.conf
安装依赖
sudo apt-get install libpcre3-dev -y
./configure
添加到系统环境中
sudo ln -sf /usr/local/nginx/sbin/nginx /usr/local/bin/nginx
配置nginx
location ~ \.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}