1

le 24 août 2010 à 13:11:30

Publié par Axel Etcheverry

Suite à la réinstallation de mon serveur sous gentoo, j'ai été confronté à un problème d'installation de l'extension pecl php-sphinx.

je vous livre la solution qui a marché pour moi.

Installation de libsphinxclient


$ wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz
$ tar -zxvf sphinx-0.9.8.1.tar.gz
$ cd sphinx-0.9.8.1/api/libsphinxclient
$ CXXCPP=\"gcc -E\" ./configure
$ make
$ sudo make install

Installation de php-sphinx


$ wget http://pecl.php.net/get/sphinx-1.0.4.tgz
$ tar -xvzf sphinx-1.0.4.tgz
$ cd sphinx-1.0.4/
$ phpize
$ aclocal
$ libtoolize --force
$ autoheader
$ autoconf
$ ./configure
$ make
$ sudo make install

ensuite il faut activer l'extension dans la config php.

créer un fichier sphinx.ini et ajouter cette ligne :
extension=sphinx.so
créer le lien symbolique
$ sudo ln -s /etc/php/apache2-php5/ext/sphinx.ini /etc/php/apache2-php5/ext-active/sphinx.ini

le 3 août 2010 à 16:24:49

Publié par Axel Etcheverry

Voici comment installer l'extension sphinx pour php sur un systeme Mac OSX 1.6.x

il faut d'abord installer Sphinx via port.
shell sudo port install sphinx

Pour Mac OSX Lion (10.7)
shell sudo port install sphinx configure.compiler=llvm-gcc-4.2

Installation de la libsphinxclient
shell wget http://www.sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz
shell tar -zxvf sphinx-0.9.8.1.tar.gz
shell cd sphinx-0.9.8.1/api/libsphinxclient
shell CXXCPP=\"gcc -E\" ./configure --prefix=/opt/sphinx
shell make
shell sudo make install
il faut maintenant installer l'extension php-sphinx
sudo pecl install sphinx
à un moment il vous demande d'indiquer le préfixe d'installation de libsphinxclient ajouter /opt/sphinx voir ci-dessous
downloading sphinx-1.0.4.tgz ...
Starting to download sphinx-1.0.4.tgz (12,280 bytes)
.....done: 12,280 bytes
4 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
Please provide the installation prefix of libsphinxclient [autodetect] : /opt/sphinx
une fois la compilation finie il vous suffit d'ajouter l'extension dans le php.ini
[sphinx]
extension=sphinx.so

le 15 oct. 2009 à 02:14:57

Publié par Axel Etcheverry

Pour commencer à utiliser Sphinx avec PHP et MySQL, commencez par télécharger l'archive des sources Sphinx (v0.9.8.1) et de compiler les fichiers sources de Sphinx et ses bibliothèques.
En supposant que vous êtes sur un système Debian, voici comment faire :

shell tar -xzvf sphinx-0.9.8.1.tar.gz
shell cd sphinx-0.9.8.1
shell ./configure --with-mysql
shell make
shell make install
shell cd api/libsphinxclient
shell ./configure
shell make
shell make install
Une fois Sphinx et libsphinxclient installés, télécharger, compiler et installer la dernière version de l'extension Sphinx de PHP en utilisant l'installateur automatique PECL, comme ci-dessous:

shell pecl install sphinx
Vous pouvez également réaliser cette opération manuellement, en téléchargeant les sources de l'extension Sphinx et de l'installer avec la commande phpize:

shell tar -xzvf sphinx-1.0.0.tar.gz
shell cd sphinx-1.0.0/
shell phpize
shell ./configure
shell make
shell make install
Quelle que soit la méthode que vous choisissez, vous devrez vous retrouver avec un module PHP sphinx.so dans votre répertoire d'extensions PHP. Vous devez maintenant activer l'extension dans la configuration du fichier php.ini, redémarrez votre serveur Web, et vérifiez que l'extension est activée avec un appel rapide à la fonction phpinfo().

1