简体   繁体   English

在Ubuntu Server 12.04上编译libvirt-php时出错

[英]Error compiling libvirt-php on Ubuntu Server 12.04

i am trying to setup libvirt-php in my ubuntu server to do some test with the PHP API. 我正在尝试在我的ubuntu服务器中设置libvirt-php以使用PHP API进行一些测试。 I am following this procedure: 我正在执行以下步骤:

sudo apt-get install libvirt-dev xsltproc libxml2-dev libxml2  
cd ~ 
git clone git://libvirt.org/libvirt-php.git libvirt-php  
cd libvirt-php  
sudo sh autogen.sh  
sudo ./configure  
sudo make  
sudo make install  
sudo service apache2 restart

i also installed php5-dev and xmllint package for ubuntu, but when i go to the 7 line: make i get these errors: 我还为ubuntu安装了php5-dev和xmllint软件包,但是当我转到7行时:使我得到以下错误:

make  all-recursive
make[1]: Entering directory `/root/libvirt-php'
Making all in tools
make[2]: Entering directory `/root/libvirt-php/tools'
gcc -Wall -o generate-api-docs generate-api-docs.c
./generate-api-docs ../src/libvirt-php.c ../docs/api-reference.html.in
Documentation has been generated successfully
./generate-api-docs --private ../src/libvirt-php.c ../docs/dev-api-reference.html.in
Documentation has been generated successfully
make[2]: Leaving directory `/root/libvirt-php/tools'
Making all in src
make[2]: Entering directory `/root/libvirt-php/src'
gcc -g -O2 -Wall -fpic -DCOMPILE_DL_LIBVIRT=1 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -c -o libvirt-php.o libvirt-php.c -I/usr/include/libxml2    -DHAVE_CONFIG_H
libvirt-php.c: In function ‘zm_startup_libvirt’:
libvirt-php.c:1149:2: error: ‘VIR_DOMAIN_VCPU_GUEST’ undeclared (first use in this function)
libvirt-php.c:1149:2: note: each undeclared identifier is reported only once for each function it appears in
libvirt-php.c: In function ‘zif_libvirt_domain_get_metadata’:
libvirt-php.c:3240:2: warning: implicit declaration of function ‘virDomainGetMetadata’ [-Wimplicit-function-declaration]
libvirt-php.c:3240:6: warning: assignment makes pointer from integer without a cast [enabled by default]
libvirt-php.c: In function ‘zif_libvirt_domain_set_metadata’:
libvirt-php.c:3285:2: warning: implicit declaration of function ‘virDomainSetMetadata’ [-Wimplicit-function-declaration]
libvirt-php.c: In function ‘zif_libvirt_connect_get_soundhw_models’:
libvirt-php.c:4135:8: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
libvirt-php.c: In function ‘zif_libvirt_connect_get_nic_models’:
libvirt-php.c:4064:8: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
libvirt-php.c: In function ‘zif_libvirt_domain_get_screenshot_api’:
libvirt-php.c:3564:9: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
libvirt-php.c: In function ‘zif_libvirt_image_create’:
libvirt-php.c:2172:8: warning: ignoring return value of ‘system’, declared with attribute warn_unused_result [-Wunused-result]
make[2]: *** [build] Error 1
make[2]: Leaving directory `/root/libvirt-php/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/libvirt-php'
make: *** [all] Error 2

so i cannot compile. 所以我不能编译。 Any help? 有什么帮助吗?

The require version wrote in git://libvirt.org/libvirt-php seems incorrect 在git://libvirt.org/libvirt-php中编写的require版本似乎不正确

It shows LIBVIRT_REQUIRED=0.6.2 , but in version 0.9.8 which Ubuntu 12.04 using, variable virDomainGetMetadata and VIR_DOMAIN_VCPU_GUEST are not defined, which led to this error. 它显示LIBVIRT_REQUIRED=0.6.2 ,但是在版本0.9.8中(使用Ubuntu 12.04的版本中)未定义变量virDomainGetMetadataVIR_DOMAIN_VCPU_GUEST ,这导致此错误。

(If you want query what you libvirt-dev version is, type $ dpkg-query -s libvirt-dev ) (如果要查询您的libvirt-dev版本,请输入$ dpkg-query -s libvirt-dev

You can try this: 您可以尝试以下方法:

  1. Upgrade your Ubuntu 升级您的Ubuntu

    Latest version of Ubuntu supports new libvirt-dev that have variable virDomainGetMetadata 最新版本的Ubuntu支持具有变量virDomainGetMetadata新libvirt-dev

    https://launchpad.net/ubuntu/+source/libvirt https://launchpad.net/ubuntu/+source/libvirt

  2. Use libvirt-php 0.4.8 使用libvirt-php 0.4.8

    I use this to solve the problem, but another problem arises out that it does not support libvirt_domain_get_metadata . 我用它来解决问题,但是又出现了一个不支持libvirt_domain_get_metadata

    The following steps show how to use libvirt-php 0.4.8: 以下步骤显示了如何使用libvirt-php 0.4.8:

    Visit http://libvirt.org/php/downloads.html 造访http://libvirt.org/php/downloads.html

     $wget http://libvirt.org/sources/php/libvirt-php-0.4.8.tar.gz $tar -xvf libvirt-php-0.4.8.tar.gz $cd libvirt-php-0.4.8 $./configure $make 

    Check there are not another problem then 然后检查没有其他问题

     $sudo make install $sudo /etc/init.d/apache2 restart 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 libvirt-php收到错误:无法连接到服务器权限被拒绝 - libvirt-php receives the error: unable to connect to server Permission denied libvirt-php收到错误:内部错误无法在/ usr / sbin中找到libvirtd守护程序 - libvirt-php receives the error: internal error Unable to locate libvirtd daemon in /usr/sbin ubuntu服务器12.04-PHP文件下载 - ubuntu server 12.04 - php files downloading 安装PHP PEAR ubuntu 12.04时出错 - Error installing PHP PEAR ubuntu 12.04 有什么方法可以使用libvirt-php API执行qemu-agent-command吗? - Is there any way to execute qemu-agent-command using libvirt-php API? apache2 web-server的Ubuntu 12.04 php,mysql-server和phpmyadmin安装错误 - Ubuntu 12.04 php, mysql-server and phpmyadmin installation error with apache2 web-server 在Ubuntu Server 12.04上设置Web应用程序会导致内部服务器错误 - Setting up web application on Ubuntu Server 12.04 results in Internal Server Error 使用XAMPP服务器在ubuntu 12.04 LTS上安装Phalcon - Phalcon installation on ubuntu 12.04 LTS with XAMPP server 尝试使用php mail()时,安装了pear的ubuntu服务器12.04上的Xampp返回错误 - Xampp on ubuntu server 12.04 with pear installed returns errors when trying to use php mail() XAMPP Php SQLite3没有此类模块:fts3- ubuntu服务器12.04 X86 - XAMPP Php SQLite3 no such module: fts3- ubuntu server 12.04 X86
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM