hechoendrupal / drupal-console

The Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.
http://drupalconsole.com
GNU General Public License v2.0
940 stars 559 forks source link

Installation commands fail with MAMP 3.5 #2533

Open damienmckenna opened 8 years ago

damienmckenna commented 8 years ago

I'm attempting to install the latest release from scratch and am hitting the following problems:

$ curl https://drupalconsole.com/installer -L -o drupal.phar
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (35) error:14077102:SSL routines:SSL23_GET_SERVER_HELLO:unsupported protocol

and..

$ php -r "readfile('https://drupalconsole.com/installer');"

Warning: readfile(): SSL operation failed with code 1. OpenSSL Error messages:
error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure in Command line code on line 1

Warning: readfile(): Failed to enable crypto in Command line code on line 1

Warning: readfile(https://drupalconsole.com/installer): failed to open stream: operation failed in Command line code on line 1

This is on the latest OSX El Capitan release (10.11.5) with MAMP Pro 3.5. I've confirmed that the "curl" and "php" commands are coming from MAMP and are not the system versions:

$ curl --version
curl 7.43.0 (x86_64-apple-darwin10.8.0) libcurl/7.43.0 OpenSSL/0.9.8zd zlib/1.2.8 libidn/1.17
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets 

$ php -v
PHP 5.6.10 (cli) (built: Jul  6 2015 14:28:54) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

This may be a problem limited to the libraries bundled with MAMP 3.5, I'll update to the latest 3.5.2 in a few days and will see if that resolves the problem.

damienmckenna commented 8 years ago

FYI I can manually download the installer file via Safari and use it (after fixing chmod and moving it to somewhere in my system $path).

damienmckenna commented 8 years ago

BTW manually downloading the installer does work around the problem of not being able to self-update from 0.11.2. And now I have the Trait fatal error :)

damienmckenna commented 8 years ago

Oh, wait, no, it still says 0.11.2. Maybe the drupalconsole.com/installer file is just out of date?

damienmckenna commented 8 years ago

The SSL problems appears to be limited to MAMP's version of curl, if I use the system curl it's able to load the URL correctly:

/usr/bin/curl -I https://drupalconsole.com/installer
HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: must-revalidate, no-cache, private
Content-Disposition: attachment; filename=drupal.phar
Content-Language: en
Content-Length: 2310065
Content-Type: application/octet-stream
Date: Thu, 21 Jul 2016 18:59:09 GMT
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Server: AmazonS3
X-Amz-Id-2: JiveWx6A74Wey6xaUmHMXCS5mQJbSrmdqy0aIze9vZkZ6oPzMjZEEOXn6omqgoC55K2W8pVeG2E=
X-Amz-Request-Id: DC81F4459653B50F
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Generator: Drupal 8 (https://www.drupal.org)
X-Pantheon-Endpoint: cf937a37-5c83-4dfb-8d2d-ea1b21d771e8
X-Pantheon-Styx-Hostname: styxf8f66dba
X-Styx-Req-Id: styx-f9cdf58e7b76e2bcbdf6898cceca6db9
X-Styx-Version: StyxGo
X-Ua-Compatible: IE=edge
X-Varnish: 543757309 543757310
Age: 0
Via: 1.1 varnish-v4
Connection: keep-alive
chrisfree commented 8 years ago

Had the exact same issue. Using the system's version of curl worked without issue.

cleverhoods commented 8 years ago

Confirm issue on El Capitan (10.11.6) with MAMP (3.5). @damienmckenna suggestion working as expected.

n00b21337 commented 8 years ago

I hade the similar problem, both versions seems that are the same 7.43, but installation and features are different I guess

MacBook-Pro:billing Marko$ /usr/bin/curl --version curl 7.43.0 (x86_64-apple-darwin14.0) libcurl/7.43.0 SecureTransport zlib/1.2.5 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz UnixSockets

MacBook-Pro:billing Marko$ curl --version curl 7.43.0 (x86_64-apple-darwin10.8.0) libcurl/7.43.0 OpenSSL/0.9.8zd zlib/1.2.8 libidn/1.17 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz UnixSockets MacBook-Pro:billing Marko$ /usr/bin/curl https://drupalconsole.com/installer -L -o drupal.phar

n00b21337 commented 8 years ago

So it must be this "FEATURES" part so CURL recompiling in MAMP is needed with some feature that is missing

n00b21337 commented 8 years ago

hmm little more on this, seems not so trivial to solve inside mamp https://coreyolson.com/2016/02/14/php-curl-fails-on-cloudflare-or-sslv3-sites-using-mamp-3-5-due-to-old-openssl-version/

dupls commented 7 years ago

damienmckenna I also battled to load drupal console and kept getting the curl: (35) error code. Your script 'appeared' to work but I still can't run anything. I type php drupal.phar . I get no error but I also get nothing. So it doesn't look like it did get installed. I didn't see arpitr comments above. Yep that did it thanks so much.