# Elastic+PHP SDK issue - script not working when served by apache but works fine in cmd line (ubuntu on EC2 instance)

**URL:** <https://discuss.elastic.co/t/elastic-php-sdk-issue-script-not-working-when-served-by-apache-but-works-fine-in-cmd-line-ubuntu-on-ec2-instance/18356>\
**Category:** Elasticsearch\
**Created:** [June 26, 2014, 5:16pm UTC](https://discuss.elastic.co/t/elastic-php-sdk-issue-script-not-working-when-served-by-apache-but-works-fine-in-cmd-line-ubuntu-on-ec2-instance/18356 "2014-06-26T17:16:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xavier\_Sorgel](https://avatars.discourse-cdn.com/v4/letter/x/3be4f8/32.png) [@Xavier\_Sorgel](https://discuss.elastic.co/u/Xavier_Sorgel)\
**Post date:** [June 26, 2014, 5:16pm UTC](https://discuss.elastic.co/t/elastic-php-sdk-issue-script-not-working-when-served-by-apache-but-works-fine-in-cmd-line-ubuntu-on-ec2-instance/18356/1 "2014-06-26T17:16:21Z")

</div>

I"m looking for some pointers on how to debug my issue: my php scripts  
works fine when run from the command line but somehow crashes when served  
by apache (I"m using an EC2 instance that runs apache and elasticsearch on  
ubuntu)

It seems $client = new Elasticsearch\Client() fails when served by apache  
but call work fine when script is executed from cmd line. I thought my  
security settings in EC2 may be incomplete but I have All traffic/All  
protocol enabled for all outbound traffic...

Any idea what I'm missing? thanks!

X

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/45f996da-b591-4b46-ac8f-0d92ebe6dfac%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/45f996da-b591-4b46-ac8f-0d92ebe6dfac%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Xavier\_Sorgel](https://avatars.discourse-cdn.com/v4/letter/x/3be4f8/32.png) [@Xavier\_Sorgel](https://discuss.elastic.co/u/Xavier_Sorgel)\
**Post date:** [June 26, 2014, 8:35pm UTC](https://discuss.elastic.co/t/elastic-php-sdk-issue-script-not-working-when-served-by-apache-but-works-fine-in-cmd-line-ubuntu-on-ec2-instance/18356/2 "2014-06-26T20:35:29Z")

</div>

oh well - curl was not installed it seems. I installed curl, restarted  
apache and now everything works fine...

X  
On Thursday, June 26, 2014 10:16:21 AM UTC-7, Xavier Sorgel wrote:

> I"m looking for some pointers on how to debug my issue: my php scripts  
> works fine when run from the command line but somehow crashes when served  
> by apache (I"m using an EC2 instance that runs apache and elasticsearch on  
> ubuntu)
> 
> It seems $client = new Elasticsearch\Client() fails when served by apache  
> but call work fine when script is executed from cmd line. I thought my  
> security settings in EC2 may be incomplete but I have All traffic/All  
> protocol enabled for all outbound traffic...
> 
> Any idea what I'm missing? thanks!
> 
> X

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9db2ce45-0f81-47c6-ad5a-be39bd576ea0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9db2ce45-0f81-47c6-ad5a-be39bd576ea0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:19am UTC](https://discuss.elastic.co/t/elastic-php-sdk-issue-script-not-working-when-served-by-apache-but-works-fine-in-cmd-line-ubuntu-on-ec2-instance/18356/3 "2017-07-06T01:19:26Z")

</div>


