centos安装php
2018-03-16 本文已影响0人
adtk
yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel mysql pcre-devel
yum -y install curl-devel
yum -y install libxslt-devel
问题描述:
今天编译php-5.2.5的时候遭遇xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution这个问题,没安装libxslt libxslt-devel软件包
解决方法:
yum -y install libxslt libxslt-devel
提示unrecognized options: –with-mcrypt, –enable-gd-native-ttf
表示php7.2不支持这两个选项,
把两个编译选项删除就可以了。
make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1错误
内存不足1g
//添加,下面已经加上
--disable-fileinfo
./configure --prefix=/usr/local/php \
--with-curl \
--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-mbregex \
--enable-mbstring \
--enable-opcache \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvsem \
--enable-xml \
--enable-zip \
--disable-fileinfo
安装完成后配置
cp php.ini-development /usr/local/php/lib/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
//备用: cp -R ./sapi/fpm/php-fpm /etc/init.d/php-fpm
开机启动的配置文件是:/etc/rc.local ,最后加入一行 /usr/local/php/sbin/php-fpm 即可
重启
killall php-fpm
/etc/init.d/php-fpm