androxin
Goto Top

PHP mit OpenSSL unter High Sierra nutzen

Hallo zusammen,

in einer Software die ich verwende, wird PHP 5.6 als Plugin genutzt. PHP wird dort direkt als .dylib eingebunden.
Um SSL Verbindungen über PHP herstellen zu können, musste in der Vergangenheit nachträglich openssl installiert werden:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"  
brew install openssl

Ohne das installierte OpenSSL Paket ist der PHP Interpreter einfach abgestürzt. Das hat bis einschließlich Sierra wunderbar funktioniert.

Nun unter High Sierra klappt das nicht mehr:

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler 

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libboringssl.dylib            	0x00007fff6b745148 ssl_create_cipher_list + 105
1   libboringssl.dylib            	0x00007fff6b746224 SSL_CTX_new + 252
2   libphp5.mac.dylib             	0x000000011542e681 php_openssl_setup_crypto + 433
3   libphp5.mac.dylib             	0x00000001154303cc php_openssl_sockop_set_option + 108
4   libphp5.mac.dylib             	0x00000001157a7de8 _php_stream_set_option + 40
5   libphp5.mac.dylib             	0x00000001157b2dfb php_stream_xport_crypto_setup + 43
6   libphp5.mac.dylib             	0x000000011543044d php_openssl_sockop_set_option + 237
7   libphp5.mac.dylib             	0x00000001157a7de8 _php_stream_set_option + 40
8   libphp5.mac.dylib             	0x00000001157b263c _php_stream_xport_create + 700
9   libphp5.mac.dylib             	0x0000000115762eac php_stream_url_wrap_http_ex + 1388
10  libphp5.mac.dylib             	0x0000000115765e9c php_stream_url_wrap_http + 28
11  libphp5.mac.dylib             	0x00000001157aa280 _php_stream_open_wrapper_ex + 256
12  libphp5.mac.dylib             	0x00000001154242c8 php_libxml_streams_IO_open_wrapper + 312
13  libphp5.mac.dylib             	0x000000011542405c php_libxml_input_buffer_create_filename + 44
....


Außerdem gibt es nach der Installation von OpenSSL folgenden Hinweis:

A CA file has been bootstrapped using certificates from the SystemRootskeychain. To add additional certificates (e.g. the certificates added inthe System keychain), place .pem files in
  /usr/local/etc/openssl/certs 

and run
  /usr/local/opt/openssl/bin/c_rehash 

openssl is keg-only, which means it was not symlinked into /usr/local,because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries. 

If you need to have openssl first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile   

For compilers to find openssl you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl/lib"  
  export CPPFLAGS="-I/usr/local/opt/openssl/include"  


In dem crashreport wird darauf hingewiesen, dass libboringssl.dylib verwendet wird. Wenn ich richtig informiert bin, wurde in High Sierra das mitgelieferte OpenSSL durch BoringSSL ersetzt. Wie bekomme ich jetzt PHP dazu entweder wieder openSSL zu verwenden oooder bekomme das BoringSSL derart ertüchtigt, dass es nicht mehr für einen Absturz sorgt?

In der PHP Info ist übrigens alles unverdächtig. OpenSSL kann korrekt geladen werden, die Pfade sind korrekt etc.


Hat jemand eine Idee, in welche Richtung man weiter suchen könnte?

Content-Key: 387526

Url: https://administrator.de/contentid/387526

Ausgedruckt am: 29.03.2024 um 06:03 Uhr