Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 9cf2d48

Browse files
committed
1 parent 3cb49bc commit 9cf2d48

File tree

5 files changed

+59
-8
lines changed

5 files changed

+59
-8
lines changed

docs/en/faq/index.md

+12
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,15 @@ The phpmicro referenced by this project and related projects is only a package o
6060
The compiler for PHP code is a completely different project, so the extra cases are not taken into account.
6161
If you are interested in encryption, you can consider using existing encryption technologies,
6262
such as Swoole Compiler, Source Guardian, etc.
63+
64+
## Unable to use ssl
65+
66+
When using curl, pgsql, etc. to request an HTTPS website or establish an SSL connection, there may be an `error:80000002:system library::No such file or directory` error.
67+
This error is caused by statically compiled PHP without specifying `openssl.cafile` via `php.ini`.
68+
69+
You can solve this problem by specifying `php.ini` before using PHP and adding `openssl.cafile=/path/to/your-cert.pem` in the INI.
70+
71+
For Linux systems, you can download the [cacert.pem](https://curl.se/docs/caextract.html) file from the curl official website, or you can use the certificate file that comes with the system.
72+
For the certificate locations of different distros, please refer to [Golang docs](https://go.dev/src/crypto/x509/root_linux.go).
73+
74+
> INI configuration `openssl.cafile` cannot be set dynamically using the `ini_set()` function, because `openssl.cafile` is a `PHP_INI_SYSTEM` type configuration and can only be set in the `php.ini` file.

docs/en/guide/extension-notes.md

+17-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ Because it is a static compilation, extensions will not compile 100% perfectly,
44
and different extensions have different requirements for PHP and the environment,
55
which will be listed one by one here.
66

7+
## curl
8+
9+
When using curl to request HTTPS, there may be an `error:80000002:system library::No such file or directory` error.
10+
For details on the solution, see [FAQ - Unable to use ssl](../faq/#unable-to-use-ssl).
11+
712
## phpmicro
813

914
1. Only PHP >= 8.0 is supported.
@@ -100,12 +105,21 @@ The compiled `./php` binary can be configured and run by specifying the INI, eg
100105

101106
~~pgsql ssl connection is not compatible with openssl 3.2.0. See:~~
102107

103-
- ~~https://github.com/Homebrew/homebrew-core/issues/155651~~
104-
- ~~https://github.com/Homebrew/homebrew-core/pull/155699~~
105-
- ~~https://github.com/postgres/postgres/commit/c82207a548db47623a2bfa2447babdaa630302b9~~
108+
- ~~<https://github.com/Homebrew/homebrew-core/issues/155651>~~
109+
- ~~<https://github.com/Homebrew/homebrew-core/pull/155699>~~
110+
- ~~<https://github.com/postgres/postgres/commit/c82207a548db47623a2bfa2447babdaa630302b9>~~
106111

107112
pgsql 16.2 has fixed this bug, now it's working.
108113

114+
When pgsql uses SSL connection, there may be `error:80000002:system library::No such file or directory` error,
115+
For details on the solution, see [FAQ - Unable to use ssl](../faq/#unable-to-use-ssl).
116+
117+
## openssl
118+
119+
When using openssl-based extensions (such as curl, pgsql and other network libraries),
120+
there may be an `error:80000002:system library::No such file or directory` error.
121+
For details on the solution, see [FAQ - Unable to use ssl](../faq/#unable-to-use-ssl).
122+
109123
## password-argon2
110124

111125
1. password-argon2 is not a standard extension, it is an additional algorithm for the `password_hash` function.

docs/extensions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
| bz2 | yes | yes | yes | |
66
| calendar | yes | yes | yes | yes |
77
| ctype | yes | yes | yes | yes |
8-
| curl | yes | yes | yes | yes |
8+
| [curl](./extension-notes#curl) | yes | yes | yes | yes |
99
| dba | yes | yes | yes | yes |
1010
| dom | yes | yes | | yes |
1111
| ds | yes, untested | yes, untested | yes, untested | yes, untested |
@@ -37,7 +37,7 @@
3737
| mysqlnd | yes | yes | yes | yes |
3838
| [oci8](./extension-notes#oci8) | no | no | no | |
3939
| opcache | yes | yes | yes | yes |
40-
| openssl | yes | yes | yes | yes |
40+
| [openssl](./extension-notes#openssl) | yes | yes | yes | yes |
4141
| [password-argon2](./extension-notes#password-argon2) | yes | yes | | |
4242
| pcntl | yes | yes | yes | no |
4343
| pdo | yes | yes | yes | yes |

docs/zh/faq/index.md

+12
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,15 @@ bin/spc build ffi --build-cli --no-strip
4747
所以本项目(static-php-cli)、相关项目(lwmbs、swoole-cli)都是提供一个对 php-src 源码的便捷编译工具,
4848
本项目和相关项目引用的 phpmicro 也仅仅是 PHP 的 sapi 接口封装,而不是 PHP 代码的编译工具。
4949
PHP 代码的编译器是完全不同的项目,因此不会考虑额外的情况。如果你对加密感兴趣,可以考虑使用现有的加密技术,如 Swoole Compiler、Source Guardian 等。
50+
51+
## 无法使用 ssl
52+
53+
使用 curl、pgsql 等 请求 HTTPS 网站或建立 SSL 连接时,可能存在 `error:80000002:system library::No such file or directory` 错误,
54+
这个错误是由于静态编译的 PHP 未通过 `php.ini` 指定 `openssl.cafile` 导致的。
55+
56+
你可以在使用 PHP 前指定 `php.ini`,并在 INI 内添加 `openssl.cafile=/path/to/your-cert.pem` 来解决这个问题。
57+
58+
对于 Linux 系统,你可以从 curl 官方网站下载 [cacert.pem](https://curl.se/docs/caextract.html) 文件,也可以使用系统自带的证书文件。
59+
有关不同发行版的证书位置,可参考 [Go 标准库](https://go.dev/src/crypto/x509/root_linux.go)
60+
61+
> INI 配置 `openssl.cafile` 不可以使用 `ini_set()` 函数动态设置,因为 `openssl.cafile` 是一个 `PHP_INI_SYSTEM` 类型的配置,只能在 `php.ini` 文件中设置。

docs/zh/guide/extension-notes.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
因为是静态编译,扩展不会 100% 完美编译,而且不同扩展对 PHP、环境都有不同的要求,这里将一一列举。
44

5+
## curl
6+
7+
使用 curl 请求 HTTPS 时,可能存在 `error:80000002:system library::No such file or directory` 错误,
8+
解决办法详见 [FAQ - 无法使用 ssl](../faq/#无法使用-ssl)
9+
510
## phpmicro
611

712
1. phpmicro SAPI 仅支持 PHP >= 8.0 版本。
@@ -91,12 +96,20 @@ bin/spc build gd --with-libs=freetype,libjpeg,libavif,libwebp --build-cli
9196

9297
~~pgsql ssl 连接与 openssl 3.2.0 不兼容。相关链接:~~
9398

94-
- ~~https://github.com/Homebrew/homebrew-core/issues/155651~~
95-
- ~~https://github.com/Homebrew/homebrew-core/pull/155699~~
96-
- ~~https://github.com/postgres/postgres/commit/c82207a548db47623a2bfa2447babdaa630302b9~~
99+
- ~~<https://github.com/Homebrew/homebrew-core/issues/155651>~~
100+
- ~~<https://github.com/Homebrew/homebrew-core/pull/155699>~~
101+
- ~~<https://github.com/postgres/postgres/commit/c82207a548db47623a2bfa2447babdaa630302b9>~~
97102

98103
pgsql 16.2 修复了这个 Bug,现在正常工作了。
99104

105+
在 pgsql 使用 SSL 连接时,可能存在 `error:80000002:system library::No such file or directory` 错误,
106+
解决办法详见 [FAQ - 无法使用 ssl](../faq/#无法使用-ssl)
107+
108+
## openssl
109+
110+
使用基于 openssl 的扩展(如 curl、pgsql 等网络库)时,可能存在 `error:80000002:system library::No such file or directory` 错误,
111+
解决办法详见 [FAQ - 无法使用 ssl](../faq/#无法使用-ssl)
112+
100113
## password-argon2
101114

102115
1. password-argon2不是一个标准的扩展,它是 `password_hash` 函数的额外算法。

0 commit comments

Comments
 (0)