简体   繁体   English

如何使用pecl在AWS beantalk上安装php-solr-client

[英]how to instal php-solr-client on aws beanstalk with pecl

i have installed a beanstalk server on amazon aws. 我已经在Amazon AWS上安装了beantalk服务器。 i also have a different instance running SOLR server. 我也有运行SOLR服务器的其他实例。

in my php scripts i use this module: http://php.net/manual/en/solrclient.adddocument.php to query the SOLR database. 在我的php脚本中,我使用以下模块: http : //php.net/manual/en/solrclient.adddocument.php查询SOLR数据库。

to install it on beanstalk, i login into its ec2 instance, (ec2-user). 要将其安装在beantalk上,我登录到其ec2实例((ec2-user))。 this module uses pecl 该模块使用pecl

in the ec2 shell: 在ec2 shell中:

sudo pecl install -n solr

once done, pecl will add extension = solr.so to php.ini 完成后,pecl将在php.ini中添加extension = solr.so

from this point, when i run php scripts i recive: 从这一点来看,当我运行php脚本时,我会收到以下内容:

PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/solr.so' - /usr/lib/php/modules/solr.so: undefined symbol: curl_easy_getinfo in Unknown on line 0

i found a very few other posts about this issue, but most gave up or gave incomplete/unclear solutions. 我发现了很少其他有关此问题的帖子,但大多数都放弃或给出了不完整/不清楚的解决方案。

how to install solr php client on aws beanstalk - (this php client - http://php.net/manual/en/solrclient.construct.php ) 如何在AWS豆茎安装Solr的PHP客户端- (这个PHP客户端- http://php.net/manual/en/solrclient.construct.php

  1. assumming you have beanstalk server up and running 假设您已启动并运行beanstalk服务器
    • login into ec2 instance created by beanstalk 登录到beantalk创建的ec2实例
  2. sudo pecl install -n solr -> (add /usr/lib as a location folder when prompt for xmlcurl,libcur while installing via pecl) sudo pecl install -n solr->(在提示输入xmlcurl时将/ usr / lib添加为位置文件夹,通过pecl安装时为libcur)
  3. delete “extension=solr.so” from php.ini -> (found in root/etc) 从php.ini中删除“ extension = solr.so”->(在root / etc中找到)
  4. add file "solr.ini" with one line = (put in root/etc/php.d) 一行添加文件“ solr.ini” =(放入root / etc / php.d)
  5. sudo /etc/init.d/httpd restart -> restart the server sudo /etc/init.d/httpd restart->重新启动服务器
    • make sure solr server ports 8443 : 8983 are open for beanstalk. 确保为beantalk打开了solr服务器端口8443:8983。
  6. profit. 利润。
  7. now that this is running, if you are running this to connect to solr 4.0 server you will notice that it will not work correctly (commit -> waitflush arg was removed in 4.0 but still exists on the client) 现在,它正在运行,如果您正在运行它以连接到solr 4.0服务器,您将注意到它将无法正常工作(commit-> waitflush arg在4.0中已删除,但在客户端上仍然存在)
  8. no profit for me... 我没有利润

Yaron's reply Didnt work for me. Yaron的回复Didnt为我工作。

However the below did. 但是下面做了。

i simply added 我只是添加

extension=curl.so
extension=json.so
extension=solr.so

at the end of php.ini and it worked without any issues. php.ini的末尾,它可以正常工作。

Note: i am using php 5.5.12 注意:我使用的是PHP 5.5.12

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM