mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-22 16:25:36 +08:00
update
This commit is contained in:
@@ -2,7 +2,18 @@
|
||||
|
||||
Here will be some questions that you may encounter easily. There are currently many, but I need to take time to organize them.
|
||||
|
||||
## Can statically compiled PHP install extensions?
|
||||
## What is the path of `php.ini`?
|
||||
|
||||
On Linux, macOS and FreeBSD, the path of `php.ini` is `/usr/local/etc/php/php.ini`.
|
||||
On Windows, the path is `C:\windows\php.ini`.
|
||||
The directory where to look for `php.ini` can be changed using the manual build option `--with-config-file-path`.
|
||||
|
||||
In addition, on Linux, macOS and FreeBSG, `.ini` files present in the `/usr/local/etc/php/conf.d` directory will also be loaded.
|
||||
The directory can be changed using the manual build option `--with-config-file-scan-dir`.
|
||||
|
||||
`php.ini` will also be searched for in [the other standard locations](https://www.php.net/manual/configuration.file.php).
|
||||
|
||||
## Can statically-compiled PHP install extensions?
|
||||
|
||||
Because the principle of installing extensions in PHP under the traditional architecture is to install new extensions using `.so` type dynamic link libraries,
|
||||
and statically linked PHP compiled using this project cannot **directly** install new extensions using dynamic link libraries.
|
||||
|
||||
@@ -304,7 +304,8 @@ You can try to use the following commands:
|
||||
- `--enable-zts`: Make compiled PHP thread-safe version (default is NTS version)
|
||||
- `--no-strip`: Do not run `strip` after compiling the PHP library to trim the binary file to reduce its size (the macOS binary file without trim can use dynamically linked third-party extensions)
|
||||
- `--with-libs=XXX,YYY`: Compile the specified dependent library before compiling PHP, and activate some extended optional functions (such as libavif of the gd library, etc.)
|
||||
- `--with-config-file-path=XXX`: Set the path in which to look for php.ini
|
||||
- `--with-config-file-path=XXX`: Set the path in which to look for `php.ini` (defaults to `/usr/local/etc/php` on Linux, macOS and FreeBSD)
|
||||
- `--with-config-file-scan-dir=XXX`: Set the directory to scan for `.ini` files after reading `php.ini` (defaults to `/usr/local/etc/php/conf.d` on Linux, macOS and FreeBSD)
|
||||
- `-I xxx=yyy`: Hard compile INI options into PHP before compiling (support multiple options, alias is `--with-hardcoded-ini`)
|
||||
- `--with-micro-fake-cli`: When compiling micro, let micro's `PHP_SAPI` pretend to be `cli` (for compatibility with some programs that check `PHP_SAPI`)
|
||||
- `--disable-opcache-jit`: Disable opcache jit (enabled by default)
|
||||
|
||||
@@ -2,6 +2,17 @@
|
||||
|
||||
这里将会编写一些你容易遇到的问题。目前有很多,但是我需要花时间来整理一下。
|
||||
|
||||
## `php.ini`的路径是什么?
|
||||
|
||||
在 Linux、macOS 和 FreeBSD 上,`php.ini` 的路径是 `/usr/local/etc/php/php.ini`。
|
||||
在 Windows 中,路径是`C:\windows\php.ini`。
|
||||
可以使用手动构建选项“--with-config-file-path ”来更改查找 “php.ini ”的目录。
|
||||
|
||||
此外,在 Linux、macOS 和 FreeBSG 上,“/usr/local/etc/php/conf.d ”目录中的“.ini ”文件也会被加载。
|
||||
可以使用手动构建选项“--with-config-file-scan-dir ”更改该目录。
|
||||
|
||||
`php.ini` "也会在[其他标准位置](https://www.php.net/manual/configuration.file.php)中搜索。
|
||||
|
||||
## 静态编译的 PHP 可以安装扩展吗
|
||||
|
||||
因为传统架构下的 PHP 安装扩展的原理是使用 `.so` 类型的动态链接的库方式安装新扩展,而使用本项目编译的静态链接的 PHP 无法**直接**使用动态链接库安装新扩展。
|
||||
|
||||
Reference in New Issue
Block a user