Cannot activate plugin

Bug #757343 reported by Walter Ebert
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
WordPress Sphinx Plugin
Fix Released
Undecided
Unassigned

Bug Description

If I try to activate the plugin I get the following PHP error:

Fatal error: Cannot redeclare class SphinxClient in /home/wordpress/wp-content/plugins/wordpress-sphinx-plugin/php/sphinxapi.php on line 379 Call Stack: 0.0000 634392 1. {main}() /home/wordpress/wp-admin/plugins.php:0 1.5119 11225144 2. plugin_sandbox_scrape() /home/wordpress/wp-admin/plugins.php:151 1.5121 11236992 3. include('/home/wordpress/wp-content/plugins/wordpress-sphinx-plugin/sphinxsearch.php') /home/wordpress/wp-admin/plugins.php:149 1.5161 11320128 4. include_once('/home/wordpress/wp-content/plugins/wordpress-sphinx-plugin/php/sphinxapi.php') /home/wordpress/wp-content/plugins/wordpress-sphinx-plugin/sphinxsearch.php:60

I am using Wordpress 3.1.1 and PHP5.3.6

Revision history for this message
Yaroslav Vorozhko (vorozhko) wrote :

Hello,
Have you installed other version of WP Sphinx plugin or other plugin which use Sphinx Search?
If so, try to deactivate them, because they used the same library as WP Sphinx Plugin.

Revision history for this message
Walter Ebert (walterebert) wrote :

Turns out that I had the PHP Sphinx extension installed (http://pecl.php.net/package/sphinx)

In sphinxsearch.php you should probably add an extra check, e.g.:

if( !extension_loaded('sphinx') ) {
   if (file_exists(SPHINXSEARCH_SPHINX_INSTALL_DIR.'/api/sphinxapi.php'))
      include_once(SPHINXSEARCH_SPHINX_INSTALL_DIR.'/api/sphinxapi.php');
   else
    include_once(SPHINXSEARCH_PLUGIN_DIR.'/php/sphinxapi.php');
}

Revision history for this message
Yaroslav Vorozhko (vorozhko) wrote :

Thanks Walter, we will definitely add this to the next release.

Changed in wp-sphinx-plugin:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.