CentOS 6.5 php原始碼安裝1.0版

karspb發表於2021-09-09

groupadd www

useradd -g www -s /sbin/nologin -M www


yum install -y freetype-devel libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg libjpeg-devel libpng libpng-devel

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --enable-opcache --enable-sockets --enable-xml --enable-mbstring --enable-soap --enable-zip --enable-bcmath --with-gettext --with-openssl --with-zlib --with-curl --with-gd --with-freetype-dir=/usr/include/freetype2/ --with-zlib-dir=/usr/lib --with-png-dir=/usr/lib --with-jpeg-dir=/usr/lib --with-mhash --with-apxs2=/usr/local/apache/bin/apxs 

make

make install


cp php.ini-development /usr/local/php/etc/php.ini

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

chmod +x /etc/init.d/php-fpm

chkconfig --add php-fpm

service php-fpm start

service php-fpm restart


vim ~/.bash_profile 

PATH=$PATH:$HOME/bin:/usr/local/php/bin

~/.bash_profile

php -v


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/2001/viewspace-2801823/,如需轉載,請註明出處,否則將追究法律責任。

相關文章