php

位置:IT落伍者 >> php >> 浏览文章

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


发布日期:2018年11月19日
 
php源代码安装常见错误与解决办法

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

解决yum y  install libevent libeventdevel



错误configure: error: Please  reinstall the mysql distributio

解决yum y install mysqldevel  



错误make: *** [sapi/fpm/phpfpm] error

解决用make  ZEND_EXTRA_LIBS=liconv编译



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

解决yum y install libxml libxmldevel  



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

解决yum y install ncurses ncursesdevel



错误configure:  error: xmlconfig not found

解决yum y install libxml libxmldevel  



错误configure: error: Cannot find OpenSSLs <evph>  

解决yum install openssl openssldevel



错误configure:  error: Please reinstall the libcurl distribution easyh should be in  <curldir>/include/curl/

解决yum install curl curldevel  



错误configure: error: Cannot find ldaph

解决yum install  openldap openldapdevel



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

解决yum install libjpeglibjpeg devel



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

解决yum install libpnglibpng –devel  



错误onfigure: error: freetypeh not found

解决yum install  freetypedevel



错误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 zlibdevel openssldevel



错误Configure:  error: Unable to locate gmph

解决yum install gmpdevel  



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

Note that the MySQL client library is not bundled anymore!  

解决yum install mysqldevel  

更多的补充内容

安装php: /configure
configure:  error: XML configuration could not be found

yum y install libxml  libxmldevel

Cannot find OpenSSLs <evph>
yum install  openssl openssldevel

) Configure: error: xmlconfig not found Please  check your libxml installation
#yum install libxml libxmldevel (For  RedHat & Fedora)
# aptitude install libxmldev (For Ubuntu)

)  Checking for pkgconfig… /usr/bin/pkgconfig
configure: error: Cannot find  OpenSSLs <evph>
#yum install openssl openssldevel

)  Configure: error: Please reinstall the BZip distribution
# yum install  bzip bzipdevel

) Configure: error: Please reinstall the libcurl  distribution
easyh should be in <curldir>/include/curl/
# yum  install curl curldevel (For RedHat & Fedora)
# install  libcurlgnutlsdev (For Ubuntu)

) Configure: error: libjpeg(also) not  found
# yum install libjpeg libjpegdevel

) Configure: error:  libpng(also) not found
# yum install libpng libpngdevel

)  Configure: error: freetypeh not found
#yum install freetypedevel  

) Configure: error: Unable to locate gmph
# yum install gmpdevel  

) Configure: error: Cannot find MySQL header files under /usr
Note  that the MySQL client library is not bundled anymore!
# yum install  mysqldevel (For RedHat & Fedora)
# aptget install libmysql++dev (For  Ubuntu)

) Configure: error: Please reinstall the ncurses distribution  
# yum install ncurses ncursesdevel

) Checking for unixODBC  support… configure: error: ODBC header file ‘/usr/include/sqlexth not found!  
# yum install unixODBCdevel

) Configure: error: Cannot find  pspell
# yum install pspelldevel

) configure: error: mcrypth not  found Please reinstall libmcrypt
# yum install libmcrypt libmcryptdevel  (For RedHat & Fedora)
# aptget install libmcryptdev

)  Configure: error: snmph not found Check your SNMP installation
# yum  install netsnmp netsnmpdevel

)
/usr/bin/ld: cannot find lltdl  
collect: ld returned exit status
make: *** [sapi/cgi/phpcgi] Error   
# yum install libtoolltdlx_ libtoolltdldevelx_

)  
为php编译xcache模块的时候需要运行phpize
得到了一个错误
#/usr/local/php/bin/phpize  
Configuring for:
PHP Api Version:
Zend Module Api No:  
Zend Extension Api No:
Cannot find autoconf Please  check your autoconf installation and the $PHP_AUTOCONF
environment variable  is set correctly and then rerun this script
通过安装 autoconf 可以解决  
centos下执行 yum install autoconf 即可
Ubuntu下执行 aptget install autoconf 即可  

# /usr/local/php/bin/phpize
Cannot find configm
Make sure  that you run /usr/local/php/bin/phpize in the top level source directory of  the module
修改方法
[root@centos lnmp]# cd phpext/
[root@centos  ext]# /ext_skel extname=my_module
Creating directory my_module  
Creating basic files: configm configw cvsignore my_modulec  php_my_moduleh CREDITS EXPERIMENTAL tests/phpt my_modulephp [done]
To  use your new extension you will have to execute the following steps:
$  cd
$ vi ext/my_module/configm
$ /buildconf
$  /configure [with|enable]my_module
$ make
$ /php f  ext/my_module/my_modulephp
$ vi ext/my_module/my_modulec
$ make  
Repeat steps until you are satisfied with ext/my_module/configm and  
step confirms that your module is compiled into PHP Then start writing  
code and repeat the last two steps as often as necessary
[root@centos  ext]# cd my_module/
[root@centos my_module]# vim configm
根据你自己的选择将  
dnl PHP_ARG_WITH(my_module for my_module support
dnl Make sure that  the comment is aligned:
dnl [ withmy_module Include my_module support])  
修改成
PHP_ARG_WITH(my_module for my_module support
Make sure that  the comment is aligned:
[ withmy_module Include my_module support])  
或者将
dnl PHP_ARG_ENABLE(my_module whether to enable my_module support  
dnl Make sure that the comment is aligned:
dnl [ enablemy_module  Enable my_module support])
修改成
PHP_ARG_ENABLE(my_module whether to  enable my_module support
Make sure that the comment is aligned:
[  enablemy_module Enable my_module support])
[root@centos my_module]# vim  my_modulec
将文件其中的下列代码进行修改
/* Every user visible function must have an  entry in my_module_functions[]
*/
function_entry my_module_functions[]  = {
PHP_FE(say_hello NULL)/* ?添加着一行代码 */  
PHP_FE(confirm_my_module_compiledNULL) /* For testing remove later  */
{NULL NULL NULL}/* Must be the last line in  my_module_functions[] */
};
在文件的最后添加下列代码
PHP_FUNCTION(say_hello)  
{
zend_printf("hello sdomain!");
}
再修改php_sdomainh
vi  php_sdomainh
在PHP_FUNCTION(confirm_my_module_compiled ); /* For testing  remove later */ 这行的下面添加一行
PHP_FUNCTION(say_hello); /* For testing remove  later */
保存文件退出
然后我们就可以在这个目录下使用上面的命令了  
/usr/local/php/bin/phpize
执行以后会看到下面的
[root@ns sdomain]#  /usr/local/php/bin/phpize
Configuring for:
PHP Api Version:  
Zend Module Api No:
Zend Extension Api No:  
[root@ns sdomain]#
然后执行/configure  withphpconfig=/usr/local/php/bin/phpconfig
然后执行make
make  install
然后他会把对应的so文件生成放到PHP安装目录下面的一个文件夹并提示在在什么地方然后再把里面的SO文件拷到你存放SO文件的地方  
即你在phpini里面的extension_dir所指定的位置
最后一步是你在phpini文件中打开这个扩展  
extension=sdomainso
然后
重新起动apache

               

上一篇:解析PHP函数array

下一篇:php调用MsSQL存储过程使用内置RETVAL获取过程中的return值