While trying to improve the new website of CryptoNet by integrating some feeds and xml sitemap, my Ubuntu terminal raised following error while trying to install the sfSitemap2Plugin:

>> plugin installing plugin “sfSitemap2Plugin”

Fatal error: Cannot use object of type PEAR_Error as array in /usr/share/php/symfony_1.1/lib/plugin/sfPearRestPlugin.class.php on line 92

Now we will try to solve this! There are two possible reasons:

– symfony has a problem to raise an error
- the plugin is not compatible with this version of symfony (ie 1.1.1, instead of 1.1.0)

First check the dependencies in the package.xml file of the plugin. Just download the pear package from the plugin page, and extract it to your desktop. Open package.xml. In my case the max version of Symfony had to be 1.1.0, and since I’m using 1.1.1 that could be the problem causing this fatal error message.

Next step is to change these requirements and archive the whole package. Change the Symfony dependency to:

<dependencies>
<required>
<php>
<min>5.1.0</min>
</php>
<pearinstaller>
<min>1.4.1</min>
</pearinstaller>
<package>
<name>symfony</name>
<channel>pear.symfony-project.com</channel>
<min>0.8.1</min>
<max>1.2.0</max>
<exclude>1.2.0</exclude>
</package>
</required>
</dependencies>

Save the file, and make an archive of the package.xml AND the plugin folder (in my case sfSitemap2Plugin-0.0.2). You can archive it to .tar for example. Rename it to .tgz afterwards.

Final step we have to do is install the plugin, with the path to your self-made archive. Get back to your terminal and execute following command (of course you need to change the path according to yours):

symfony_1.1 plugin:install /home/../sfSitemap2Plugin-0.0.2/sfSitemap2Plugin-0.0.2.tgz

In my case I use symfony_1.1 for my Symfony 1.1 commands. Don’t forget to change this if you used to using “symfony”.

Thanks to Johny_the_french for this solution.