-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cURL doesn't work on the Google App Engine environment #13
Comments
Google App Engine supports http streams (which uses urlfetch() under the hood). So commands like file_get_contents() and fopen() will work. |
urlfetch in php (file_get_contents) https://developers.google.com/appengine/docs/php/urlfetch/ |
See: #14 |
It seemed as of late last year (2013) that GAE developers were headed toward providing cURL functions within GAE (ref: https://code.google.com/p/googleappengine/issues/detail?id=9343). Now it is nearly a year later, but there is no update on the status of this issue. Closing this issue by providing cURL functionality in GAE would make life much easier for many folks. Is there a way to increase the attention to this issue? |
(disclaimer, I work on the GAE PHP team) Starring the issue is a great way to signal it's importance. cURL support is still very much on the roadmap, even if we've been a little quiet this year. That said, any reason this implementation focuses on cURL rather than streams? |
It seems many php projects use the curl library; the ability to use existing projects without tearing into their internal functionality is key to my ability to support my organization. I have the ability to understand what's going on, but changing project internals feels a bit risky to me, and would require investment of more time and effort than I can give as a volunteer resource. |
@ajessup cURL is one of the most popular PHP extensions and is used in hundreds of projects on Packagist (for example, cURL is the default HTTP handler for Guzzle). Developers often choose cURL over PHP's stream wrapper because cURL offers far more flexibility and performance (e.g., persistent connections). |
@ajessup while I can see streams being very useful, I can't help but fully agree with @mtdowling on this. In so many of my projects, I find using cURL much more enjoyable, flexible and powerful not to mention the huge list of libraries that already rely on cURL |
It should also be noted that the Google App Engine stream wrapper implementation doesn't appear to support using a custom CA bundle (or any ssl context option other than "verify_peer"): https://cloud.google.com/appengine/docs/php/urlfetch/
This makes an even stronger case for adding cURL support. But even if support cURL is added, the other ssl context options should be supported. |
Folks, this issue has caused me to stop my work to implement CiviCRM / Regards, Don Hirst On Thu, Jan 15, 2015 at 2:33 PM, Michael Dowling notifications@github.com
|
I am developing a mobile app on Google app engine, and it has been difficult to implement gcm, the community recommends "urlfetch" but will that urlfetch can replace curl to gcm on Google App engine? |
Another six months have passed with no action on this topic. Is Google going to address cURL or not? |
cURL is now allowed on GAE. In your app.yaml file you need this:
Then you will need to create a php.ini file in your root directory with the line
See here: https://cloud.google.com/appengine/docs/php/#dynamically_loadable_extensions You will need to enable billing |
Thanks for this information. I'll follow up on it. |
Yup, no worries. Just a heads up. After enabling the billing, it will take a bit for it to be activated. I usually wait an hour or so before testing it. |
This still doesn't seem to work. I have billing enabled on the project and the following in app.yaml
and this in php.ini
and the script
but it produces the following output:
notice the content type and http code are empty. On a local environment the same code produces
|
Did you set a billing limit? |
I have billing limited to $50/day and haven't used over $2 in the last week. |
http://terrenceryan.com/blog/index.php/php-on-app-engine-does-curl/
Try calling a different domain instead of Google |
That did it! Thank you. |
No problem! |
Via support: "It seems that your php library uses cURL which is not supported on GAE PHP"
On further inspection, it seems this is correct. If we want to support this platform,
urlfetch
might be a better solution.The text was updated successfully, but these errors were encountered: