PHP Solr install not working - php

I've running to the error of trying to install solr with the pecl extension. I've read this one:
Trying to install pecl Solr extension but it needs curl (Server Fault)
I'm using php 5.3.3 on a centos 6 server.
And both times I get the same problem:
pecl install -n solr-beta or pecl install -n solr or pear install pecl/solr
Enable Solr (yes of course) [yes] :
Enable Solr Debugging (Compiles solr in debug mode) [no] :
libcURL install prefix [/usr] :
libxml2 install prefix [/usr] :
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/
ERROR: `/var/tmp/solr/configure --enable-solr=yes --enable-solr-debug=no --with-curl=/usr --with-libxml-dir=/usr' failed
Is there another fix for this?

i had the same problem and i just had to do is:
sudo apt-get install libcurl4-gnutls-dev libxml2-dev
And reinstall it.
Font: link

The solution you have linked will only work if you actually have curl installed as a module - if you didn't do it now and try again.

Related

installing amqp on mac with brew

I wanted to install amqp with pecl for my mac sierra.
I installed php with brew, with pecl install amqp I receive an error: checking for amqp using pkg-config... configure: error: librabbitmq not found
I installed with brew the librabbitmq-c package but I still get this error. I think it's somehow not synced with the pkg-config.
Does someone have an idea what to do here?
First install rabbitmq-c with brew:
brew search librabbitmq
No formula or cask found for "librabbitmq".
Closed pull requests:
Add rabbitmq-c (aka librabbitmq) formula (https://github.com/Homebrew/legacy-homebrew/pull/13437)
brew install rabbitmq-c
Then install amqp with pecl:
pecl install amqp
Set the path to librabbitmq:
Set the path to librabbitmq install prefix [autodetect] : /usr/local/Cellar/rabbitmq-c/0.9.0
Verify that amqp is now installed:
php -i|grep amqp
Thanks for this walk through, it was super helpful. Just a quick note, in Mac OS 12.0.1 Monterey, the default install path for rabbitmq in homebrew is:
/opt/homebrew/Cellar/rabbitmq-c/0.11.0
I'm on MacOS High Sierra. I installed the Command_line_Tools_macOS_10.13_for_Xcode_10.1.dmg from developer.apple.com and brew installed php 8.
For the amqp extension, I used:
brew install rabbitmq-c
pecl install amqp-1.11.0beta
at the prompt
Set the path to librabbitmq install prefix [autodetect] :
I entered:
Set the path to librabbitmq install prefix [autodetect] : /usr/local/Cellar/rabbitmq-c/0.11.0
The issue lies with pkg-config not being able to generate libs/cflags for librabbitmq.
$ pkg-config librabbitmq --cflags
Package openssl was not found in the pkg-config search path.
Perhaps you should add the directory containing `openssl.pc'
to the PKG_CONFIG_PATH environment variable
Package 'openssl', required by 'librabbitmq', not found
What I did was to add both rabbitmq-c and openssl to $PKG_CONFIG_PATH as below:
export PKG_CONFIG_PATH="/usr/local/Cellar/rabbitmq-c/0.10.0/lib/pkgconfig:/usr/local/opt/openssl#1.1/lib/pkgconfig"
Then the build will succeed. (Note: I built mine with phpbrew rather than pecl, but should work).
Brew doesn't add the file to the pkg-config path, so it needed a command:
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/Cellar/rabbitmq-c/0.9.0/lib/pkgconfig"
Before installing make sure the taps are up-to-date:
brew update
Then, install RabbitMQ server with:
brew install rabbitmq
In case that directory is not in PATH it's recommended to append it:
export PATH=$PATH:/usr/local/sbin
It's a combination of question and both previous answers which worked for me.
First install RabbitMQ through brew as rabbitmq-c. Then with PECL but add the config path when asked: /usr/local/Cellar/rabbitmq-c/0.10.0
Needs to be adjusted with your installed brew version of RabbitMQ.
On my M1 Mac Pro, PHP 8.2.1 the PECL install amqp rabbbitmq path it wanted is /opt/homebrew/Cellar/rabbitmq-c/0.11.0/
Hope this helps someone.

Pecl install sqlsrv returns No releases available for package

While installing sqlsrv module for PHP7 i'm getting following error -
No releases available for package "pecl.php.net/sqlsrv
Command used
sudo pecl install sqlsrv
Any idea how to resolve this issue?
Same problem here... Solved installing modules as root this way (Ubuntu 16.04):
wget http://pecl.php.net/get/sqlsrv-4.3.0.tgz
pear install sqlsrv-4.3.0.tgz
wget http://pecl.php.net/get/pdo_sqlsrv-4.3.0.tgz
pear install pdo_sqlsrv-4.3.0.tgz
You can check latests available versions here: http://pecl.php.net/package-search.php?pkg_name=sqlsrv&bool=AND&submit=Search
And check if php modules are enabled after installation:
php -m | grep sqlsrv
Try to install a certain version that you know exists:
$ pecl install sqlsrv-4.3.0
Also try to clear the cache:
$ pear clear-cache
For corporate proxy users, you might just need to tell pear to use your proxy.
pear config-set http_proxy http://proxy.example.com:8080
Sometimes pecl.php.net is not available or down. In this case pecl install may show "no releases available".
Just for information.

Unable to install php solr extension

Using pecl install -n solr gives
No releases available for package "pecl.php.net/solr"
install failed
Also tried pear install pecl/solr which gives the same output :
No releases available for package "pecl.php.net/solr"
install failed
I'm using a Mac and php56.
Output of pecl -V
PEAR Version: 1.9.4
PHP Version: 5.6.25
Zend Engine Version: 2.6.0
Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016;
root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64
Another important piece of information is that, pear and pecl were not available in my system, so I installed them using
sudo php /usr/lib/php/install-pear-nozlib.phar -d /usr/local/lib/php -b /usr/local/bin
Update
Tried sudo pecl install -n solr and now it seems to go one step further
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
ERROR: phpize failed
Luckily stumbled upon
PEAR package install fails
which led to execute
pear list-upgrades which showed some kind of permission issue with cache directory, manually created the directory using sudo at the specified location (/private/tmp/pear/cache)
And then used sudo to install the solr extension as sudo pecl install -n solr which threw the following error :
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
brew install autoconf followed by sudo pecl install solr worked.

How to install V8js on PHP5.5?

I want to install the v8js extension for PHP5.5 on Ubuntu 12.04 but can't make it working.
When I try to install the v8js extension version 0.2.0 (latest) with PECL, I have this message:
configure: error: libv8 must be version 3.24.6 or greater
ERROR: `/tmp/pear/temp/v8js/configure --with-v8js' failed
If I try to install an old version, I have a compilation error. This message is very similar to my issue: Install v8js for php on ubuntu
How can I fix this issue?
EDIT: I couldn't install it on Ubuntu 14.04 with PHP5.5, even with a PHP downgrade with PHPbrew to PHP 5.4. However, using Ubuntu 12.04 with PHP 5.4 works great. I didn't try the downgrade from PHP 5.5 to 5.4 on Ubuntu 12.04.
in case you can't find libv8-dev or libv8-dbg, you can find the correct version by run command
~$ apt-cache search libv8
libv8-3.14-dbg - V8 JavaScript engine - debugging symbols
libv8-3.14-dev - V8 JavaScript engine - development files for 3.14 branch
libv8-3.14.5 - V8 JavaScript engine - runtime library
libv8-dev - V8 JavaScript engine - development files for latest branch
then you can run
~$ sudo apt-get install libv8-3.14-dev libv8-3.14-dbg g++ cpp
then you can try to install v8js via pecl by running
~$ sudo pecl install v8js-0.2.0
if that command return error like this
configure: error: libv8 must be version 3.24.6 or greater
ERROR: `/tmp/pear/temp/v8js/configure --with-v8js' failed
you can try to install v8js-0.1.3 instead by running
~$ sudo pecl install v8js-0.1.3
then edit your php.ini to add v8js extension
~$ echo "extension=v8js.so" >> /etc/php5/cli/php.ini
Open your terminal/console
sudo apt-get install libv8-dev libv8-dbg g++ cpp
Make an update sudo apt-get update
Try sudo pecl install v8js-0.2.0 (or other version i.e.: sudo pecl install v8js-0.1.3)
Edit your php.ini (Check: Where is my php.ini file?) file by adding: extension=v8js.so.
Restart server
If it the extension still doesn't work, try to edit /etc/php5/conf.d/v8js.ini and add extension=v8js.so and restart server again.
Hope this helps.
These other answers work well and I used v8js-0.1.3 for the past 1.5 years but after needing to upgrade to PHP 7 I needed a better solution as v0.1.3 doesn't compile with PHP 7 (something to do with php_smart_str being renamed to php_smart_string).
After a couple hours of frustrating research and compiling libv8 myself, I didn't want to have to go through this whole process on every server I provisioned.
Anyway, I found this site which points you to a launchpad PPA site that provides a couple different ubuntu packages with the 5.1 and 5.2 libv8 libraries.
I ran these commands (please don't add repositories of 3rd party devs without understanding the risks).
sudo apt-add-repository ppa:pinepain/libv8-5.2
sudo apt-get update
sudo apt-get install libv8-5.2-dev
sudo pecl install v8js-1.1.0
(Thanks #JeyKeu for suggesting to add "apt-get update" to these commands)
I couldn't get v8js-1.3.0 or 1.2.0 to build, but 1.1.0 worked well. I checked the changelog and found that the latest updates are not necessary in my circumstance anyway.

Error while installing mongo driver for PHP on amazon linux

I tried to install the mongodb driver for PHP on Amazon Linux.
While running sudo pecl install mongo, I get the error message:
fatal error: openssl/evp.h: No such file or directory
#include <openssl/evp.h>
^
compilation terminated.
make: *** [io_stream.lo] Error 1
ERROR: `make' failed
PEAR Version: 1.9.5
PHP Version: 5.3.29
I installed gcc which helped me progress further with the install till this error.
The best Guide I was able to find was here:
http://jonathanhui.com/install-mongodb-amazon-linux
PHP's guide: http://php.net/manual/en/mongo.installation.php
evp is high-level cryptographic functions.
Try to install development libraries:
Ubuntu:
sudo apt-get install libssl-dev
CentOS:
yum install openssl-devel
The right package to install is not libssl-dev but
sudo apt-get install pkg-config
and now you can execute
sudo pecl install mongodb
Don't forget to add extension=mongodb.so to your php.ini file.
To know which php.ini file is loaded you can create and simple php file on vps
<?php
php_info()
?>
Example directory php.ini in phpinfo()

Categories