栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP

php源码安装

PHP 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

php源码安装

PHP源码编译

下载软件包

从www.php.net官方网站下载PHP源码包

##########################

soap动态

fpm 平滑加载php配置(php,)

zend加速php

##########################


[root@server79 ~]# tar jxf php-5.4.12.tar.bz2

新建nginx用户

[root@server79 php-5.4.12]#useradd -M -d /usr/local/lnmp/nginx/ -s /sbin/nologin nginx

配置安装环境

安装PHP需要下面软件包的支持,如果没有安装,请自行安装。

yum install net-snmp-devel curl-devel libxml2-devel libpng-devel libjpeg-devel freetype-

devel gmp-devel openldap-devel -y

开始编译安装PHP:

--enable-fpm:激活对FastCGI模式的fpm支持

[root@server79 php-5.4.12]# ./configure --prefix=/usr/local/lnmp/php --with-config-file-path=/usr/local/lnmp/php/etc --with-openssl --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir --with-pear --with-gettext --with-gmp --enable-inline-optimization --enable-soap --enable-ftp --enable-sockets --enable-mbstring --with-mysqli=/usr/local/lnmp/mysql/bin/mysql_config --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-mcrypt=/usr/local/lnmp/modules/libmcrypt/ --with-mhash=/usr/local/lnmp/modules/mhash/


错误1:

checking for xml2-config path...

configure: error: xml2-config not found. Please check your libxml2 installation.

根据提示解决:

[root@server79 php-5.4.12]# yum install libxml2-devel -y


再次编译,出现错误2:

configure: error: Please reinstall the libcurl distribution -

easy.h should be in /include/curl/

解决:

[root@server79 php-5.4.12]# yum install curl-devel


错误3:

configure: error: jpeglib.h not found

解决 :安装图形支持

yum install libpng-devel libjpeg-devel freetype-devel gmp-devel


错误4:

configure: error: Could not find net-snmp-config binary. Please check your net-snmp installation.

解决:

[root@server79 php-5.4.12]# yum install net-snmp-devel

[root@server79 php-5.4.12]# make ZEND_EXTRA_LIBS='-liconv'

make完之后会报错

错误:

/usr/bin/ld: cannot find -liconv

collect2: ld returned 1 exit status

make: *** [sapi/cli/php] Error 1

解决:

[root@server79 php-5.4.12]# vim /etc/ld.so.conf

/usr/local/lnmp/modules/libiconv/lib

加载

[root@server79 php-5.4.12]#ldconfig /usr/local/lnmp/modules/libiconv/lib

[root@server79 php-5.4.12]# make

[root@server79 php-5.4.12]# make install


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/229602.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号