4

I am attempting to install Symfony3 on an Ubuntu 17.04 machine and am getting the error:

[GuzzleHttp\Ring\Exception\RingException]                                    
Error creating resource: [message] fopen(): Unable to find the wrapper "htt  
  ps" - did you forget to enable it when you configured PHP?                   
[file] phar:///usr/local/bin/symfony/vendor/guzzlehttp/ringphp/src/Client/S  
  treamHandler.php                                                             
[line] 406                                                                   
[message] fopen(https://get.symfony.com/symfony.version): failed to open st  
  ream: No such file or directory                                              
[file] phar:///usr/local/bin/symfony/vendor/guzzlehttp/ringphp/src/Client/S  
  treamHandler.php                                                             
[line] 406                                                                   
[message] Undefined variable: http_response_header                           
[file] phar:///usr/local/bin/symfony/vendor/guzzlehttp/ringphp/src/Client/S  
  treamHandler.php                                                             
[line] 407     

when running the symfony new command. I am running PHP version 7.19 and OpenSSL version 1.1.0f. I have also tried with OpenSSL version 1.0.2g (the version available from the Ubuntu package manager) and the same error occurs. I have also tried installing PHP from source using the --with-openssl[=DIR] flag pointing to the SSL directory in the untarred PHP source, but though this completes without error it doesn't help.

I have looked at answers like this:

Symfony 3 new project error

but they are all either for Windows (telling me to uncomment the .dll in php.ini which doesn't work on Ubuntu) or they are tell me to install a PHP 5 package, such as php53-opensll, which doesn't work on this system.

The output from phpinfo() includes:

OpenSSL support     disabled (install ext/openssl) 

In the Phar: PHP Archive support section, but I am not sure of the correct process to properly enable support in Phar, if this is indeed the problem area.

Any suggestions greatly appreciated.

Peter Carter
  • 43
  • 1
  • 7

1 Answers1

3

You have to enable the openssl extension in your php.ini configuration. Locate it (the phpinfo() output says at the top from where it's loading the ini files) and add (or uncomment if present)

module=openssl.so

beside the other module declarations.

Alessandro Lai
  • 2,254
  • 2
  • 24
  • 32
  • Just trying it now. Out of interest, how did you find out that's the correct name for the .so file? I was looking everywhere, and even tried just altering the .dll extension to .so... – Peter Carter Sep 26 '17 at 14:31
  • Ok, I did that, restarted nginx and I'm still getting the same error. The only difference being when attempting to access my index.php file, nginx is now showing '502 Bad Gateway' instead of the phpinfo details. – Peter Carter Sep 26 '17 at 14:34