在Ubuntu上安装PECL id3扩展

时间:2014-01-14 00:20:05

标签: php ubuntu pecl id3 id3v2

我一直尝试这个,现在仍然无法找到答案当我尝试这个sudo pecl install id3这个错误发生时

downloading id3-0.2.tgz ...
Starting to download id3-0.2.tgz (20,693 bytes)
.....done: 20,693 bytes
4 source files, building
running: phpize
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module

If the command failed with 'phpize: not found' then you need to install php5-dev     packageYou can do it by running 'apt-get install php5-dev' as a root userERROR: `phpize' failed

请帮忙!!!我已经安装了php5-dev。

2 个答案:

答案 0 :(得分:5)

http://php.net/manual/en/id3.installation.php

您需要先使用以下方式下载id3:

#Security warnings

Method                  | Warning Type    | Message                    
------------------------------------------------------
show                    | Unscoped Find   | Unscoped call to PatientMessage#find near line 27: Message.find(+params[:id]+)
------------------------------------------------------

#Controller warnings:

Controller            | Warning Type               | Message
----------------------------------------------------------------------------
ApplicationController | Cross-Site Request Forgery | 'protect_from_forgery' should be called in ApplicationController

必须在第196行更改: function_entry id3_functions [] = {

zend_function_entry id3_functions [] = {

pecl download id3-alpha
tar -zxvf id3*.tgz
vim id3.c 

然后将id3.so添加到php.ini文件中 并重新启动apache

答案 1 :(得分:4)

这是一个已知问题,请参阅https://bugs.php.net/bug.php?id=58650

经过测试,确认过的解决方法:

pear update-channels
pecl install --force id3
cd /build/buildd/php*/pear-build-download
tar -zxvf id3*.tgz
cd id3*/
phpize
./configure
make
make test
make install

id3.so扩展名添加到php.ini文件中:

nano /etc/php5/apache2/php.ini

像:

extension=id3.so

Dynamic Extensions部分。

然后,重新启动apache以便可以加载新配置:

service apache2 restart

通过检查apache错误日志文件确保一切顺利且没有错误:

tail -25 /var/log/apache2/error.log

成功应该有类似的输出:

[notice] caught SIGTERM, shutting down
[notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.9 with Suhosin-Patch configured -- resuming normal operations