Skip to content

Commit e985b11

Browse files
committed
[HACK] Install solr extension from source
Resolves solr issue in moodlehq#16, waiting for the upstream as described in moodlehq#19
1 parent aaf7d05 commit e985b11

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

root/tmp/setup/php-extensions.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/
3535
docker-php-ext-install -j$(nproc) ldap
3636

3737
pecl install memcached redis apcu igbinary
38-
docker-php-ext-enable memcached redis apcu igbinary
38+
/tmp/setup/solr-extension.sh
39+
docker-php-ext-enable solr memcached redis apcu igbinary
3940

4041
echo 'apc.enable_cli = On' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini
4142

root/tmp/setup/solr-extension.sh

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# HACK Install solr directly from git since the latest source tarball from PECL, 2.4.0, is outdated (2016-03-30).
6+
# Ref: https://bugs.php.net/bug.php?id=75631
7+
# At the time of writing this script the latest commit in the source, https://github.com/php/pecl-search_engine-solr/,
8+
# is de1d724299780d927cb9ed14268449ac8a28204b, dated 2017-09-07.
9+
hash=de1d724299780d927cb9ed14268449ac8a28204b
10+
11+
# Download our 'tagged' source code from git.
12+
echo "Downloading solr extension source archive (${hash})"
13+
curl --location \
14+
https://github.com/php/pecl-search_engine-solr/archive/${hash}.tar.gz \
15+
-o /tmp/pecl-search_engine-solr-${hash}.tar.gz
16+
# Extract the compressed archive.
17+
cd /tmp
18+
tar -xvzf pecl-search_engine-solr-${hash}.tar.gz
19+
cd pecl-search_engine-solr-${hash}
20+
21+
# Compile the extension as required by a manual PECL installation.
22+
echo "Compile solr extension"
23+
phpize
24+
./configure
25+
make
26+
# Finally, install it.
27+
echo "Install solr extension"
28+
make install
29+
30+
# Remove all the sources.
31+
echo "Cleanup temporary folder and files"
32+
rm /tmp/pecl-search_engine-solr-${hash} -rf
33+
rm /tmp/pecl-search_engine-solr-${hash}.tar.gz -f
34+
35+
# Done with this hack.
36+
# Please, follow https://github.com/moodlehq/moodle-php-apache/issues/19.

0 commit comments

Comments
 (0)