2

I have been trying this from a week now still couldnt find an answer for this when i try this sudo pecl install id3 this error happens

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

please help !!! I have already installed php5-dev.

maniteja
  • 687
  • 2
  • 16
  • 32
  • 1
    Did you try running `phpize` to see if it's installed and in your `PATH`? – Jonathon Reinhart Jan 14 '14 at 00:21
  • Im sorry im new to ubuntu i just shifted from windows just that i can use this extension and i didnt have the idea that i should check it and i did now and the same error cannont find config.m4 – maniteja Jan 14 '14 at 00:23
  • 1
    I'm not sure, but Googling for [`phpize "Cannot find config.m4"`](http://www.google.com/search?q=phpize+%22Cannot+find+config.m4%22) would be a good start. – Jonathon Reinhart Jan 14 '14 at 00:26
  • @JonathonReinhart thank you sir, Followed these steps [link](http://php.net/manual/en/install.pecl.phpize.php) and have successfully generated the id3.so and added `extension=id3.so` to php.ini but still cant use the id3 functions :/ error is `Call to undefined function` – maniteja Jan 14 '14 at 01:46

2 Answers2

7

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

You will need to download id3 first using:

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

Have to change in line 196: function_entry id3_functions[ ] = {

into

zend_function_entry id3_functions[ ] = {

phpize
./configure
make
make test
make install

Then add the id3.so into your php.ini file and restart apache

Coach Chuck
  • 106
  • 1
  • 3
  • id3-alpha doesn't even begin to build. It has lots of compiler errors like missing semicolons, wrong number of methods passed to functions, etc... – Gargoyle Jun 28 '16 at 15:07
3

This is a known issue, see https://bugs.php.net/bug.php?id=58650

Tried, tested, confirmed workaround:

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

Add the id3.so extension to your php.ini file:

nano /etc/php5/apache2/php.ini

like:

extension=id3.so

to the Dynamic Extensions section.

Then, restart apache so that the new configuration can be loaded:

service apache2 restart

ensure that everything went well and there are no errors, by checking the apache error log file:

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

Success should have a similar output:

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