I'd like to use PHP7 with curl, with HTTP/2 support enabled. What do I need to do? asked 12 Aug '16, 18:22 seanf |
First, you'll need to be on one of WebFaction's CentOS7 servers, because the build tools on our older servers are too old to build nghttp2. If you're not on a CentOS7 server (web500 or higher, or one of our cloud plans) then you can request a migration via the control panel. Once you're on a CentOS7 server, run the following commands to install nghttp2 and an updated curl in your home directory:
Next, run
Next, run
Next, create a PHP 7 application via the control panel if you've not done so already. Next, create a file named
Next, make the
Finally, create a
That's it! When you're done, your PHP 7 application will be able to use the newer curl library with HTTP/2 support. Note that this technique can be adapted to almost any CGI or PHP application that needs to use custom libraries or environment variables. answered 12 Aug '16, 18:22 seanf |
Following the instructions above e and getting help from the amazin webfaction support I managed to configure on my shared hosting account HTTP/2 support for a PHP7 application. For my purposes I needed to install a custom OpenSSL too, because the versione of the installed one is too old. Because of this I compiled a custom PHP 7 from scratch to get it works. Following are the step I made to achieve a full custom installation of PHP 7 + cURL + ngHTTP2 + openSSL 1.0.2g:
ngHTTP2
OpenSSL
cURL
test cURL
PHP
Convert your app to use your own PHP installation
Don't forget to make the CGI script executable:
answered 06 Sep '16, 04:49 ovosodo |