I'm trying to install this PHP module from NYTimes (http://code.nytimes.com/projects/xslcache)
I unfortunately am falling at the last hurdle. I've installed it, added to my php.ini, but I am getting this error when running in my PHP code.
Fatal error: Class 'xsltCache' not found in...
My php code is as described by the NYTimes website
$xslt = new xsltCache;
Any ideas why that may happen?
My install script for the module is
cd ~
mkdir setups
cd setups
wget http://code.nytimes.com/downloads/xslcache.tar.gz
tar -xvf xslcache.tar.gz
cd xslcache
phpize && ./configure --with-xslcache=/usr/lib/libxslt.so --with-xsl-exsl-dir=/usr/lib/libexslt.so
make
make install
And it seems to work completely fine, no errors, php.ini is fine. Something I have notified, it doesn't show up in phpinfo().
Check that you added the extension to the correct php.ini file.
If you have a PHP directory you may have one in there, but the one you want to add the extension to is likely in your server directory.
I.E. On my PC, the correct php.ini to modify is apache\bin\php.ini
P.S. Don't forget to restart your server.
It sounds like you haven't loaded the extension in you php.ini file with extension=xslcache.so. If you do have that line in your php.ini file, check your error logs and see if PHP had trouble loading the extension.
Throwing out a guess here but capitalisation issue? The API docs refer to the class as XSLTCache() but the cover page on nytimes and your code say xsltCache(); I can't tell from what I've read or what i can find on Google whether PHP classnames are case-sensitive.
it is a capitalization issue, but not quite what SpliFF suggests:
If you look at this test include file on the nytimes site, the capitalization should be:
$proc = new xsltcache;
Could it be a permission problem on the /usr/lib/libexslt.so file? Maybe php does not have access to it?