pecl/solr cant seem to install normaly

2019-09-07 05:50发布

问题:

I'm trying to connect to my Solr server trough PHP. I got a tutorial that users the SolrClient(). My but this was not available on my Linux (ubuntu) server. Now I'm trying to install it to my apache. The problem is that I cant seem to get the extensions working. I am trying to get it through sudo pecl install solr-beta. But this keeps giving the following error: Download of "pecl/solr" succeeded, but it is not a valid package archive.

So my question is how can this be when this is according to most tutorials the only way i can get this extention of apache? And how do I get this working. I'm realy stuk.

Ohh I have tried to get it trough download but the necessary files are missing to configure and use make.

回答1:

You're going to need phpize installed if you try to download the archive by yourself. If you have phpize installed, the way to do this manually:

pecl download solr-beta
tar xvzf solr-2.0.0.tgz
cd solr-2.0.0
phpize
./configure
make
sudo make install
# add extension=solr.so to your php.ini / distribution extension loader

.. this should be the same as doing pecl install solr-beta, so if that fails you'll at least be able to see where in the chain any issues arise. A complete log of the pecl session might be useful to debug it any further.