linux下lnmp环境之php安装
为了防止出现缺失,安装下面集成,复制的时候请将这个复制成一个整行,下面3行是一整行
[[email protected] src]#yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers gd gd2 gd-devel gd2-devel perl-CPAN pcre-devel
[[email protected] src]# wget http://cn2.php.net/get/php-5.6.29.tar.gz/from/this/mirror
[[email protected] src]# mv mirror phpphp.tar.gz
[[email protected] src]# tar vfxz phpphp.tar.gz
[[email protected] php-5.6.29]#./configure --prefix=/usr/local/php \
--with-config-file-path=/etc/php \
--with-gd \
--enable-gd-native-ttf \
--enable-mysqlnd \
--with-mysql=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-openssl \
--enable-mbstring \
--enable-fpm
这个不需要管,如果已经安装了mysql,这个错误就不会出现
[[email protected] php-5.6.29]# make && make install
执行编译安装...
ok,安装成功
[[email protected] php-5.6.29]# cd /usr/local/php
[[email protected] php]# ./sbin/php-fpm
出现如上错误
[[email protected] etc]# cp /usr/local/php/etc/php-fpm.conf.default php-fpm.conf
补充:[[email protected] etc]# cp /usr/local/src/php-5.6.29/php.ini-development /etc/php/php.ini
php-fpm运行成功
[[email protected] php]# ./bin/php
小结:php-fpm是php和nginx联通的的桥梁
********************************************************************************************************
后记针对安装php7如出现如下问题,下面有解决方案:
问题
解决方案