General help

Solr php extension installation

 
Picture of Lawrence Elango
Solr php extension installation
 

Hello guys,

   just followed the procedure for installing the solr extension and when i go to the site, it says solr php installation not found.i can see the solr folder under the project directory but i dont know what i did wrong.any ideas

the error is :The Apache Solr PHP extension is not installed. Please check the documentation

i actually followed the documentation at https://docs.moodle.org/dev/Global_search#Installation


Regards

Lawrence

 
Average of ratings: -
Picture of Mark Johnson
Re: Solr php extension installation
Core developersParticularly helpful MoodlersPlugin developers

I haven't tried this myself so someone might be able to give a more useful answer, but quite often the best way to work out why an error like this is appearing is to look at the code of the page that displays the error and work out what conditions trigger it.  Once you know that you should have a clue as to which part of the instructions you've not followed correctly, or are outdated.  If you can't work that out yourself, you posting the information you can work out (such as the file and line numbers where the error is triggered) here will make it easier for people to help.

Once you work it out, you could update the Wiki page with what you had to do to fix the error, so that others who hit the same problem will get the solution more easily!

 
Average of ratings: -
Picture of Eric Merrill
Re: Solr php extension installation
 

I'm not sure what you mean by "I can see the solr folder under the project directory".

You need to setup and configure two things:

  1. Apache Solr (link)
  2. PHP Solr (link)

The particular error you see is about number 2. PHP Solr (or pecl-solr) is a PHP module that you need to install in PHP. When it's installed properly, you will see Solr on the Site Admin>Server>PHP Info page.

 
Average of ratings: Useful (1)
Picture of Lawrence Elango
Re: Solr php extension installation
 

Thanks Mark and Eric

  @Eric i downloaded both the solr and php solr and i couldnt find it on the php info page.There is a directive to enable global search and activate solr as the search engine.Thats where i couldnt do anything because it was not enabled.


Regards

Lawrence

    

 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 
Hi Eric,


I have installed the Solr apache and php extensions as indicated and checked with my host provider I had all the required dependencies installed.

Do you have some commands or some common sense list of things to go through to check, say on a CentOs for the php extensions?

I think I have the Apache Solr server running OK after doing a grep on the processes, but I am not sure about the PHP Solr extensions. I still get the :

Solr

The Apache Solr PHP extension is not installed. Please check the documentation.


And here is the list of libraries enabled on my server:

cURL support => enabled
cURL Information => 7.38.0
Age => 3
Features
AsynchDNS => No
CharConv => No
Debug => No
GSS-Negotiate => No
IDN => Yes
IPv6 => Yes
krb4 => No
Largefile => Yes
libz => Yes
NTLM => Yes   
NTLMWB => Yes 
SPNEGO => No  
SSL => Yes
SSPI => No
TLS-SRP => No 
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, pop3, pop3s, rtsp, smtp, smtps, telnet, tftp
Host => x86_64-unknown-linux-gnu
SSL Version => OpenSSL/1.0.1e
ZLib Version => 1.2.3

json

json support => enabled
json version => 1.2.1

libxml

libXML support => active
libXML Compiled Version => 2.9.2
libXML Loaded Version => 20902
libXML streams => enabled


Any help is appreciated.

Thanks

 
Average of ratings: -
Picture of Fernando Acedo
Re: Solr php extension installation
Particularly helpful MoodlersPlugin developersTesters

You can test if Solr is running using this URL:
http://your_IP:8983/solr

If you already get the error after verify Solr is running, verify you followed all the steps indicated in the moodle documentation.

Take a look also to 3.1QA test: https://tracker.moodle.org/browse/MDLQA-9765



 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 

Hi Fernando,

After setting the debugger on, I got the following error:

Error: enginenotinstallled

line 130 of search/classes/manager.php: core _search\engine_exception thrown

line 57 of /search/index.php call to core_search\manager:instance()


I got the search engine running, but I suspect something is not configured correctly.

http://mysite:8983/solr/

I hope you can help.

Thanks

 
Average of ratings: -
Picture of David Monllaó
Re: Solr php extension installation
Core developersMoodle Course Creator Certificate holdersMoodle HQParticularly helpful MoodlersPlugin developersTesters

Hi Alex,

Moodle configuration is not yet checked at that stage, just if php solr extension is installed and included: https://github.com/moodle/moodle/blob/master/search/engine/solr/classes/engine.php#L1126


 
Average of ratings: -
Picture of David Monllaó
Re: Solr php extension installation
Core developersMoodle Course Creator Certificate holdersMoodle HQParticularly helpful MoodlersPlugin developersTesters

Hi Alex,

You can install PHP solr extension using pecl (pecl install solr in linux) more info in https://docs.moodle.org/31/en/Global_search#How_to_install_Solr

 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 

Hi Dave,

Right. Except these commands from your url are all for apt-get and I am on bash centos 6. Therefore these commands don't work in my env.

I finally got the Solr API to work: http://mysite:8983/solr/

But when I get to Moodle, I get a configuration for Solr error. I believe I need to add the solr.so extension to the php.ini file.

Error: "PHP Startup: Unable to load dynamic library /usr/local/lib/extensions/no-debug...20121212/solr.so"..."so cannot share object file..no such file or directory"

Thanks


 

 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 

Hi David,

The extensions are setup correctly. I have carefully checked the php.ini info page.

Thanks


 
Average of ratings: -
Picture of David Monllaó
Re: Solr php extension installation
Core developersMoodle Course Creator Certificate holdersMoodle HQParticularly helpful MoodlersPlugin developersTesters

Hi Alex,

Solr extension should be enabled both for apache and php CLI, if solr extension appears in phpinfo output and when runngin php -i in a CLI the extension should be properly installed. You still need to check the required php solr extension versions -> https://docs.moodle.org/31/en/Global_search#How_to_install_Solr (changes between php 5 and php 7)

Have you solved PHP Startup: Unable to load dynamic library /usr/local/lib/extensions/no-debug...20121212/solr.so"..."so cannot share object file..no such file or directory" problem?

 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 

Hi Dave,

I am at this point below, but I have centos and I am trying to setup the sudoers since my environment is not set up correctly. Also, the file structure is different since I cannot see this "/etc/php5/cli/conf.d" dir.

Also, I installed Apache solr under the /opt/solr dir.,(but it seems to be running Ok) I don't know if this is causing the PHP startup error in Moodle, but I suspect it's a PATH issue.

Some of the issues I have encountered with the script below are:

1) It assumes one is logged in a a user other than root, and because my environment needs to be setup correctly, I cannot run any of the commands below.

2) One needs apt-get, but actually I got yum to download the products. However, I installed the packages through WHM because my host provider insisted for security reasons.

3) I don't know if I should install solr under the /root/solr dir for moodle. File structure where to install the files is a big question. 

4) Under moodle, I never got the option to setup the hostname and port number and this indicates I might have installed solr in the wrong directory and possibly under root user rather than the moodle user.

sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev sudo apt-get install php5-dev sudo apt-get install php-pear sudo pecl install solr sudo sh -c "echo 'extension=solr.so' > /etc/php5/apache2/conf.d/solr.ini" sudo sh -c "echo 'extension=solr.so' > /etc/php5/cli/conf.d/solr.ini" sudo service apache2 restart


If I could get a very easy to follow centos script would be of great help.

Thanks

 
Average of ratings: -
Picture of Ken Task
Re: Solr php extension installation
Particularly helpful Moodlers

Pardon intrusion into Developer Space ... am not a developer, just a community user who has been looking into Google Apps Engines using CentOS 7 and Moodle.

So before anyone could provide CentOS scripts - or references - need to know what version of CentOS your current provider offers.

What does: cat /etc/redhad-release show?

If it shows a version 6 there's one set of instructions.   If it shows a version 7 there's another set of instructions + major differences when it comes to AMP stack.   Not that I can provide them ... but might be able to point you in the right direction at least.

'spirit of sharing', Ken


 
Average of ratings: -
Picture of Ken Task
Re: Solr php extension installation
Particularly helpful Moodlers

** CORRECTION ** - sorry, fat fingered the following in previous post:

What does: cat /etc/redhad-release show?

Should read:

cat /etc/redhat-release

'spirit of sharing', Ken

 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 

Hi Ken,

It's CentOS release 6.8 (Final)

Thanks

 
Average of ratings: -
Picture of Ken Task
Re: Solr php extension installation
Particularly helpful Moodlers

Interesting ...

"installed the packages through WHM because my host provider insisted for security reasons"

Sounds like you might need to move to Google or Amazon to get a developers instance of the OS you need to continue.  One where you are in charge of whatever is installed and not at the mercy of provider.   Not that Google/Amazon are like the 'wild west' ... they do watch what customers do and won't allow your instance to 'do harm' to others.

Afraid a nice neat list isn't possible just yet ... unfortunately more questions:

First a tip on sudo:

So that you don't have to type sudo all the time, try sudo -s
and see if that keeps you as root user.
If it does, one will have to type exit twice to logout ... once to get out of
sudo session and once more to logout of the system.

In order to get some of the pecl packages one needs PHP 7.

php -v will tell us what you have.

IF

pecl upgrade

If above responds with:

pear.php.net is using a unsupported protocol - This should never happen.
pecl/apcu requires PHP (version >= 7.0.0-dev), installed version is [somelowerversionofphp]
No valid packages found
upgrade failed

Also with CentOS might have to seek 3rd party repo's for some/all of what you seek.

See: https://webtatic.com/packages/php70/

Make sure you use the commands shown in the

CentOS/RHEL 6.x:

section.

https://www.google.com/search?q=installing+solr+on+CentOS+6&ie=utf-8&oe=utf-8

That's a start ...

'spirit of sharing', Ken


 
Average of ratings: -
Picture of Ken Task
Re: Solr php extension installation
Particularly helpful Moodlers

OK, have been working on this for a couple of days now and have been successful with installing apache-solr search in a fresh moodle 3.1 on CentOS 6.

Here's what I did from notes ... might be brain dead so ....

CentOS release 6.8 (Final)

Linux site 2.6.32-642.1.1.el6.x86_64 #1 SMP Tue May 31 21:57:07 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

As root user:

PHP-SOLR
========
cd /root
git clone https://github.com/ecaron/php-pecl-solr.git
cd php-pecl-solr
phpize
./configure
make
make install

(compiling requires gcc and related libraries)

ls /usr/lib64/php/modules/
should see a solr.so file in the above directory

nano /etc/php.d/solr.ini
add to the above file: extension=solr.so

/sbin/service httpd restart
php -m
should show solr in the listing of php extensions
php -m |grep solr
should respond with solr

APACHE SOLR - CentOS 6
======================

This one is tricky ... and does require JRE at least version 1.8
Oracle pulled the 1.7 offline just the other day.

As root user: java -version
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

I had to download the 1.8 to laptop and then scp it back up to server in /opt/
(just to keep things in the same place)
http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz

in /opt as root where jdk-8u91-linux-x64.tar.gz resides

tar xvf jdk-8u91-linux-x64.tar.gz
then used alternatives to install

/usr/sbin/alternatives --install /usr/bin/java java /opt/jdk1.8.0_91/bin/java 2

You'll get a screen asking which number to setup.

Check version: java -version as above.

Apache SOLR does require a user: solr

/usr/sbin/useradd solr

cd /opt/
wget http://www.us.apache.org/dist/lucene/solr/6.0.1/solr-6.0.1.tgz
tar zxvf solr-6.0.1.tgz
cd solr-6.0.1 solr
bin/install_solr_service.sh /opt/solr-6.0.1.tgz -f
bin/solr create -c moodle
chown solr:solr * -R

****DO NOT remove /opt/solr-6.0.1 solr directory.

Had to open access to port 8983 in iptables and did have to restart the server.

Check to see if there is a solr file in /etc/init.d/

Should have been created upon install.

ps aux |grep java
should show solr running.

You can start/stop with /sbin/service solr stop/start

In Moodle config for solr
Host: localhost
Port: 8983
Index: moodle

Played with it just a bit ... had a hidden System Admins category with a hidden SA course and only one URL in it .... URL to run cron.   After indexing, global search did find it.   Looks like I'm gonna have to use HTML blocks for such links in hidden courses for admin purposes.   HTML blocks are not indexed by global search.

Hadn't had enough time to check with a true course and a true student account yet to see if it finds too much.   Also wonder how it will behave with links to google drive/docs.   Sometimes like to attempt to obscure them (although any user with a little savy could find them).

Am hoping that development of this continues and a little more control given admin user to restrict  what it finds for teachers/students.

One thing for sure ... Moodle 3.1 on shared hosting is probably all but gone ... at least full featured 3.1 ... given the requirements to some of the new features ... global search with apache solr JRE and unoconv - that one appears to require the install of full office suite (LibreOffice/Aapches OpenOffice) to get the conversion ability.   2 cent opinion of course.

Anyway ... try the above out.

Bout brain dead and am going to veg on couch now! :|

'spirit of sharing', Ken

 
Average of ratings: Useful (2)
Alex Briones
Re: Solr php extension installation
 
Ken, you are amazing. Will try your method. 

Will let you know the outcome. Thank you so much.

 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 
Ken, you are amazing. Will try your method. 

Will let you know the outcome. Thank you so much.

 
Average of ratings: -
Picture of David Monllaó
Re: Solr php extension installation
Core developersMoodle Course Creator Certificate holdersMoodle HQParticularly helpful MoodlersPlugin developersTesters

Hi Ken,

About Moodle 3.1 in shared hosting:

 
Average of ratings: -
Picture of Ken Task
Re: Solr php extension installation
Particularly helpful Moodlers

Thanks for reply, David.

As far as hosting is concerned ... it's shared hosting (multiple customers on one IP address) that I think would have issues with LibreOffice on such systems.   Thus, any feature of Moodle using unoconv won't be possible.

Even Amazon packages don't have LibreOffice available from Amazon repos - they don' t plan to supply it either.   I found, at one time, a Google Apps engine offering  just for document conversions but for the typical single user running Moodle 3.1 even on VPS might run into issues (one of them being space) with LibreOffice if not installing only the parts needed.   Finding a saas implementation is like a needle in a haystack right now ... me thinks. (who knows ... a small saas industry might popup! :\)

https://github.com/dagwieers/unoconv

has technical info and a good read for understanding rquirements.  unoconv is really a python script.

** WELL WORTH a read if attempting to use unoconv.   unoconv uses LibreOffices ability to be run in a headless mode ... ie, GUI desktop not needed.

So I set out seeking minimal install on server ... trying not to think saas.

From Dag's git page:

"if this is the first time you are using LibreOffice/OpenOffice, make sure you have all the required sub-packages installed, depending on the distribution this could be the xsltfilter, headless, writer, calc, impress or draw sub-packages."

So for *CentOS 6* (anyone else reading this make note of that fact), I went after minimal:

libreoffice-xsltfilter.x86_64
libreoffice-headless.x86_64
libreoffice-impress.x86_64
libreoffice-calc.x86_64
libreoffice-impress.x86_64
libreoffice-langpack-en.x86_64
libreoffice-writer.x86_64
libreoffice-draw.x86_64
libreoffice-ure.x86_64
libreoffice-testtools.x86_64
libreoffice-filters.x86_64

Had to install a yum tools ... to get downloadonly

So I could get just the packages I think would be minimal (as well as their dependencies).

yum install --downloadonly --downloaddir=<directory> <package>

The directory size of all packages + dependencies totaled 109M (those are rpms and not yet installed)
Install size, however, is larger: Installed size: 364 M

Installing for dependencies:
 autocorr-en
 dejavu-sans-mono-fonts
 dejavu-serif-fonts
 google-crosextra-caladea-fonts
 google-crosextra-carlito-fonts
 hyphen
 hyphen-en
 liberation-fonts-common
 liberation-mono-fonts
 liberation-sans-fonts
 liberation-serif-fonts
 libreoffice-core
 libreoffice-opensymbol-fonts
 libreoffice-ure
 neon
 pakchois

Years ago, I had installed LibreOffice (full) when I had read up on headless mode and decided to give document conversion a try and one point in time ran into a space crunch on server (no options to add a drive or space - not a virtualized environment).   Regained desparately need space by removing the languages not needed but did break LibreOffice ... at least the GUI interface.

Anyway ... that's where I'm at with this sandbox Moodle 3.1 right now.

Anyone have a small no user course that might use unoconv for me to try out?

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Ken Task
Re: Solr php extension installation
Particularly helpful Moodlers

Well, this is crazy ... but results are good.

Yesterday (finally reaching the stage of brain dead on getting unoconv and global search setup on a CentOS 6 box), did the test unoconv path and it did download a
PDF that contained 0 bytes.   Today, I return to:
Activity Mods -> Assignment -> Feedback Plugins -> Annotate PDF and I try checking the paths for ghostscript (works) and then the button for Path to unoconv
document converter and this time, the path checks out, and pleasantly surprised to find the download PDF test button works.  See a Lorem ipsum dolor pdf file.  And at the bottom this:
This document is just a test. It should not be used except in the current testing environment.

Great!  It works.   Still don't know if installing minimal LbreOffice was a factor or not.

'spirit of sharing', Ken


 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 

Hi Ken,

I am stuck here, I cannot find these directories: /php/modules

ls  /usr/lib64/php/modules/

++++++++++++++++++++++++++++++++++++++++

Steps:

1) > cat /etc/redhat-version

> CentOS 6.8 (Final)


2) >uname -a

Linux n5601.nephoscale.net 2.6.32-642.1.1.el6.centos.plus.x86_64 #1 SMP Wed Jun 1 03:11:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux


3) First, make sure you have Git

> git --version


If not installed, do this at /root

> sudo yum install git

> git --version


4) > git clone https://github.com/ecaron/php-pecl-solr.git

You will get...

Initialized empty Git repository in /root/php-pecl-solr/.git/

remote: Counting objects: 163, done.

Receiving objects: 100% (163/163), 144.10 KiB, done.

remote: Total 163 (delta 0), reused 0 (delta 0), pack-reused 163

Resolving deltas: 100% (70/70), done.


4) Follow this instructions next (reference: http://php.net/manual/en/install.pecl.phpize.php)

> cd php-pecl-solr

> phpize

> ./configure

> make

> make install

Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20121212/


5) cd /usr/lib64/php/modules/


I cannot find these directories: /php/modules/


> which php

PHP 5.5.35 (cli) (built: May 11 2016 21:06:48)

Copyright (c) 1997-2015 The PHP Group

Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

    with the ionCube PHP Loader v4.7.5, Copyright (c) 2002-2014, by ionCube Ltd.


 
Average of ratings: -
Picture of Ken Task
Re: Solr php extension installation
Particularly helpful Moodlers

That's /usr/lib64/php/modules/
*NOT* /php/modles/

Gotta be there!!!!

It's where all the .so's are located ... your php info wouldn't display any 'sharable objects' if that directory wasn't there .... including solr.so (bolded below)

[root@visdmoodle modules]# pwd
/usr/lib64/php/modules
[root@visdmoodle modules]# ls
apc.so       exif.so      imap.so       mysqli.so        pdo_sqlite.so  soap.so       xdebug.so
apcu.so      fileinfo.so  interbase.so  mysql.so         pgsql.so       sockets.so    xmlreader.so
bcmath.so    ftp.so       intl.so       odbc.so          phar.so        solr.so       xmlrpc.so
bz2.so       gd.so        json.so       opcache.so       posix.so       sqlite3.so    xml.so
calendar.so  gearman.so   ldap.so       pdo_dblib.so     pspell.so      sysvmsg.so    xmlwriter.so
ctype.so     geoip.so     mbstring.so   pdo_firebird.so  recode.so      sysvsem.so    xsl.so
curl.so      gettext.so   mcrypt.so     pdo_mysql.so     redis.so       sysvshm.so    zip.so
dba.so       gmp.so       memcached.so  pdo_odbc.so      shmop.so       tidy.so
dom.so       iconv.so     memcache.so   pdo_pgsql.so     simplexml.so   tokenizer.so
enchant.so   igbinary.so  mssql.so      pdo.so           snmp.so        wddx.so

Apache Solr isn't a 'common' php extension.
It's really a pecl extension.

So what do get with: pecl list
such as below:

pecl list
Installed packages, channel pecl.php.net:
=========================================
Package   Version State
apcu      4.0.11  stable
gearman   1.1.2   stable
geoip     1.0.8   stable
memcache  3.0.8   beta
memcached 2.2.0   stable
redis     2.2.7   stable
solr      2.4.0   stable
xdebug    2.4.0   stable

If above shows nothing one needs to install php-pear from the repo where you acquired your PHP - on CentOS 6 one has to use 3rd party repo (NOT the one for centos6 base as that provides only php 5.3.x)

Dunno what repo you use for your PHP ... I use Webtatic for php

yum repolist
Loaded plugins: security
repo id                                         repo name                                                                status
base                                            CentOS-6 - Base                                                          6,696
extras                                          CentOS-6 - Extras                                                           60
updates                                         CentOS-6 - Updates                                                         115
webtatic                                        Webtatic Repository EL6 - x86_64                                           322

Webtatic has php 5.5 and 5.6

'spirit of sharing', Ken





 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 

Ok,I see the problem, I get this upon the pecl list

Installed packages, channel pecl.php.net:

=========================================

Package Version  State

imagick 3.4.3RC1 stable

solr    2.4.0    stable


I will get the rest installed.

Thanks


 
Average of ratings: -
Picture of Ken Task
Re: Solr php extension installation
Particularly helpful Moodlers

The pecl llist command I shared was from my server.   Didn't mean to suggest that you needed what mine showed to get solr to work.   Actually, your output does show solr listed so the issue of NOT have the extension installed appears to be resolved.

Not everyone's CentOS 6 box is setup exactly the same.

So when you say "I see the problem' ... mind sharing what the problem is? ;)

What do the following commands show:

php -v

php -m

yum --enablerepo=* repolist

Don't have to provide a full listing here ... maybe a clip if you think there's something wrong - an example of that.

The last command enables all repos that might be turned off until enabled and then provides a listing of all the repos your system could use.   The command will 're-index' (for lack of a better term) everything your system knows about what software is available from every repo your system could use.

The 6.8 system I am using has extra repos: remi, epel, webtatic EL6, as well as rpmforge.

Reason ... at one time or another had need to acquire some software not provided by the default repos for CentOS 6.  In some cases the software I was going after was provided only by epel or remi.   Webtactic (EL6) was added when the server moved towards higher versions of Moodle that required higher versions of PHP and MySQL.

'spirit of sharing', Ken



 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 

Hi Ken,

Here is the reason why I was not able to see the specific file structure before:

Our CentOS 6.9 installation, cPanel/WHM installs the PHP stack under /usr/local, for example PHP modules are under /usr/local/lib/php/extensions 

Furthermore, cPanel/WHM uses the EasyApache system to build and install Apache and PHP, it does NOT use the 'yum' package manager.

Therefore, I have been warned by our host provider not to install anything php and anything httpd/apache in it's name with 'yum' because it will likely break the server configuration.

So, I am conflicted to continue this installation in my production server environment and instead will apropriate a test server where I can do the moodle and solr install and configuration. Better safe than sorry, and I will have more freedom to get 3rd party software if needed.

Thanks for all your help.


 
Average of ratings: -
Picture of Ken Task
Re: Solr php extension installation
Particularly helpful Moodlers

That makes perfect sense ... thanks for responding.

It should also be a warning to those who have their Moodles remotely hosted be it on shared hosting and/or a VPS as provided by the hosting company, moving to Moodle 3.1 for features like global search and maybe even document conversions (unoconv) will be outside the scope of the packages/services provided by the hosting company.

Only type of hosting that will work is dedicated where customer has access to command line and can use 3rd party software repositories for additional software.  

Have been talking with a sales type at a well known hosting provider and through questioning have 'stumped' the contact to the extent he said he'd have to get back to me - long process and one has to get a sales type to actually listen to the technical questions and respond appropriately giving answers to address those technical questions.    Web site descriptions are not always 100% accurate with the information they provide ... such as 'unlimited hosting'. :\

Anyway, yes, think it VERY wise to move to a dedicated server where you have total and complete control.    It does, however, mean, either some new learning or additional work that is continuous and on-going (no such thing as install it once and forget it ... nor following a philosophy of 'if it's working, don't fix it'.

For others that might have been following ... I can confirm that Apache Solr *can* be installed on CentOS 6 and that it will require command line with additional/non-traditional software not normally installed on a 'typical' LAMP system.

I can also confirm beyond a doubt that if the system is CentOS 5 not possible ... well, it is, but one would have to compile software and no one wants to do that anymore (hint: I don't either!).  Probably a very appropriate time for those running on CentOS 5 to begin to contemplate migration of that version of OS to 6 or 7 as CentOS 5's EOL (end of life) is coming up in March of this year - about the 'traditional' time of Spring Break in NA.

'spirit of sharing', Ken


 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 

Hi Ken,

I am back on the Solr install issue following as closely as possible some of your suggestions. I have been able to resolve most issue with the new install, but no cigar yet. Would you mind taking a look at my install? I think this would be easier than relaying info back and forth. It's a test install so I don't mind. Please let me know if this is possible. Thanks


 
Average of ratings: -
Picture of Ken Task
Re: Solr php extension installation
Particularly helpful Moodlers

Wouldn't mind if Linux ... don't do Windows anymore.  If Linux is what you run, then how do you propose I 'look at it'?  (TeamViewer/other?)   PM might be needed at this point. ;)

'spirit of sharing', Ken

 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 

Thanks Ken,

Yes, it's is Linux, Centos 6.8

Teamviewer is perfect. I am in pacific time usa. When do you have some time? 

You can send email here if you prefer: alex.lamp.master@gmail.com and I can provide all credentials for you to check at will.

Much appreciated.

 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 

Well, I guess I got lucky.

I was able to rename the solr core through the API. I mean the one we create after we install Solr, called gettingstarted

And I renamed it Moodle, then I got the following error in Moodle:

Error validating Solr schema: field itemid does not exist. Please follow this link to set up the required fields.

Upon clicking the above link, I got the correct "set up search engine configuration." (referenced here: https://moodle.org/mod/forum/discuss.php?d=333964)

Then I ran the Index from Moodle, and did a complete index of the site.

The search engine seems to be configured correctly now.




 
Average of ratings: -
Picture of Ken Task
Re: Solr php extension installation
Particularly helpful Moodlers

Great!  Congrats!

Somewhere in notes ... think it was the readme in solr ... there is the same shell command to run to create an index by name.   Did similar command and it created an index named for the same as default (recommended?) seen in the config screen ... ie, 'moodle' (duh!).    But .... this does mean there needs to be an index per Moodle site IF hosting multiple Moodle 3.1's with search.  Obviously don't want one Moodle instance indexing things from another Moodle instance.

'spirit of sharing', Ken

 
Average of ratings: -
Picture of Phuong Hoang
Re: Solr php extension installation
Particularly helpful Moodlers

Hi all,

I love this new feature of moodle and read many posts and moodledocs but I can't imagine how to install Global search. Which files do I have to download? And which folders do I have to upload them to? Honestly speaking, I'm a newbie and quite confused.

Anybody kind enough to instruct me step by step?

Kind regards,


 
Average of ratings: -
Picture of David Monllaó
Re: Solr php extension installation
Core developersMoodle Course Creator Certificate holdersMoodle HQParticularly helpful MoodlersPlugin developersTesters

Hi Phuong,

Global search is part of Moodle 3.1 codebase, you will also need a solr server which is the only search engine supported in Moodle 3.1. Everything is explained step by step in https://docs.moodle.org/31/en/Global_search

 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 

Over the past two weeks, I have done 3 Solr installs - all with the same outcome, "the Apache Sold php extensions are not installed" ...on Moodle

The Apache solr http://IPsite:8983/Solr is working OK and I can ping it.

The problem is the Moodle configuration:

1) One thing is pretty strange, the page where I am supossed to config the "connection settings" for Solr does not display the fields to enter local host and port #. It just defaults to Solr as a search engine. This page:

http://ve.company_name.org/moodle31/admin/settings.php?section=searchsolr


2) When setting the debuggin on, I get these errors:

Global Search Info

Solr is not installed


Debug info: 
Error code: enginenotinstalled
×Stack trace:
  • line 130 of /search/classes/manager.php: core_search\engine_exception thrown
  • line 43 of /report/search/index.php: call to core_search\manager::instance()

I am attaching the PHP info page. It shoudl give you everything to tell me what's wrong with the setup.

PS: I installed the Apache Solr under /opt/Solr-6.0.1

and I followed this youtube video that seems pretty good for CentOS-->  

Out project is delayed until I can resolve this.

Thanks for all your help

Alex

 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 

Apparently, I attached the wrong php info page in my previous posting. Please see this one. Thanks Alex

 
Picture of David Monllaó
Re: Solr php extension installation
Core developersMoodle Course Creator Certificate holdersMoodle HQParticularly helpful MoodlersPlugin developersTesters

Hi Alex,

As explained above, this error is about php solr extension, not about the solr server which is properly installed for what you say. It is installed like any other PECL extension, no special steps required.

If you look at the phpinfo output, there are no references to solr so it is normal that it is not working and moodle is reporting you the correct error.

You can check (in this order):

  1. Pecl is installed in your system and when you type pecl list in a CLI, you can see solr there, if you don't, install it with pecl install solr
  2. Enable the php solr extension for php CLI and apache (or the web server you are using)
  3. After all this is done you will see solr in the phpinfo output you pasted, remember to enable the extension for both CLI and the web server.

It is explained in https://docs.moodle.org/31/en/Global_search#How_to_install_Solr

 
Average of ratings: -
Picture of Murilo Timo Neto
Re: Solr php extension installation
 

Hello guys
I have the php solr extension installed correctly

in php ini i have

solr

Solr Supportenabled
Version 2.4.0
Last Build Date Dec 28 2016
Last Build Time

17:34:44

 

/srv/www/moodle# pecl list
Installed packages, channel pecl.php.net:
=========================================
Package   Version State
memcached 2.2.0   stable
solr      2.4.0   stable

The solr server is also running on another server.
Without any authentication

After creating the new core on the server
When I execute the command

php search / cli / indexer.php --force

I get the following error:

Error creating Solr schema: Field "itemid" already exists in Solr schema. You probably forgot to run this script before indexing data and fields were autocreated by Solr. Please delete the current index, create a new one and run setup_schema.php again before indexing data in Solr.

I've tried deleting and recreating the core several times and nothing works,

Can you point me some light?

 

 
Average of ratings: -
Picture of Murilo Timo Neto
Re: Solr php extension installation
 

For those who are experiencing this type of problem.

After several installation attempts, I discovered the problem.

For internet access we use proxy, and this was configured in moodle.

But did not have the default port setting for the solr on the proxy server.

I disabled the proxy and all right: D

 
Average of ratings: -
Picture of Luis Manuel Morales
Re: Solr php extension installation
 

Hello,


Tips to enable PHP solr on linux ubuntu (Tested on Ubuntu Server 16.04 TLS, Apache 2.x, PHP 7.0.X):


1) Install this packages:

#> apt-get install php7.0-dev

#> apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev


2) Install solr extention from pecl:

#> pecl install solr

if well done you can see solr.so on:  

/usr/lib/php/20151012/solr.so


3)  If pecl's installation success create your solr.ini  file on /etc/php/7.0/mods-available  

------------ begin solr.ini-----------------------------------------

; configuration for php common module

extension=solr.so

------------ end solr.ini-----------------------------------------


4) Enable solr from phpenmod :

#>  phpenmod solr


5) restart your apache server:

#> service apache2 restart


6) Verify solr from your phpinfo page




 
Average of ratings: -
Picture of Steve Pollock
Re: Solr php extension installation
 

Kind of in the same boat, using PHP5, and SOLR will not install following the documentation here.  the root cause is a space issue on /tmp.

sudo pecl install solr

downloading solr-2.4.0.tgz ...

Starting to download solr-2.4.0.tgz (256,316 bytes)

.....................................................done: 256,316 bytes

ERROR: unable to unpack /tmp/pear/download/solr-2.4.0.tgz

So if anyone knows of a workaround/manual install please let me know.

-----

But put that aside for a moment, the conversation has prompted a question:  Could I run a SOLR server or (another) search engine separately and index Moodle and as well as other content and present it back in the moodle search webUI? 

 
Average of ratings: -
Picture of David Monllaó
Re: Solr php extension installation
Core developersMoodle Course Creator Certificate holdersMoodle HQParticularly helpful MoodlersPlugin developersTesters

Hi Steve,

Isn't the problem fixed if you add more disk space? You could get more info about the error with verbose config setting to 3.

Re your question; you can index new contents through the search API https://docs.moodle.org/dev/Search_API. Not sure if this is what you are asking. Are the contents you want to index in moodle's database?

 
Average of ratings: -
Alex Briones
Re: Solr php extension installation
 

After much ado and despite a tremendous effort by moodle responders, I was able to install Solr, but with some caveats. It is a very difficult product to install, maintain and understand.

In the end, I went back to Google Customized search which is a lot easier to install and deal with. Not perfect, but less time consuming. All the best.

 
Average of ratings: -
Picture of Marcus Green
Re: Solr php extension installation
Core developersParticularly helpful MoodlersPlugin developersTesters

I recently installed it for the first time and the process went smoothly and was complete in under two hours.  I was using Ubuntu on my own test server so I had total control of the system. 

Once it was configured I was impressed what it offered in terms of configurable search. 

 
Average of ratings: -
Picture of sai prasad
Re: Solr php extension installation
 

Hi i have followed all the instructions but still couldnt install php solr on my windows server 2012.


i have installed APACHE solr and started through command prompt and it started at port 8983 on my localhost. but Not sure how to integrate with my moodle. 


For PHPsolr  are there any specific instructions to install except to drag the specific compiled dll to the ext folder or something else. I have checked the PHP info page and could not see the solr enabled. please let me know I'm stuck here. 


Please consider as mine is a WINDOWS server 2012 IIS7

 
Average of ratings: -
Picture of sai prasad
Re: Solr php extension installation
 

when i looked at the php error log it says


PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\v5.6\ext\php_Solr.dll' - %1 is not a valid Win32 application.


when i tried to install from php_solr-2.4.0-5.6-ts-vc11-x86 


PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\v5.6\ext\php_solr.dll' - The specified module could not be found.

 
Average of ratings: -