I was playing with the extjs lib http://extjs.com/deploy/ext-2.0.1.zip on a standard rhel4 apache/php4 setup, and was wondering why the examples that use the jason encoding routines where not working. After sorting out all the misleading information that google came up with about json requiring php5, I finally have the solution for php4, and it is very simple:
1. Download php-json-ext-1.2.1.tar.bz2 from http://www.aurore.net/projects/php-json/
2. Extract and install: tar xfj php-json-ext-1.2.1.tar.bz2 ; cd php-json-ext-1.2.1 ; ./configure –prefix=/usr ; make install
3. Edit /etc/php.ini and add the line “extension=json.so”, then do a service httpd reload.
voila, it works: test.php can now do json_encode($arrayname), and all the extjs examples that use json to provide data to the tree-container drag and drop examples like /var/www/html/ext-2.0.1/examples/tree/two-trees.html now work.
I just confirmed it also works with the newer ext-2.1. Now all I have to do is figure out how to create proper trees from dmidecode output 😉