php的代码会用到好多库,运行configure查看您的机器上缺少哪些库,用yum指令安装上就可以编译过了。
<span style="color:#ff6666;">
<span style="font-family: georgia, Verdana, Helvetica, Arial; font-size: 12.8000001907349px; line-height: 19.5px;">yum install -y gcc gcc-c++ make zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers</span></span>
yum install libxml2-devel -y
yum install openssl openssl-devel -y
<span style="color: rgb(51, 51, 51); font-family: Arial, Helvetica; font-size: 13px; line-height: 18px;">yum install </span><span style="color: rgb(204, 0, 0); font-family: Arial, Helvetica; font-size: 13px; line-height: 18px; font-weight: 700 !important;">curl</span><span style="color: rgb(51, 51, 51); font-family: Arial, Helvetica; font-size: 13px; line-height: 18px;">-devel -y
</span><span style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; line-height: 13.1999998092651px; white-space: pre;">yum install libjpeg-devel -y
</span><pre code_snippet_id="282663" snippet_file_name="blog_20140409_1_7151561" name="code" class="php"><span style="font-family:Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;"><span style="line-height: 13.1999998092651px;">yum install libpng-devel -y
</span></span><pre code_snippet_id="282663" snippet_file_name="blog_20140409_1_7151561" name="code" class="php"><span style="font-family:Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;"><span style="line-height: 13.1999998092651px;">yum install freetype-devel -y
</span></span><span style="font-family: Arial; line-height: 26px; color: rgb(51, 51, 51); font-size: 14px;">yum install openldap -y</span><span style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; line-height: 13.1999998092651px;"></span><p style="color: rgb(51, 51, 51); font-family: Arial; font-size: 14px; line-height: 26px;">yum install openldap-devel -y
cp -frp /usr/lib64/libldap* /usr/lib/
</p>
wget http://hk1.php.net/get/php-5.5.11.tar.bz2/from/this/mirror
'./configure' '--prefix=/usr/local/php5' '--with-mysql=/usr/share/mysql/' '--with-openssl' '--enable-fpm' '--with-mysqli=/usr/bin/mysql_config' '--with-iconv-dir' '--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir' '--enable-xml' '--disable-rpath' '--enable-safe-mode' '--enable-bcmath' '--enable-shmop' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl' '--with-curlwrappers' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-ldap' '--with-ldap-sasl' '--with-xmlrpc' '--enable-zip' '--enable-soap'
make ; make install;
修改配置文件(/usr/local/php5/etc/php-fpm.conf)
[global]
pid = run/php-fpm.pid
[www]
user = nobody
group = nobody
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
因篇幅问题不能全部显示,请点此查看更多更全内容