Comments (21)
cURL is now allowed on GAE. In your app.yaml file you need this:
runtime: php55
Then you will need to create a php.ini file in your root directory with the line
extension = "curl.so"
See here: https://cloud.google.com/appengine/docs/php/#dynamically_loadable_extensions
You will need to enable billing
from pusher-http-php.
Google App Engine supports http streams (which uses urlfetch() under the hood). So commands like file_get_contents() and fopen() will work.
from pusher-http-php.
urlfetch in php (file_get_contents) https://developers.google.com/appengine/docs/php/urlfetch/
from pusher-http-php.
See: #14
from pusher-http-php.
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?
from pusher-http-php.
(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?
from pusher-http-php.
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.
from pusher-http-php.
@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).
from pusher-http-php.
@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
from pusher-http-php.
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/
There are a few considerations to keep in mind when using these wrappers in your Google App Engine application:
- When connecting to web sites using HTTPS, the default behavior is to validate the certificate of the host and reject requests where the vertificate does not match. This is the opposite to the default behavior of PHP, and to change this behavior you can set the value of verify_peer to false in the ssl section of the context parameters.
- All other values of ssl contexts options are ignored.
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.
from pusher-http-php.
Folks, this issue has caused me to stop my work to implement CiviCRM /
WordPress on GAE. I've spent the past couple of days (not weeks and
months) implementing the same (actually newer and better) configuration on
Amazon Web Services, and it has gone very smoothly so far. I'd really
rather be on Google, but it just hasn't worked. FWIW, YMMV.
Regards,
Don Hirst
On Thu, Jan 15, 2015 at 2:33 PM, Michael Dowling [email protected]
wrote:
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/There are a few considerations to keep in mind when using these wrappers
in your Google App Engine application:
When connecting to web sites using HTTPS, the default behavior is to
validate the certificate of the host and reject requests where the
vertificate does not match. This is the opposite to the default behavior of
PHP, and to change this behavior you can set the value of verify_peer to
false in the ssl section of the context parameters.All other values of ssl contexts options are ignored.
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.โ
Reply to this email directly or view it on GitHub
#13 (comment)
.
from pusher-http-php.
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?
from pusher-http-php.
Another six months have passed with no action on this topic. Is Google going to address cURL or not?
from pusher-http-php.
Thanks for this information. I'll follow up on it.
from pusher-http-php.
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.
from pusher-http-php.
This still doesn't seem to work. I have billing enabled on the project and the following in app.yaml
runtime: php55
and this in php.ini
extension = "curl.so"
and the script
$ch = curl_init('http://google.com/');
$response = curl_exec($ch);
echo '<pre>' . print_r(curl_getinfo($ch),1);
echo '<pre>' . print_r(curl_error($ch),1);
echo '<pre>' . print_r($response,1);
die;
but it produces the following output:
Array
(
[url] => http://google.com/
[content_type] =>
[http_code] => 0
[header_size] => 0
[request_size] => 0
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0
[namelookup_time] => 0.047984
[connect_time] => 0
[pretransfer_time] => 0
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => -1
[starttransfer_time] => 0
[redirect_time] => 0
[redirect_url] =>
[primary_ip] =>
[certinfo] => Array
(
)
[primary_port] => 0
[local_ip] =>
[local_port] => 0
)
notice the content type and http code are empty. On a local environment the same code produces
Array
(
[url] => http://google.com/
[content_type] => text/html; charset=UTF-8
[http_code] => 302
[header_size] => 234
[request_size] => 49
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.157038
[namelookup_time] => 0.068574
[connect_time] => 0.112838
[pretransfer_time] => 0.112901
[size_upload] => 0
[size_download] => 262
[speed_download] => 1668
[speed_upload] => 0
[download_content_length] => 262
[upload_content_length] => 0
[starttransfer_time] => 0.156984
[redirect_time] => 0
[redirect_url] => http://www.google.com.ua/?gfe_rd=cr&ei=CnMNVuyVAqWG8Qe0pJLICQ
[primary_ip] => 173.194.112.14
[certinfo] => Array
(
)
[primary_port] => 80
[local_ip] => 192.168.0.3
[local_port] => 53909
)
from pusher-http-php.
Did you set a billing limit?
from pusher-http-php.
I have billing limited to $50/day and haven't used over $2 in the last week.
from pusher-http-php.
http://terrenceryan.com/blog/index.php/php-on-app-engine-does-curl/
cURL is limited by the restrictions of App Engineโs sockets but include:
- Limited from targeting Google domains
- May be reclaimed after 2 minutes of inactivity
Try calling a different domain instead of Google
from pusher-http-php.
That did it! Thank you.
from pusher-http-php.
No problem!
from pusher-http-php.
Related Issues (20)
- Unable to subscribe to private channel - gives 403 | Forbidden HOT 3
- Compatibility issues with ugprade 7.0.2 -> 7.2.0 HOT 11
- authenticateUser() gives invalid response HOT 6
- Echo.listen not working in pusher-php-server 7.2.1 HOT 2
- Upgrading from 7.0.2 to 7.2.0 breaks broadcasting events in laravel HOT 5
- Pusher error: cURL error 28: Failed to connect to api-eu.pusher.com port 443: Connection timed out HOT 7
- Invalid user id from pusher server. HOT 2
- The CI setup is not friendly to community contributors HOT 1
- Add the ability to set Guzzle config from $options HOT 3
- v7.2.1 is not compatible with pusher SDK HOT 5
- Batch message sending does not add socket_id from event HOT 6
- Internal Server Error 500 HOT 2
- Pusher Beams Enquiry HOT 23
- Reporting a vulnerability HOT 1
- Pusher being run at Laravel package:discover resulting in Argument Error HOT 7
- Pusher Presence Channel Data HOT 1
- First parameter must either be an object or the name of an existing class {"exception":"[object] (ErrorException(code: 0) HOT 2
- Question about deprecation for all of the versions above v13 HOT 1
- [bug] cannot set a custom timeout as a option in pusher
- Triggering single event on multiple encrypted channel fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pusher-http-php.