centos php源代码安装常见错误与解决办法

前端之家收集整理的这篇文章主要介绍了centos php源代码安装常见错误与解决办法前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

错误:configure: error: libevent >= 1.4.11 could not be found

解决:yum -y install libevent libevent-devel

错误:configure: error: Please reinstall the MysqL distributio

解决:yum -y install MysqL-devel

错误:make: * [sapi/fpm/PHP-fpm] error 1

/Zend/zend_language_parser.h:317:5: error: conflicting types for ‘zendparse’ @H_301_13@ make: * [ext/standard/basic_functions.lo] Error 1

解决:用make ZEND_EXTRA_LIBS=’-liconv’编译

(本人自己实验有时不能成功,估计是环境中缺少什么安装没发现)

错误:configure: error: XML configuration could not be found

解决:yum -y install libxml2 libxml2-devel

错误:configure: error: No curses/termcap library found

解决:yum -y install ncurses ncurses-devel

@H_502_29@错误:configure: error: xml2-config not found

解决:yum -y install libxml2 libxml2-devel

错误:configure: error: Cannot find OpenSSL’s

错误:configure: error: Please reinstall the libcurl distribution -easy.h should be in /include/curl/

解决:yum install curl curl-devel

错误:configure: error: Cannot find ldap.h

解决:yum install openldap openldap-devel

错误:configure: error: libjpeg.(a|so) not found

解决:yum install libjpeglibjpeg -devel

错误:configure: error: libpng.(a|so) not found.

解决:yum install libpnglibpng –devel

错误:onfigure: error: freetype.h not found.

解决:yum install freetype-devel

错误:configure: error: cannot find output from lex; giving up

解决:yum -y install flex

错误:configure: error: mod_deflate has been requested but can not be built due to prerequisite failures

解决:yum -y install zlib-devel openssl-devel

错误:Configure: error: Unable to locate gmp.h

解决:yum install gmp-devel

错误:Configure: error: Cannot find MysqL header files under /usr.

Note that the MysqL client library is not bundled anymore!

解决:yum install MysqL-devel

更多的补充内容

安装PHP: ./configure @H_301_13@ configure: error: XML configuration could not be found

yum -y install libxml2 libxml2-devel

Cannot find OpenSSL’s evp.h> @H_301_13@ yum install openssl openssl-devel

1) Configure: error: xml2-config not found. Please check your libxml2 installation. @H_301_13@ yum install libxml2 libxml2-devel (For RedHat & Fedora) @H_301_13@ aptitude install libxml2-dev (For Ubuntu)

2) Checking for pkg-config… /usr/bin/pkg-config @H_301_13@ configure: error: Cannot find OpenSSL’s evp.h> @H_301_13@ yum install openssl openssl-devel

3) Configure: error: Please reinstall the BZip2 distribution @H_301_13@ yum install bzip2 bzip2-devel

4) Configure: error: Please reinstall the libcurl distribution - @H_301_13@ easy.h should be in /include/curl/ @H_301_13@ yum install curl curl-devel (For RedHat & Fedora) @H_301_13@ install libcurl4-gnutls-dev (For Ubuntu)

5) Configure: error: libjpeg.(also) not found. @H_301_13@ yum install libjpeg libjpeg-devel

6) Configure: error: libpng.(also) not found. @H_301_13@ yum install libpng libpng-devel

7) Configure: error: freetype.h not found. @H_301_13@ yum install freetype-devel

8) Configure: error: Unable to locate gmp.h @H_301_13@ yum install gmp-devel

9) Configure: error: Cannot find MysqL header files under /usr. @H_301_13@ Note that the MysqL client library is not bundled anymore! @H_301_13@ yum install MysqL-devel (For RedHat & Fedora) @H_301_13@ apt-get install libMysqL++-dev (For Ubuntu)

10) Configure: error: Please reinstall the ncurses distribution @H_301_13@ yum install ncurses ncurses-devel

11) Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found! @H_301_13@ yum install unixODBC-devel

12) Configure: error: Cannot find pspell @H_301_13@ yum install pspell-devel

13) configure: error: mcrypt.h not found. Please reinstall libmcrypt. @H_301_13@ yum install libmcrypt libmcrypt-devel (For RedHat & Fedora) @H_301_13@ apt-get install libmcrypt-dev

14) Configure: error: snmp.h not found. Check your SNMP installation. @H_301_13@ yum install net-snmp net-snmp-devel

15) @H_301_13@ /usr/bin/ld: cannot find -lltdl @H_301_13@ collect2: ld returned 1 exit status @H_301_13@ make: * [sapi/cgi/php-cgi] Error 1 @H_301_13@ yum install libtool-ltdl.x86_64 libtool-ltdl-devel.x86_64

16) @H_301_13@ 为PHP编译xcache模块的时候,需要运行PHPize @H_301_13@ 得到了一个错误 @H_301_13@ /usr/local/PHP/bin/PHPize @H_301_13@ Configuring for: @H_301_13@ PHP Api Version: 20041225 @H_301_13@ Zend Module Api No: 20060613 @H_301_13@ Zend Extension Api No: 220060519 @H_301_13@ Cannot find autoconf. Please check your autoconf installation and the $$PHP_AUTOCONF @H_301_13@ environment variable is set correctly and then rerun this script. @H_301_13@ 通过安装 autoconf 可以解决 @H_301_13@ centos下执行 yum install autoconf 即可 @H_301_13@ Ubuntu下执行 apt-get install autoconf 即可 @H_301_13@ 17) @H_301_13@ /usr/local/PHP/bin/PHPize @H_301_13@ Cannot find config.m4. @H_301_13@ Make sure that you run ‘/usr/local/PHP/bin/PHPize’ in the top level source directory of the module @H_301_13@ 修改方法: @H_301_13@ [root@centos lnmp]# cd PHP-5.2.14ext/ @H_301_13@ [root@centos ext]# ./ext_skel –extname=my_module @H_301_13@ Creating directory my_module @H_301_13@ Creating basic files: config.m4 config.w32 .cvsignore my_module.c PHP_my_module.h CREDITS EXPERIMENTAL tests/001.PHPt my_module.PHP [done]. @H_301_13@ To use your new extension,you will have to execute the following steps: @H_301_13@ 1. $ cd .. @H_301_13@ 2. $ vi ext/my_module/config.m4 @H_301_13@ 3. $ ./buildconf @H_301_13@ 4. $ ./configure –[with|enable]-my_module @H_301_13@ 5. $ make @H_301_13@ 6. $ ./PHP -f ext/my_module/my_module.PHP @H_301_13@ 7. $ vi ext/my_module/my_module.c @H_301_13@ 8. $ make @H_301_13@ Repeat steps 3-6 until you are satisfied with ext/my_module/config.m4 and @H_301_13@ step 6 confirms that your module is compiled into PHP. Then,start writing @H_301_13@ code and repeat the last two steps as often as necessary. @H_301_13@ [root@centos ext]# cd my_module/ @H_301_13@ [root@centos my_module]# vim config.m4 @H_301_13@ 根据你自己的选择将 @H_301_13@ dnl PHP_ARG_WITH(my_module,for my_module support,@H_301_13@ dnl Make sure that the comment is aligned: @H_301_13@ dnl [ –with-my_module Include my_module support]) @H_301_13@ 修改成 @H_301_13@ PHP_ARG_WITH(my_module,@H_301_13@ Make sure that the comment is aligned: @H_301_13@ [ –with-my_module Include my_module support]) @H_301_13@ 或者将 @H_301_13@ dnl PHP_ARG_ENABLE(my_module,whether to enable my_module support,@H_301_13@ dnl Make sure that the comment is aligned: @H_301_13@ dnl [ –enable-my_module Enable my_module support]) @H_301_13@ 修改成 @H_301_13@ PHP_ARG_ENABLE(my_module,@H_301_13@ Make sure that the comment is aligned: @H_301_13@ [ –enable-my_module Enable my_module support]) @H_301_13@ [root@centos my_module]# vim my_module.c @H_301_13@   将文件其中的下列代码进行修改 @H_301_13@ /* Every user visible function must have an entry in my_module_functions[]. @H_301_13@ */ @H_301_13@ function_entry my_module_functions[] = { @H_301_13@     PHP_FE(say_hello,    NULL) /* ?添加着一行代码 */ @H_301_13@     PHP_FE(confirm_my_module_compiled,   NULL) /* For testing,remove later. */ @H_301_13@     {NULL,NULL,NULL}   /* Must be the last line in my_module_functions[] */ @H_301_13@ }; @H_301_13@   在文件的最后添加下列代码 @H_301_13@ PHP_FUNCTION(say_hello) @H_301_13@ { @H_301_13@     zend_printf(“hello sdomain!”); @H_301_13@ } @H_301_13@ 再修改PHP_sdomain.h @H_301_13@ vi PHP_sdomain.h @H_301_13@ 在PHP_FUNCTION(confirm_my_module_compiled ); /* For testing,remove later. */ 这行的下面添加一行: @H_301_13@ PHP_FUNCTION(say_hello); /* For testing,remove later. */ @H_301_13@   保存文件退出 @H_301_13@   然后我们就可以在这个目录下使用上面的命令了 @H_301_13@   /usr/local/PHP/bin/PHPize @H_301_13@   执行以后会看到下面的 @H_301_13@   [root@ns sdomain]# /usr/local/PHP/bin/PHPize @H_301_13@   Configuring for: @H_301_13@   PHP Api Version:     20020918 @H_301_13@   Zend Module Api No:   20020429 @H_301_13@   Zend Extension Api No:  20050606 @H_301_13@   [root@ns sdomain]# @H_301_13@   然后执行./configure –with-PHP-config=/usr/local/PHP/bin/PHP-config @H_301_13@   然后执行make @H_301_13@   make install @H_301_13@ 然后他会把对应的so文件生成放到PHP安装目录下面的一个文件夹,并提示在在什么地方,然后再把里面的SO文件拷到你存放SO文件的地方 @H_301_13@   即你在PHP.ini里面的extension_dir所指定的位置 @H_301_13@   最后一步是你在PHP.ini文件中打开这个扩展 @H_301_13@   extension=sdomain.so @H_301_13@   然后 @H_301_13@   重新起动apache

以上错误都是在整个编译安装遇到的问题,然后结合网上的资料,找到的解决方法,总结到这个地方,希望能帮到大家!

转载地址:http://www.jb51.net/article/37487.htm

原文链接:https://www.f2er.com/centos/374843.html

猜你在找的CentOS相关文章