简体   繁体   中英

How to install PECL package behind a corporate proxy?

I have configure the pear config-set http_proxy "$http_proxy" , but this not have any effect.

Take a look below to see what is the output I'm getting:

pecl install bz2
WARNING: "pear/bz2" is deprecated in favor of "channel://http://php.net/bzip2/ext/bz2"

Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in PEAR/Proxy.php on line 101

Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /usr/local/lib/php/PEAR/Proxy.php on line 101

Notice: Undefined variable: proxy_host in PEAR/Proxy.php on line 103

Notice: Undefined variable: proxy_port in PEAR/Proxy.php on line 103

Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in PEAR/Proxy.php on line 101

Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /usr/local/lib/php/PEAR/Proxy.php on line 101

Notice: Undefined variable: proxy_host in PEAR/Proxy.php on line 103

Notice: Undefined variable: proxy_port in PEAR/Proxy.php on line 103
Could not establish SSL connection through proxy ::

I had the same problem.

I solved this by adding the below to php.ini and all the errors went away.

openssl.cafile=/etc/ssl/certs/ca-bundle.trust.crt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM