Linux compile parameters for installing PHP

Source: Internet
Author: User
Tags curl fpm gettext install php soap openssl

php-5.2.14 version

The code is as follows Copy Code

./configure–prefix=/usr/local/php-5.2.14–with-config-file-path=/usr/local/php-5.2.14/etc–with-gd–with-iconv– with-zlib–enable-xml–enable-bcmath–enable-shmop–enable-sysvsem–enable-inline-optimization–with-curlwrappers– enable-mbregex–enable-fpm–enable-mbstring–enable-ftp–enable-gd-native-ttf–with-openssl–enable-pcntl– enable-sockets–with-xmlrpc–enable-zip–enable-soap–without-pear–with-gettext–enable-session–with-curl– enable-fpm


HP 4.4.0

The code is as follows Copy Code

./configure--prefix=/usr/local/php
--with-apxs=/usr/local/apache/bin/apxs
--with-iconv=/usr/local
--enable-mbstring
--with-gd
--with-jpeg-dir=/usr/local
--with-png-dir=/usr/local
--with-freetype-dir=/usr/local
--with-ttf--enable-gd-native-ttf
--with-zlib-dir=/usr
--with-dom=/usr/local
--with-mysql=/usr/local
--with-ldap=/usr/local
--with-curl=/usr/local


Compile and install php-5.4.8

The code is as follows Copy Code

#安装php
# tar zvxf php-5.4.8.tar.gz
# CD php-5.4.8
# mkdir-p/usr/local/php
#./configure--prefix=/usr/local/php
--with-apxs2=/usr/local/apache/bin/apxs
--with-libxml-dir=/usr/include/libxml2
--with-config-file-path=/usr/local/php/etc/
--with-mysql=/usr/local/mysql
--with-mysqli=/usr/local/mysql/bin/mysql_config
--with-gd
--enable-gd-native-ttf
--with-zlib
--with-mcrypt
--with-pdo-mysql=/usr/local/mysql
--enable-shmop
--enable-soap
--enable-sockets
--enable-wddx
--enable-zip
--with-xmlrpc
--enable-fpm
--enable-mbstring
--with-zlib-dir
--with-bz2
--with-curl
--enable-exif
--enable-ftp
--with-jpeg-dir=/usr/lib64
--with-png-dir=/usr/lib64
--with-freetype-dir=/usr/lib64
--with-iconv
--enable-xml
--enable-bcmath
--enable-sysvsem
--enable-inline-optimization
--with-curlwrappers
--enable-mbregex
--with-openssl
--enable-pcntl
--with-gettext
--enable-session

# make
# make Install
# CP Php.ini-production/usr/local/php/etc/php.ini

# Rm-rf/etc/php.ini
# ln-s/usr/local/php/etc/php.ini/etc/php.ini
# cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf
# vi/usr/local/php/etc/php-fpm.conf
user = www
Group = www
#取消前面的分号
PID = Run/php-fpm.pid
: Wq
#设置 php-fpm Boot
# CP/TMP/PHP-5.4.7/SAPI/FPM/INIT.D.PHP-FPM/ETC/INIT.D/PHP-FPM
# chmod +X/ETC/INIT.D/PHP-FPM
# chkconfig--add php-fpm
# Chkconfig PHP-FPM on
# service PHP-FPM Start
#测试篇
# cd/var/www/html
# VI index.php

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.