当前位置: 移动技术网 > IT编程>开发语言>PHP > php源代码安装常见错误与解决办法分享

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

2019年04月11日  | 移动技术网IT编程  | 我要评论

冯铭瑄,恽自求,黑豚养殖

错误: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

解决:用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



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

解决:yum -y install libxml2 libxml2-devel



错误:configure: error: cannot find openssl's <evp.h>

解决:yum install openssl openssl-devel



错误:configure: error: please reinstall the libcurl distribution -easy.h should be in <curl-dir>/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
configure: error: xml configuration could not be found

yum -y install libxml2 libxml2-devel

cannot find openssl's <evp.h>
yum install openssl openssl-devel

1) configure: error: xml2-config not found. please check your libxml2 installation.
#yum install libxml2 libxml2-devel (for redhat & fedora)
# aptitude install libxml2-dev (for ubuntu)

2) checking for pkg-config… /usr/bin/pkg-config
configure: error: cannot find openssl's <evp.h>
#yum install openssl openssl-devel

3) configure: error: please reinstall the bzip2 distribution
# yum install bzip2 bzip2-devel

4) configure: error: please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
# yum install curl curl-devel (for redhat & fedora)
# install libcurl4-gnutls-dev (for ubuntu)

5) configure: error: libjpeg.(also) not found.
# yum install libjpeg libjpeg-devel

6) configure: error: libpng.(also) not found.
# yum install libpng libpng-devel

7) configure: error: freetype.h not found.
#yum install freetype-devel

8) configure: error: unable to locate gmp.h
# yum install gmp-devel

9) configure: error: cannot find mysql header files under /usr.
note that the mysql client library is not bundled anymore!
# yum install mysql-devel (for redhat & fedora)
# apt-get install libmysql++-dev (for ubuntu)

10) configure: error: please reinstall the ncurses distribution
# yum install ncurses ncurses-devel

11) checking for unixodbc support… configure: error: odbc header file ‘/usr/include/sqlext.h' not found!
# yum install unixodbc-devel

12) configure: error: cannot find pspell
# yum install pspell-devel

13) configure: error: mcrypt.h not found. please reinstall libmcrypt.
# yum install libmcrypt libmcrypt-devel (for redhat & fedora)
# apt-get install libmcrypt-dev

14) configure: error: snmp.h not found. check your snmp installation.
# yum install net-snmp net-snmp-devel

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

16)
为php编译xcache模块的时候,需要运行phpize
得到了一个错误
#/usr/local/php/bin/phpize
configuring for:
php api version: 20041225
zend module api no: 20060613
zend extension api no: 220060519
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下执行 apt-get install autoconf 即可
17)
# /usr/local/php/bin/phpize
cannot find config.m4.
make sure that you run '/usr/local/php/bin/phpize' in the top level source directory of the module
修改方法:
[root@centos lnmp]# cd php-5.2.14ext/
[root@centos ext]# ./ext_skel --extname=my_module
creating directory my_module
creating basic files: config.m4 config.w32 .cvsignore my_module.c php_my_module.h credits experimental tests/001.phpt my_module.php [done].
to use your new extension, you will have to execute the following steps:
1. $ cd ..
2. $ vi ext/my_module/config.m4
3. $ ./buildconf
4. $ ./configure --[with|enable]-my_module
5. $ make
6. $ ./php -f ext/my_module/my_module.php
7. $ vi ext/my_module/my_module.c
8. $ make
repeat steps 3-6 until you are satisfied with ext/my_module/config.m4 and
step 6 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 config.m4
根据你自己的选择将
dnl php_arg_with(my_module, for my_module support,
dnl make sure that the comment is aligned:
dnl [ --with-my_module include my_module support])
修改成
php_arg_with(my_module, for my_module support,
make sure that the comment is aligned:
[ --with-my_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 [ --enable-my_module enable my_module support])
修改成
php_arg_enable(my_module, whether to enable my_module support,
make sure that the comment is aligned:
[ --enable-my_module enable my_module support])
[root@centos my_module]# vim my_module.c
  将文件其中的下列代码进行修改
/* 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_sdomain.h
vi php_sdomain.h
在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:     20020918
  zend module api no:   20020429
  zend extension api no:  20050606
  [root@ns sdomain]#
  然后执行./configure --with-php-config=/usr/local/php/bin/php-config
  然后执行make
  make install
然后他会把对应的so文件生成放到php安装目录下面的一个文件夹,并提示在在什么地方,然后再把里面的so文件拷到你存放so文件的地方
  即你在php.ini里面的extension_dir所指定的位置
  最后一步是你在php.ini文件中打开这个扩展
  extension=sdomain.so
  然后
  重新起动apache

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

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网