安装php7

./configure  --prefix=/usr/local/php7.1.5 --with-curl --with-iconv-dir  --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pear --with-zlib --enable-fpm --enable-bcmath --enable-mbregex --enable-mbstring --enable-opcache  --enable-pcntl --enable-sockets  --enable-embed

configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no

vim /etc/ld.so.conf

/usr/local/mysql/lib

ldconfig

 

yum install libxml2*  libcurl-devel -y

./configure --prefix=/usr/local/php7.1.5 --with-curl --with-iconv-dir --with-mysqli --with-pcre-regex --with-pdo-mysql --with-pear --with-zlib --enable-fpm --enable-bcmath --enable-mbstring --enable-opcache=no --enable-sockets

wget http://www.ohse.de/uwe/releases/lrzsz-0.12.20.tar.gz

tar zxvf lrzsz-0.12.20.tar.gz && cd lrzsz-0.12.20
./configure && make && make install
上面安装过程默认把lsz和lrz安装到了/usr/local/bin/目录下,现在我们并不能直接使用,下面创建软链接,并命名为rz/sz:
cd /usr/bin
ln -s /usr/local/bin/lrz rz
ln -s /usr/local/bin/lsz sz

 

2)yum安装
root 账号登陆后执行以下命令:
yum install -y lrzsz
2.用说明
sz命令发送文件到本地:
# sz filename
rz命令本地上传文件到服务器:
# rz
执行该命令后,在弹出框中选择要上传的文件即可。
说明:打开SecureCRT软件 -> Options -> session options -> X/Y/Zmodem 下可以设置上传和下载的目录

 

安装http://blog.csdn.net/21aspnet/article/details/47708763 

 

重新安装libxml2和libxml2-devel包

yum install libxml2

yum install libxml2-devel -y

yum -y install curl-devel

tar zxvf php-7.0.2.tar.gz

cd php-7.0.2

 

简约版

如果是php扩展debug,可不用下行

CFLAGS="-g -gdwarf-2 -g3" CXXFLAGS="-g -gdwarf-2 -g3"
./configure --prefix=/usr/local/php7.1.6 --with-curl --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pear --with-zlib --enable-fpm --enable-bcmath --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-sockets --enable-zip --enable-embed --enable-debug

 

CFLAGS="-g -gdwarf-2 -g3" CXXFLAGS="-g -gdwarf-2 -g3"
./configure --prefix=/usr/local/php7 \
--with-curl \
--with-iconv-dir \
--with-kerberos \
--with-libdir=lib64 \
--with-libxml-dir \
--with-mysqli \
--with-openssl \
--with-pcre-regex \
--with-pdo-mysql \
--with-pear \
--with-zlib \
--enable-fpm \
--enable-bcmath \
--enable-mbregex \
--enable-mbstring \
--enable-opcache \
--enable-pcntl \
--enable-sockets \
--enable-zip

 

configure error xml2-config not found. please check your libxml2 installation

  yum install libxml2

 yum install libxml2-devel -y

 

 

configure: error: Please reinstall the libcurl distribution -
    easy.h should be in /include/curl/

# RetHat CentOS or Fedora 使用下面安装命令
yum install curl curl-devel
# Debian or Ubuntu使用下面的安装命令
apt-get install curl
apt-get install libcurl4-gnutls-dev


CFLAGS="-g -gdwarf-2 -g3" CXXFLAGS="-g -gdwarf-2 -g3"
./configure --prefix=/usr/local/php7 \
--with-curl \
--enable-debug\
--with-freetype-dir \
--with-gd \
--with-gettext \
--with-iconv-dir \
--with-kerberos \
--with-libdir=lib64 \
--with-libxml-dir \
--with-mysqli \
--with-openssl \
--with-pcre-regex \
--with-pdo-mysql \
--with-pdo-sqlite \
--with-pear \
--with-png-dir \
--with-xmlrpc \
--with-xsl \
--with-zlib \
--enable-fpm \
--enable-bcmath \
--enable-libxml \
--enable-inline-optimization \
--enable-gd-native-ttf \
--enable-mbregex \
--enable-mbstring \
--enable-opcache \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvsem \
--enable-xml \
--enable-zip

 

简约版

CFLAGS="-g -gdwarf-2 -g3" CXXFLAGS="-g -gdwarf-2 -g3" ./configure --prefix=/usr/local/php7.1.2 --enable-fpm --enable-sockets --enable-pdo --with-curl --enable-debug --enable-opcache

 

如果配置错误,需要安装需要的模块,直接yum一并安装依赖库

# yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel MySQL pcre-devel libxslt-devel

 

 

错误:

 
  1. /usr/include/ft2build.h:56:38: error: freetype/config/ftheader.h: No such file or directory   
  2. /root/tx-pj-static-install/Packages/php-5.2.17/ext/gd/gd.c:84:12: error: #include expects “FILENAME” or <FILENAME>  

解决:

 
  1. ln -s /usr/include/freetype2/freetype/ /usr/include/freetype  

配置文件

 cp php.ini-development /usr/local/php7/lib/php.ini
 cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php7/etc/php-fpm.conf
 cp /usr/local/php7/etc/php-fpm.d/www.conf.default /usr/local/php7/etc/php-fpm.d/www.conf
 cp -R ./sapi/fpm/php-fpm /etc/init.d/php-fpm-7
 
 
需要注意的是php7中www.conf这个配置文件配置phpfpm的端口号等信息,如果你修改默认的9000端口号需在这里改,再改nginx的配置
启动
#  /etc/init.d/php-fpm-7
 
 
 
 
posted @ 2018-10-22 19:00  taek  阅读(272)  评论(0编辑  收藏  举报