1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
|
================================================================================
PHP VERSION Dependencies
================================================================================
PHP version 7.0 or later is needed
================================================================================
Extension Dependencies
================================================================================
LIBXML extension
JSON extension
================================================================================
Library Dependencies
================================================================================
libxml2 2.6.26 or later is required
libcurl 7.15.5 or later is required
================================================================================
On Linux/UNIX
================================================================================
As mentioned before, the libxml and curl extensions must be enabled for the Apache Solr extension to be functional.
Do not attempt to hack the code to make it compile. It will fail, possibly with errors that could be hard to debug
To install the Apache Solr extension directly from PECL, please enter the following command, then follow the prompts
pecl install solr
4A. To compile from source, please follow the following steps
$ phpize
$ ./configure
$ make && make install
This should compile the code and install it in the extension_dir specified in the ini file.
Then open your php.ini file and add the following line to it
extension=solr.so
Then restart your webserver. For CLI only, you do not have to restart your webserver.
4B. If your system does not have the minimum version of the libcurl or libxml libraries, you can download the libraries
and compile them from source into a separate install prefix.
wget http://curl.haxx.se/download/curl-7.19.6.tar.gz
tar -zxvf curl-7.19.6.tar.gz
cd curl-7.19.6
configure --prefix=/root/custom/software
make && make install
cd ..
wget ftp://xmlsoft.org/libxml2/libxml2-2.7.6.tar.gz
tar -zxvf libxml2-2.7.6.tar.gz
cd libxml2-2.7.6
configure --prefix=/root/custom/software
make && make install
This example assumes that the libxml2 and libcurl libraries were compiled from source
and installed using "/root/custom/software" as the --prefix
So the absolute path to the easy.h header file will be
/root/custom/software/include/curl/easy.h
And the absolute path to the libxml/parser.h header file wil be
/root/custom/software/include/libxml2/libxml/parser.h
The absolute path to the xml2-config script will be /root/custom/software/bin/xml2-config
And the absolute path to the curl-config script will be /root/custom/software/bin/curl-config
Then you can pass libcurl prefix to the configure script for CURL and LIBXML respectively
during the configuration phase as shown here :
export PKG_CONFIG_PATH=/root/custom/software/lib/pkgconfig
./configure --enable-solr
If you already have the latest versions of the libraries then the step listed in 4A alone is sufficient.
5. make && make install
This should compile the code and install it in the extension_dir specified in the ini file.
Then open your php.ini file and add the following line to it
extension=solr.so
If you would prefer to compile the Solr extension statically into php,
you will need to follow the following steps.
1. copy the solr_xxx folder into the ext folder in the php source
2. Include the --enable-solr flag as one of the options when configuring php
This will build the Solr extension statically into php.
After the installation is completed, you will have to restart your webserver for the changes to take effect.
For CLI only use, you do not have to restart your webserver.
================================================================================
On Windows
================================================================================
If you are using a pre-compiled dll, simply copy the php_solr.dll file
to your extension_dir specified in the ini file.
Then open your php.ini file and add the following line to it
extension=php_solr.dll
Then restart your webserver. For CLI only, you do not have to restart your webserver.
If you are building from source, you will need to download the library dependencies
for libxml and libcurl from the following link to the deps folder before
running buildconf.bat
http://wiki.php.net/internals/windows/libs
http://pecl2.php.net/downloads/php-windows-builds/php-libs/
More details are avialable here
http://wiki.php.net/internals/windows
Windows DLLs are now available here
http://downloads.php.net/pierre/
If you are building from source, you will need to download the library dependencies
for libxml and libcurl from the following link to the deps folder before
running buildconf.bat
The Apache Solr extension can be compiled statically or shared.
- Shared compilation creates a php_solr.dll file.
- Static compilation puts the Solr extension directly into PHP (therefore it does not need to be loaded and cannot be unloaded).
You can toggle between compiling statically or as library by adding =static or =shared to the configure.js command during the compilation.
configure --with-solr=static
configure --with-solr=shared
- In the first configure command, the Apache Solr extension will be included in PHP
- In the second configure command, the Apache Solr extension will be compiled as separate DLL
Here is a more detail list of steps to follow :
1. Get visual studio 2008 ((express edition or professional) and install it.
2. Get and install windows sdk 6.1.
3. Get a php 5.3 snapshot (do not extract yet!).
4. Create the folder "c:\php-sdk"
5. Unpack the binary tools archive into this directory, there should be one sub-directory called "bin" and one called "script"
6. Open the "windows sdk 6.1 shell" (which is available from the start menu group) and execute the following commands in it:
setenv /x86 /xp /release
cd c:\php-sdk\
bin\phpsdk_setvars.bat
bin\phpsdk_buildtree.bat php53dev
7. Now extract the snapshot from Step 3 to C:\php-sdk\php53dev\vc9\x86 with your favourite unpacker so that the following directory gets created:
C:\php-sdk\php53dev\vc9\x86\php5.3-xyz
8. run in the windows-sdk-shell:
cd C:\php-sdk\php53dev\vc9\x86\php5.3-xyz
buildconf
9. now run configure --help, to get an overview of the compiling flags
10. configure --disable-all --enable-cli --with-solr=yes --with-curl=yes --with-libxml=yes
11. nmake
If you are using Visual Studio 2005, use vc8 wherever you see vc9.
If you are on a 64-bit system, use x64 instead of x86.
The following resources can provide you with more information :
http://wiki.php.net/internals/windows/libs
http://pecl2.php.net/downloads/php-windows-builds/php-libs/
More details are avialable here :
http://wiki.php.net/internals/windows
The binary tools archive is available at :
http://pecl2.php.net/downloads/php-windows-builds/php-libs/binary-tools.zip
Windows SDK 6.1 is available at :
http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC&displaylang=en
The PHP 5.3 shapshot is available at:
http://windows.php.net/downloads/snaps/php-5.3/php-5.3-src-latest.zip
================================================================================
How to Report Bugs
================================================================================
Please report bugs to omars@php.net
You can also register bugs here
http://pecl.php.net/bugs/report.php?package=solr
Thank you for using PHP
|