熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> PHP編程 >> 正文

php源代碼安裝常見錯誤與解決辦法

2013-11-15 12:29:21  來源: 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_compiled   NULL) /* 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


From:http://tw.wingwit.com/Article/program/PHP/201311/21053.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.