I am trying to use solr with php . I have configured my solr application and it's working fine . However I am not able to communicate with solr using php . I have tried a number of extensions : pecl-solr , solr-php-client and Solarium . However none were able to even ping my solr server . All this while my solr server is available at localhost:8080/solr . I am running it on windows with tomcat . (I have checked my tomcat and solr services all the while when pinging through php , they were up and running )
I think I am doing something very basic wrong here . Does my solr application need to be in htdocs in xampp ? Because I have it inside the webapps folder of my tomcat server . I dont really see how it could make a difference since I specifically provided the path to ping in solr-php-client like this :
require_once( 'Apache/Solr/service.php' );
$solr = new Apache_Solr_Service( 'localhost', '8080', '/solr' );
var_dump($solr) ;
if ( ! $solr->ping() ) {
echo 'Solr service not responding.';
exit;
}
I get the 'Solr service not responding' message on running this code . Any suggestions ?
Update : I was looking under the hood and found that for getting the contents , the following php function is used : file_get_contents I further came to know that when the file is located through a URI it may fail as many servers block this command because of security concerns . Is this true for xampp as well ? Running on my local machine that is ?