Installing Solr in a XAMPP server in a LINUX server - php

I try to install Solr PHP extension to my webserver. I already have an XAMPP server and I'm using PECL to install solr
$ cd /opt/lampp/bin
$ sudo ./pecl install solr-1.0.1
But I got the following error:
checking libxml2 install dir... /usr/lib
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
ERROR: `/tmp/pear/temp/solr/configure --enable-solr=yes --enable-solr-debug=no --with-curl=
/usr --with-libxml-dir=/usr/lib' failed
During the installation it prompts me to input a path:
libxml2 install prefix [/usr] :
I have tried with enter and the /usr/lib
What shall I input there to not get an error? Or how shall I install to not get an error?
Now I have libxml2 installed through yum install libxml2-devel. But I got some wierd errors now. Here are just a few of them, it ends with:
no such parameter
/tmp/pear/temp/solr/solr_types.h:388: error: declaration for parameter 'client_count' but no such parameter
/tmp/pear/temp/solr/solr_types.h:386: error: declaration for parameter 'document_count' but no such parameter
/tmp/pear/temp/solr/solr_types.h:384: error: declaration for parameter 'request_count' but no such parameter
/tmp/pear/temp/solr/php_solr.c:1185: error: expected '{' at end of input
make: *** [php_solr.lo] Error 1 ERROR: `make' failed

If you're using RHEL/Fedora/CentOS/Scientific linux then you need to install libxml2-devel
yum install libxml2-devel

I could easily install PECL Solr via my systems package manager, probably this works for you as well. I found it very easy so probably worth to share (Fedora 14):
$ sudo yum install php-pecl-solr
A little later I got php-pecl-solr-0.9.11-1.fc14.x86_64 installed, the package's fedora homepage is here.
I could locate the libxml2 version with this command:
$ locate libxml2.so
probably this is helpful as well.

Some useful links:
http://projects.mediashelf.us/projects/8/wiki/Setting_up_Fedora_and_Solr_for_use_with_ActiveFedora#Install-Solr
http://oxfordrepo.blogspot.com/2008/01/populating-search-engine-apache-solr.html

Related

How To Install PECL YAML Extension on Mac?

My goals is to be able to use the PHP functions for parsing YAML detailed in the PHP docs:
http://php.net/manual/en/ref.yaml.php
To install the PECL yaml extension I've opened Terminal and typed:
brew install libyaml
Then
sudo /usr/local/php5/bin/pecl install pecl_http
Then
sudo /usr/local/php5/bin/pecl install yaml
But I think it fails to install the PECL yaml extension. It says:
3 warnings and 16 errors generated.
make: *** [yaml.lo] Error 1
ERROR: `make' failed
And when I try to use yaml_parse_file() in my program, it says:
Fatal error: Call to undefined function yaml_parse_file()
How do I properly install the PECL yaml extension so I can use the PHP functions for parsing YAML?
I had similar issue and below steps helped me.
First be sure you have installed yaml extension (as I know since brew will not help us for packages so better to use pecl)
Even though some errors (such as failed for mkdir) occurred during installation it was completed.
pecl install yaml
Next open your php.ini file and add this line according to your path to yaml.so file.
extension=/usr/local/Cellar/php70-yaml/2.0.0/yaml.so
Hope it helps..

gnupg for PHP on OSX

I'm trying to set up gnupg for use in PHP on my mac.
I have tried following the directions found at the following links:
http://measure9.varkel.net/2013/10/building-gnupg-for-php-5-5-on-osx/
Install PHP gnupg using PECL on MAC/MAMP 10.8.4
What I seem to be running into with both is this message:
checking for gpgme_check_version in -lgpgme... no
configure: error: wrong gpgme lib version or lib not found
I see this when executing the './configure' command.
I have installed gpgme using Homebrew.
I'm a bit stuck as I've tried everything I can come up with and haven't had any luck.
I am running PHP 5.6.7 on OSX 10.10.2 using MAMP Pro.
Thank you in advance for any help you can provide.
EDIT:
My original question was unclear, so I'll try again.
I am trying to install gnupg for use in PHP in my dev environment, which is a macbook using MAMP.
I fist installed gpgme and gnpug using Homebrew, both with no issues.
Then I attempted to install gnupg using pecl via the following command
sudo pecl install gnupg
And I end up with this error message
configure: error: wrong gpgme lib version or lib not found
ERROR: `/private/tmp/pear/install/gnupg/configure' failed
I have tried editing my path with no success, adding usr/local/include and usr/local/lib, where gpgme.h and libgpgme.a files can be found. I see no change in the error message.
EDIT 2:
I believe that gpgme is being installed correctly and pecl is able to find it. I install it using the following command
brew install gpgme
If I then run the pecl command to install gnupg, I get the error message above.
Now, if I execute the brew command to uninstall gpgme
brew uninstall gpgme
I see the following error message when trying to install gnupg with pecl
configure: error: Please reinstall the gpgme distribution
ERROR: `/private/tmp/pear/temp/gnupg/configure' failed
which seems to indicate that the library is installing and being found, but it's an incorrect version.
I am unable to find any information on what version is required for pecl to install gnupg.
EDIT 3:
Looking at the terminal a little more, I see that it's failing to find a specific function (gpgme_check_version) in the lib file.
checking for gpgme_check_version in -lgpgme... no
configure: error: wrong gpgme lib version or lib not found
ERROR: `/private/tmp/pear/temp/gnupg/configure' failed
I'm not entirely sure what happened, but I believe my installation of autoconf was somehow compromised.
What ended up solving my problem was using brew to uninstall autoconf and gpgme, then using brew to reinstall both packages.

Setting memcached for lampp on linux using pecl

ORIGINAL POST
First of all, I want to install memcached, not memcache.
I'm trying to set up memcached to work with my lampp server on ubuntu 12.10 since yesterday. I've already followed almost every tutorial I could find. The most recent thing, I tried to do was:
in terminal
apt-get install libmemcached-dev
cd /opt/lampp
./bin/pecl install memcached
and then adding extension="memcached.so" in php.ini file. After this I restarted lampp using /opt/lampp/lampp restart
When I tried to open php script in my browser it just got downloaded. Running tail -20 /opt/lampp/logs/php_error_logthis is what I see:
PHP Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/memcached.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/memcached.so: wrong ELF class: ELFCLASS64 in Unknown on line 0
It seems this guy had same problem but with different extension. When I try to compile 32 bit version of the extension using:
phpize
CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 ./configure
make
But make throws the following error:
/usr/bin/ld: skipping incompatible /usr/local/lib/libmemcached.so when searching for -lmemcached
/usr/bin/ld: cannot find -lmemcached
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
make: *** [memcached.la] Error 1
The problem is that I don't even know if I'm on the right path. If someone could write short step-by-step guide how to get this working or just show me where the issue is it would be great.
UPDATE
After executing sudo dpkg --add-architecture i386 sudo apg-get update sudo apt-get install libmemcached-dev:i386 libz-dev:i386 and phpize CFLAGS=-m32 CPPFLAGS=-m32 CCASFLAGS=-m32 ./configure make memcached compiles fine. It still doesn't work however. After checking php error logs again I get this
PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/memcached.so' - /opt/lampp/lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/i386-linux-gnu/libstdc++.so.6) in Unknown on line 0
You are on the right path - your lampp is 32bit while rest of the system (i assume) is 64bit. So when you installed libmemcached an compiled php-libmemcached it is 64bit version. That's why you get the "Wrong ELF class" error.
Before you can compile 32bit version of php-memchached you need to install 32bit versions of libmemcached and libz (and their headers).
You need to:
sudo dpkg --add-architecture i386
sudo apg-get update
sudo apt-get install libmemcached-dev:i386 libz-dev:i386
I think that should be enough to let you compile 32bit version of php-libmemcached.
There is a dirt way to fix your problem
go to /usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.x.x
and copied the libgcc_s.so into
/opt/lampp/lib and renamed it to libgcc_s.so.1 to overwrite the previous file.

Install fileinfo php extension

As the fileinfo is moved from PECL to PHP. What is the best way to install it through WHM or putty.?
I tried following command:
pecl install fileinfo
and received following error:
WARNING: "pear/Fileinfo" is deprecated in favor of "channel://php-src/ext/fileinfo/in php sources
"WARNING: channel "pear.php.net" has updated its protocols, use "pecl channel-update pear.php.net" to update
downloading Fileinfo-1.0.4.tgz ...
Starting to download Fileinfo-1.0.4.tgz (5,835 bytes)
.....done: 5,835 bytes
3 source files, building
running: phpize
Cannot find config.m4.
Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module
ERROR: `phpize' failed
This extension is enabled by default as of PHP 5.3.0. Before this time, fileinfo was a PECL extension but is no longer maintained there. However, versions prior to 5.3+ may use the ยป discontinued PECL extension.
Reference:
http://www.php.net/manual/en/fileinfo.installation.php
ERROR: `phpize' failed
This error is displayed because you don't have php-devel package installed
Are you install php-devel?
phpize execute need's php-devel package. if you are on centos run the following code
yum install php-devel
I encountered this, and needed to install php-fileinfo for WHM on a VPS Dedicated server. This https://www.inmotionhosting.com/support/website/how-to-install-a-php-extension-using-easyapache-4/
was very helpful. I figured id post this for the next guy.
For me this is working
#yum install rh-php70-php-devel
https://centos.pkgs.org/7/centos-sclo-rh/rh-php70-php-devel-7.0.10-2.el7.x86_64.rpm.html

Installing PECL extension error

I downloaded a PECL extension and executed:
$ phpize
$ ./configure
The following command generated dozens of errors:
$ make
I suspect that the first two errors lead to the others:
/Users/afilina/Downloads/APC-3.1.9/apc.h:61:17: error: php.h: No such file or directory
/Users/afilina/Downloads/APC-3.1.9/apc.h:62:30: error: main/php_streams.h: No such file or directory
Here is an example of the dozens of syntax errors:
/Users/afilina/Downloads/APC-3.1.9/apc.h:69: error: syntax error before 'TSRMLS_DC'
Does anyone have pointers as to what might have happened? Installing using the "pecl" command is not an option as my PEAR installation is corrupted.
You need the PHP headers. Depending the Distro, or OS these may be found in a different manner.
In debian you need install "php5-dev":
apt-get install php5-dev
Realy i don't know how install it in Mac.

Categories