1

I'm trying to install the json extension for my php on fedora 17.

I downloaded the package from here

http://pecl.php.net/get/json-1.2.1.tgz

and ran phpize in the directory, then configured and it's all ok.

But when I run make, this error appears.

I have searched the error, but no solutions appear.

Any suggestion?

I have to do this becouse in my php.ini configure i got '--disable-json'

And when i run pecl install json for enable the extension, show me other errors with pecl. I want to compile manually the package from pecl!

Thanks!

thanks

[juan@fedoris json-1.2.1]$ sudo make
[sudo] password for juan: 
/bin/sh /home/juan/recursos/json-php/json-1.2.1/libtool --mode=compile cc  -I. -I/home/juan/recursos/json-php/json-1.2.1 -DPHP_ATOM_INC -I/home/juan/recursos/json-php/json-1.2.1/include -I/home/juan/recursos/json-php/json-1.2.1/main -I/home/juan/recursos/json-php/json-1.2.1 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /home/juan/recursos/json-php/json-1.2.1/json.c -o json.lo 
 cc -I. -I/home/juan/recursos/json-php/json-1.2.1 -DPHP_ATOM_INC -I/home/juan/recursos/json-php/json-1.2.1/include -I/home/juan/recursos/json-php/json-1.2.1/main -I/home/juan/recursos/json-php/json-1.2.1 -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/juan/recursos/json-php/json-1.2.1/json.c  -fPIC -DPIC -o .libs/json.o
/home/juan/recursos/json-php/json-1.2.1/json.c:44:1: error: unknown type name ‘function_entry’
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: braces around scalar initializer [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: (near initialization for ‘json_functions[0]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: initialization makes integer from pointer without a cast [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: (near initialization for ‘json_functions[0]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: excess elements in scalar initializer [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: (near initialization for ‘json_functions[0]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: excess elements in scalar initializer [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: (near initialization for ‘json_functions[0]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: excess elements in scalar initializer [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: (near initialization for ‘json_functions[0]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: excess elements in scalar initializer [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:45:5: warning: (near initialization for ‘json_functions[0]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: braces around scalar initializer [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: (near initialization for ‘json_functions[1]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: initialization makes integer from pointer without a cast [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: (near initialization for ‘json_functions[1]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: excess elements in scalar initializer [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: (near initialization for ‘json_functions[1]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: excess elements in scalar initializer [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: (near initialization for ‘json_functions[1]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: excess elements in scalar initializer [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: (near initialization for ‘json_functions[1]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: excess elements in scalar initializer [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:46:5: warning: (near initialization for ‘json_functions[1]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: braces around scalar initializer [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: (near initialization for ‘json_functions[2]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: initialization makes integer from pointer without a cast [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: (near initialization for ‘json_functions[2]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: excess elements in scalar initializer [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: (near initialization for ‘json_functions[2]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: excess elements in scalar initializer [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:47:5: warning: (near initialization for ‘json_functions[2]’) [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:58:5: warning: initialization from incompatible pointer type [enabled by default]
/home/juan/recursos/json-php/json-1.2.1/json.c:58:5: warning: (near initialization for ‘json_module_entry.functions’) [enabled by default]
make: *** [json.lo] Error 1
  • 1
    As of PHP 5.2.0, the JSON extension is bundled and compiled into PHP by default. Why do you want to compile your own?! – Florent Aug 06 '12 at 15:50
  • I have the php-5.4.5 package installed and in my php its says Fatal error: Call to undefined function Monolog\Formatter\json_encode() – user1579686 Aug 06 '12 at 16:15
  • I have to do this becouse in my php.ini configure i got '--disable-json' And when i run pecl install json for enable the extension, show me other errors with pecl. I want to compile manually the package from pecl! Thanks! – user1579686 Aug 06 '12 at 16:34
  • @user1579686 Can't you just recompile PHP without `--disable-json`? It would probably be easier. Seems like an odd thing to do anyway... – DaveRandom Aug 06 '12 at 16:50
  • Dave! i installed php from the yum package of fedora, not from source. So i cant recompile it! – user1579686 Aug 06 '12 at 16:54

1 Answers1

0

The package you have downloaded was released in 2006 and for php 4. It is unlikely that you can compile it as an extension for your php 5.4.5. It is better to recompile php using "Configure Command" from phpinfo() after removing --disable-json from it as pointed out.

air4x
  • 5,618
  • 1
  • 23
  • 36
  • but, i musta ask. Is it possible to recompile php if i have installed php from yum package manager?? – user1579686 Aug 07 '12 at 00:49
  • if you installed it through yum, you could try the steps described in http://stackoverflow.com/questions/7979864/php-5-3-8-json-centos-6 – air4x Aug 07 '12 at 03:48