On 4/23/2013 7:30 AM, Viviane Ventura wrote: > I'm using solr with tomcat and i need to add a record using > HTTP/Request.php (PEAR). > So, i created a test file with the following code: > > <?php > require_once "HTTP/Request.php";
At a quick glance (and not having much experience with PHP) your code looks like it SHOULD work, but something is obviously wrong. The Solr server's log should have something useful for you, if you are logging at INFO or higher. The exact location of the log will depend on your servlet container. For tomcat, that is generally in the catalina logfile. The log will include the request parameters, but it won't include the body. The error message may give you a clue, though. You would be better off using a PHP programming API specifically made for Solr, rather than using HTTP directly and sending XML. If you are using Solr 4.x, I believe that all of them may have bugs because Solr 4.0 finished removing options that were deprecated a long time ago, and the PHP programming APIs include those options. There are at least three API choices available: http://wiki.apache.org/solr/SolPHP The PECL plugin for Solr has a filed bug, to which I attached a patch. As it says in the bug notes, I probably didn't fix it right, but I have confirmed with a PHP user that it does fix the problem: https://bugs.php.net/bug.php?id=62332 Thanks, Shawn