docs: update repository links and sync cn readme (#1711)

This commit is contained in:
Luffy
2025-07-01 16:29:55 +08:00
committed by GitHub
parent 40ee7929a1
commit ac900e0df4
46 changed files with 143 additions and 117 deletions

View File

@@ -10,7 +10,7 @@ body:
Before submitting a bug, please double-check that your problem [is not
a known issue](https://frankenphp.dev/docs/known-issues/)
(especially if you use XDebug or Tideways), and that is has not
[already been reported](https://github.com/dunglas/frankenphp/issues).
[already been reported](https://github.com/php/frankenphp/issues).
- type: textarea
id: what-happened
attributes:

View File

@@ -46,7 +46,7 @@ EXPOSE 2019
LABEL org.opencontainers.image.title=FrankenPHP
LABEL org.opencontainers.image.description="The modern PHP app server"
LABEL org.opencontainers.image.url=https://frankenphp.dev
LABEL org.opencontainers.image.source=https://github.com/dunglas/frankenphp
LABEL org.opencontainers.image.source=https://github.com/php/frankenphp
LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.vendor="Kévin Dunglas"

View File

@@ -23,7 +23,7 @@ containing [PHP 8.4](https://www.php.net/releases/8.4/en.php) and most popular P
On Windows, use [WSL](https://learn.microsoft.com/windows/wsl/) to run FrankenPHP.
[Download FrankenPHP](https://github.com/dunglas/frankenphp/releases) or copy this line into your
[Download FrankenPHP](https://github.com/php/frankenphp/releases) or copy this line into your
terminal to automatically install the version appropriate for your platform:
```console

View File

@@ -12,7 +12,7 @@ Binaries and Docker images are rebuilt nightly using the latest versions of depe
If you believe you have discovered a security issue directly affecting FrankenPHP,
please do **NOT** report it publicly.
Please write a detailed vulnerability report and send it [through GitHub](https://github.com/dunglas/frankenphp/security/advisories/new) or to [kevin+frankenphp-security@dunglas.dev](mailto:kevin+frankenphp-security@dunglas.dev?subject=Security%20issue%20affecting%20FrankenPHP).
Please write a detailed vulnerability report and send it [through GitHub](https://github.com/php/frankenphp/security/advisories/new) or to [kevin+frankenphp-security@dunglas.dev](mailto:kevin+frankenphp-security@dunglas.dev?subject=Security%20issue%20affecting%20FrankenPHP).
Only vulnerabilities directly affecting FrankenPHP should be reported to this project.
Flaws affecting components used by FrankenPHP (PHP, Caddy, Go...) or using FrankenPHP (Laravel Octane, PHP Runtime...) should be reported to the relevant projects.

View File

@@ -46,7 +46,7 @@ EXPOSE 2019
LABEL org.opencontainers.image.title=FrankenPHP
LABEL org.opencontainers.image.description="The modern PHP app server"
LABEL org.opencontainers.image.url=https://frankenphp.dev
LABEL org.opencontainers.image.source=https://github.com/dunglas/frankenphp
LABEL org.opencontainers.image.source=https://github.com/php/frankenphp
LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.vendor="Kévin Dunglas"

View File

@@ -41,7 +41,7 @@ will be changed to the HTTPS port and the server will use HTTPS. If using
a public domain, ensure A/AAAA records are properly configured before
using this option.
For more advanced use cases, see https://github.com/dunglas/frankenphp/blob/main/docs/config.md`,
For more advanced use cases, see https://github.com/php/frankenphp/blob/main/docs/config.md`,
CobraFunc: func(cmd *cobra.Command) {
cmd.Flags().StringP("domain", "d", "", "Domain name at which to serve the files")
cmd.Flags().StringP("root", "r", "", "The path to the root of the site")

View File

@@ -17,7 +17,7 @@ docker run --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -p 8080:8080 -
- 附加配置文件: `/etc/frankenphp/php.d/*.ini`
- php 扩展: `/usr/lib/frankenphp/modules/`
如果的 docker 版本低于 23.0,则会因为 dockerignore [pattern issue](https://github.com/moby/moby/pull/42676) 而导致构建失败。将目录添加到 `.dockerignore`
如果的 docker 版本低于 23.0,则会因为 dockerignore [pattern issue](https://github.com/moby/moby/pull/42676) 而导致构建失败。将目录添加到 `.dockerignore`
```patch
!testdata/*.php

View File

@@ -4,22 +4,49 @@
FrankenPHP 是建立在 [Caddy](https://caddyserver.com/) Web 服务器之上的现代 PHP 应用程序服务器。
FrankenPHP 凭借其令人惊叹的功能为的 PHP 应用程序提供了超能力:[早期提示](early-hints.md)、[worker 模式](worker.md)、[实时功能](mercure.md)、自动 HTTPS、HTTP/2 和 HTTP/3 支持......
FrankenPHP 凭借其令人惊叹的功能为的 PHP 应用程序提供了超能力:[早期提示](early-hints.md)、[worker 模式](worker.md)、[实时功能](mercure.md)、自动 HTTPS、HTTP/2 和 HTTP/3 支持......
FrankenPHP 可与任何 PHP 应用程序一起使用,并且由于提供了与 worker 模式的集成,使的 Symfony 和 Laravel 项目比以往任何时候都更快。
FrankenPHP 可与任何 PHP 应用程序一起使用,并且由于提供了与 worker 模式的集成,使的 Symfony 和 Laravel 项目比以往任何时候都更快。
FrankenPHP 也可以用作独立的 Go 库,将 PHP 嵌入到任何使用 net/http 的应用程序中。
[**了解更多** *frankenphp.dev*](https://frankenphp.dev/cn) 以及在以下地址中
[**了解更多** _frankenphp.dev_](https://frankenphp.dev/cn/) 以及查看此演示文稿
<a href="https://dunglas.dev/2022/10/frankenphp-the-modern-php-app-server-written-in-go/"><img src="https://dunglas.dev/wp-content/uploads/2022/10/frankenphp.png" alt="Slides" width="600"></a>
## 开始
### Docker
### 独立二进制
我们为 Linux 和 macOS 提供包含 [PHP 8.4](https://www.php.net/releases/8.4/zh.php) 以及大多数常用 PHP 扩展的 FrankenPHP 静态二进制文件。
在 Windows 上,请使用 [WSL](https://learn.microsoft.com/windows/wsl/) 运行 FrankenPHP。
你可以 [下载 FrankenPHP](https://github.com/dunglas/frankenphp/releases),或将以下命令复制到终端中,自动安装适用于你平台的版本:
```console
docker run -v $PWD:/app/public \
curl https://frankenphp.dev/install.sh | sh
mv frankenphp /usr/local/bin/
```
要提供当前目录的内容,请运行:
```console
frankenphp php-server
```
你还可以使用以下命令运行命令行脚本:
```console
frankenphp php-cli /path/to/your/script.php
```
### Docker
此外,还可以使用 [Docker 镜像](https://frankenphp.dev/docs/docker/)
```console
docker run -v .:/app/public \
-p 80:80 -p 443:443 -p 443:443/udp \
dunglas/frankenphp
```
@@ -31,48 +58,47 @@ docker run -v $PWD:/app/public \
> 不要尝试使用 `https://127.0.0.1`。使用 `https://localhost` 并接受自签名证书。
> 使用 [`SERVER_NAME` 环境变量](config.md#环境变量) 更改要使用的域。
### 独立二进制
### Homebrew
如果您不想使用 Docker我们为 Linux 和 macOS 提供独立的 FrankenPHP 二进制文件
,其中包含 [PHP 8.4](https://www.php.net/releases/8.4/en.php) 和最流行的 PHP 扩展:[下载 FrankenPHP](https://github.com/dunglas/frankenphp/releases)。
FrankenPHP 也作为 [Homebrew](https://brew.sh) 软件包提供,适用于 macOS 和 Linux 系统。
若要启动当前目录的内容,请运行
安装方法
```console
./frankenphp php-server
brew install dunglas/frankenphp/frankenphp
```
您还可以使用以下命令运行命令行脚本
要提供当前目录的内容,请运行
```console
./frankenphp php-cli /path/to/your/script.php
frankenphp php-server
```
## 文档
* [worker 模式](worker.md)
* [早期提示支持(103 HTTP status code)](early-hints.md)
* [实时功能](mercure.md)
* [配置](config.md)
* [Docker 镜像](docker.md)
* [在生产环境中部署](production.md)
* [创建独立、可自行执行的 PHP 应用程序](embed.md)
* [创建静态二进制文件](static.md)
* [从源代码编译](compile.md)
* [Laravel 集成](laravel.md)
* [已知问题](known-issues.md)
* [演示应用程序 (Symfony) 和性能测试](https://github.com/dunglas/frankenphp-demo)
* [Go 库文档](https://pkg.go.dev/github.com/dunglas/frankenphp)
* [贡献和调试](https://frankenphp.dev/docs/contributing/)
- [worker 模式](worker.md)
- [早期提示支持(103 HTTP status code)](early-hints.md)
- [实时功能](mercure.md)
- [配置](config.md)
- [Docker 镜像](docker.md)
- [在生产环境中部署](production.md)
- [创建独立、可自行执行的 PHP 应用程序](embed.md)
- [创建静态二进制文件](static.md)
- [从源代码编译](compile.md)
- [Laravel 集成](laravel.md)
- [已知问题](known-issues.md)
- [演示应用程序 (Symfony) 和性能测试](https://github.com/dunglas/frankenphp-demo)
- [Go 库文档](https://pkg.go.dev/github.com/dunglas/frankenphp)
- [贡献和调试](https://frankenphp.dev/docs/contributing/)
## 示例和框架
* [Symfony](https://github.com/dunglas/symfony-docker)
* [API Platform](https://api-platform.com/docs/distribution/)
* [Laravel](laravel.md)
* [Sulu](https://sulu.io/blog/running-sulu-with-frankenphp)
* [WordPress](https://github.com/StephenMiracle/frankenwp)
* [Drupal](https://github.com/dunglas/frankenphp-drupal)
* [Joomla](https://github.com/alexandreelise/frankenphp-joomla)
* [TYPO3](https://github.com/ochorocho/franken-typo3)
* [Magento2](https://github.com/ekino/frankenphp-magento2)
- [Symfony](https://github.com/dunglas/symfony-docker)
- [API Platform](https://api-platform.com/docs/distribution/)
- [Laravel](laravel.md)
- [Sulu](https://sulu.io/blog/running-sulu-with-frankenphp)
- [WordPress](https://github.com/StephenMiracle/frankenwp)
- [Drupal](https://github.com/dunglas/frankenphp-drupal)
- [Joomla](https://github.com/alexandreelise/frankenphp-joomla)
- [TYPO3](https://github.com/ochorocho/franken-typo3)
- [Magento2](https://github.com/ekino/frankenphp-magento2)

View File

@@ -16,7 +16,7 @@ tar xf php-*
cd php-*/
```
然后,为的平台配置 PHP.
然后,为的平台配置 PHP.
这些参数是必需的,但你也可以添加其他编译参数(例如额外的扩展)。
@@ -63,10 +63,10 @@ sudo make install
## 编译 Go 应用
现在可以使用 Go 库并编译我们的 Caddy 构建:
现在可以使用 Go 库并编译我们的 Caddy 构建:
```console
curl -L https://github.com/dunglas/frankenphp/archive/refs/heads/main.tar.gz | tar xz
curl -L https://github.com/php/frankenphp/archive/refs/heads/main.tar.gz | tar xz
cd frankenphp-main/caddy/frankenphp
CGO_CFLAGS=$(php-config --includes) CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" go build
```
@@ -90,9 +90,9 @@ xcaddy build \
> [!TIP]
>
> 如果你的系统基于 musl libcAlpine Linux 上默认使用)并搭配 Symfony 使用,
> 可能需要增加默认堆栈大小。
> 否则,可能会收到如下错误 `PHP Fatal error: Maximum call stack size of 83360 bytes reached during compilation. Try splitting expression`
> 可能需要增加默认堆栈大小。
> 否则,可能会收到如下错误 `PHP Fatal error: Maximum call stack size of 83360 bytes reached during compilation. Try splitting expression`
>
> 请将 `XCADDY_GO_BUILD_FLAGS` 环境变量更改为如下类似的值
> `XCADDY_GO_BUILD_FLAGS=$'-ldflags "-w -s -extldflags \'-Wl,-z,stack-size=0x80000\'"'`
> (根据的应用需求更改堆栈大小)。
> (根据的应用需求更改堆栈大小)。

View File

@@ -12,7 +12,7 @@ Docker:
- php.ini: `/usr/local/etc/php/php.ini` 默认情况下不提供 php.ini。
- 附加配置文件: `/usr/local/etc/php/conf.d/*.ini`
- php 扩展: `/usr/local/lib/php/extensions/no-debug-zts-<YYYYMMDD>/`
- 应该复制 PHP 项目提供的官方模板:
- 应该复制 PHP 项目提供的官方模板:
```dockerfile
FROM dunglas/frankenphp
@@ -39,7 +39,7 @@ FrankenPHP 安装 (.rpm 或 .deb):
## Caddyfile 配置
可以在站点块中使用 `php_server``php` [HTTP 指令](https://caddyserver.com/docs/caddyfile/concepts#directives) 来为的 PHP 应用程序提供服务。
可以在站点块中使用 `php_server``php` [HTTP 指令](https://caddyserver.com/docs/caddyfile/concepts#directives) 来为的 PHP 应用程序提供服务。
最小示例:
@@ -52,7 +52,7 @@ localhost {
}
```
也可以使用全局选项显式配置 FrankenPHP
也可以使用全局选项显式配置 FrankenPHP
`frankenphp` [全局选项](https://caddyserver.com/docs/caddyfile/concepts#global-options) 可用于配置 FrankenPHP。
```caddyfile
@@ -70,7 +70,7 @@ localhost {
# ...
```
或者,可以使用 `worker` 选项的一行缩写形式:
或者,可以使用 `worker` 选项的一行缩写形式:
```caddyfile
{

View File

@@ -77,7 +77,7 @@ FrankenPHP 提供的 `builder` 镜像包含 libphp 的编译版本。
> [!TIP]
>
> 如果你的系统基于 musl libcAlpine Linux 上默认使用)并搭配 Symfony 使用,
> 可能需要 [增加默认堆栈大小](compile.md#使用-xcaddy)。
> 可能需要 [增加默认堆栈大小](compile.md#使用-xcaddy)。
## 默认启用 worker 模式

View File

@@ -10,14 +10,14 @@ FrankenPHP 能够将 PHP 应用程序的源代码和资源文件嵌入到静态
在创建独立二进制文件之前,请确保应用已准备好进行打包。
例如,可能希望:
例如,可能希望:
* 给应用安装生产环境的依赖
* 导出 autoloader
* 如果可能,为应用启用生产模式
* 丢弃不需要的文件,例如 `.git` 或测试文件,以减小最终二进制文件的大小
例如,对于 Symfony 应用程序,可以使用以下命令:
例如,对于 Symfony 应用程序,可以使用以下命令:
```console
# 导出项目以避免 .git/ 等目录
@@ -80,10 +80,10 @@ composer dump-env prod
## 为其他操作系统创建二进制文件
如果不想使用 Docker或者想要构建 macOS 二进制文件,你可以使用我们提供的 shell 脚本:
如果不想使用 Docker或者想要构建 macOS 二进制文件,你可以使用我们提供的 shell 脚本:
```console
git clone https://github.com/dunglas/frankenphp
git clone https://github.com/php/frankenphp
cd frankenphp
EMBED=/path/to/your/app \
PHP_EXTENSIONS=ctype,iconv,pdo_sqlite \
@@ -94,7 +94,7 @@ EMBED=/path/to/your/app \
## 使用二进制文件
就是这样!`my-app` 文件(或其他操作系统上的 `dist/frankenphp-<os>-<arch>`)包含的独立应用程序!
就是这样!`my-app` 文件(或其他操作系统上的 `dist/frankenphp-<os>-<arch>`)包含的独立应用程序!
若要启动 Web 应用,请执行:
@@ -102,7 +102,7 @@ EMBED=/path/to/your/app \
./my-app php-server
```
如果的应用包含 [worker 脚本](worker.md),请使用如下命令启动 worker
如果的应用包含 [worker 脚本](worker.md),请使用如下命令启动 worker
```console
./my-app php-server --worker public/index.php
@@ -114,7 +114,7 @@ EMBED=/path/to/your/app \
./my-app php-server --domain localhost
```
还可以运行二进制文件中嵌入的 PHP CLI 脚本:
还可以运行二进制文件中嵌入的 PHP CLI 脚本:
```console
./my-app php-cli bin/console

View File

@@ -1,7 +1,7 @@
# 使用 GitHub Actions
此存储库构建 Docker 镜像并将其部署到 [Docker Hub](https://hub.docker.com/r/dunglas/frankenphp) 上
每个批准的拉取请求或设置后在自己的分支上。
每个批准的拉取请求或设置后在自己的分支上。
## 设置 GitHub Actions

View File

@@ -25,7 +25,7 @@
如果确实想使用 `127.0.0.1` 作为主机,可以通过将服务器名称设置为 `127.0.0.1` 来配置它以为其生成证书。
如果你使用 Docker因为 [Docker 网络](https://docs.docker.com/network/) 问题,只做这些是不够的。
将收到类似于以下内容的 TLS 错误 `curl: (35) LibreSSL/3.3.6: error:1404B438:SSL routines:ST_CONNECT:tlsv1 alert internal error`
将收到类似于以下内容的 TLS 错误 `curl: (35) LibreSSL/3.3.6: error:1404B438:SSL routines:ST_CONNECT:tlsv1 alert internal error`
如果你使用的是 Linux解决方案是使用 [使用宿主机网络](https://docs.docker.com/network/network-tutorial-host/)
@@ -37,7 +37,7 @@ docker run \
dunglas/frankenphp
```
Mac 和 Windows 不支持 Docker 使用宿主机网络。在这些平台上,必须猜测容器的 IP 地址并将其包含在服务器名称中。
Mac 和 Windows 不支持 Docker 使用宿主机网络。在这些平台上,必须猜测容器的 IP 地址并将其包含在服务器名称中。
运行 `docker network inspect bridge` 并查看 `Containers`,找到 `IPv4Address` 当前分配的最后一个 IP 地址,并增加 1。如果没有容器正在运行则第一个分配的 IP 地址通常为 `172.17.0.2`
@@ -55,7 +55,7 @@ docker run \
>
> 请务必将 `172.17.0.3` 替换为将分配给容器的 IP。
现在应该能够从主机访问 `https://127.0.0.1`
现在应该能够从主机访问 `https://127.0.0.1`
如果不是这种情况,请在调试模式下启动 FrankenPHP 以尝试找出问题:

View File

@@ -16,7 +16,7 @@ docker run -p 80:80 -p 443:443 -p 443:443/udp -v $PWD:/app dunglas/frankenphp
或者,你可以从本地机器上使用 FrankenPHP 运行 Laravel 项目:
1. [下载与的系统相对应的二进制文件](https://github.com/dunglas/frankenphp/releases)
1. [下载与的系统相对应的二进制文件](https://github.com/php/frankenphp/releases)
2. 将以下配置添加到 Laravel 项目根目录中名为 `Caddyfile` 的文件中:
```caddyfile
@@ -45,7 +45,7 @@ Octane 可以通过 Composer 包管理器安装:
composer require laravel/octane
```
安装 Octane 后,可以执行 `octane:install` Artisan 命令,该命令会将 Octane 的配置文件安装到的应用程序中:
安装 Octane 后,可以执行 `octane:install` Artisan 命令,该命令会将 Octane 的配置文件安装到的应用程序中:
```console
php artisan octane:install --server=frankenphp

View File

@@ -9,4 +9,4 @@ Mercure 允许将事件实时推送到所有连接的设备:它们将立即收
要启用 Mercure Hub请按照 [Mercure 网站](https://mercure.rocks/docs/hub/config) 中的说明更新 `Caddyfile`
要从的代码中推送 Mercure 更新,我们推荐 [Symfony Mercure Component](https://symfony.com/components/Mercure)(不需要 Symfony 框架来使用)。
要从的代码中推送 Mercure 更新,我们推荐 [Symfony Mercure Component](https://symfony.com/components/Mercure)(不需要 Symfony 框架来使用)。

View File

@@ -2,9 +2,9 @@
在本教程中,我们将学习如何使用 Docker Compose 在单个服务器上部署 PHP 应用程序。
如果使用的是 Symfony请阅读 Symfony Docker 项目(使用 FrankenPHP的 [在生产环境中部署](https://github.com/dunglas/symfony-docker/blob/main/docs/production.md) 文档条目。
如果使用的是 Symfony请阅读 Symfony Docker 项目(使用 FrankenPHP的 [在生产环境中部署](https://github.com/dunglas/symfony-docker/blob/main/docs/production.md) 文档条目。
如果使用的是 API Platform同样使用 FrankenPHP请参阅 [框架的部署文档](https://api-platform.com/docs/deployment/)。
如果使用的是 API Platform同样使用 FrankenPHP请参阅 [框架的部署文档](https://api-platform.com/docs/deployment/)。
## 准备应用
@@ -13,7 +13,7 @@
```dockerfile
FROM dunglas/frankenphp
# 请将 "your-domain-name.example.com" 替换为的域名
# 请将 "your-domain-name.example.com" 替换为的域名
ENV SERVER_NAME=your-domain-name.example.com
# 如果要禁用 HTTPS请改用以下值
#ENV SERVER_NAME=:80
@@ -30,8 +30,8 @@ COPY . /app/public
有关更多详细信息和选项,请参阅 [构建自定义 Docker 镜像](docker.md)。
要了解如何自定义配置,请安装 PHP 扩展和 Caddy 模块。
如果的项目使用 Composer
请务必将其包含在 Docker 镜像中并安装的依赖。
如果的项目使用 Composer
请务必将其包含在 Docker 镜像中并安装的依赖。
然后,添加一个 `compose.yaml` 文件:
@@ -63,25 +63,25 @@ volumes:
> (使用 FrankenPHP作为使用多阶段镜像的更高级示例
> Composer、额外的 PHP 扩展等。
最后,如果使用 Git请提交这些文件并推送。
最后,如果使用 Git请提交这些文件并推送。
## 准备服务器
若要在生产环境中部署应用程序,需要一台服务器。
在本教程中,我们将使用 DigitalOcean 提供的虚拟机,但任何 Linux 服务器都可以工作。
如果已经有安装了 Docker 的 Linux 服务器,可以直接跳到 [下一节](#配置域名)。
如果已经有安装了 Docker 的 Linux 服务器,可以直接跳到 [下一节](#配置域名)。
否则,请使用 [此会员链接](https://m.do.co/c/5d8aabe3ab80) 获得 200 美元的免费信用额度创建一个帐户然后单击“Create a Droplet”。
然后单击“Choose an image”部分下的“Marketplace”选项卡然后搜索名为“Docker”的应用程序。
这将配置已安装最新版本的 Docker 和 Docker Compose 的 Ubuntu 服务器!
出于测试目的,最便宜的就足够了。
对于实际的生产用途,可能需要在“general purpose”部分中选择一个计划来满足的需求。
对于实际的生产用途,可能需要在“general purpose”部分中选择一个计划来满足的需求。
![使用 Docker 在 DigitalOcean 上部署 FrankenPHP](../digitalocean-droplet.png)
可以保留其他设置的默认值,也可以根据需要进行调整。
不要忘记添加的 SSH 密钥或创建密码,然后点击“完成并创建”按钮。
可以保留其他设置的默认值,也可以根据需要进行调整。
不要忘记添加的 SSH 密钥或创建密码,然后点击“完成并创建”按钮。
然后,在 Droplet 预配时等待几秒钟。
Droplet 准备就绪后,使用 SSH 进行连接:
@@ -92,10 +92,10 @@ ssh root@<droplet-ip>
## 配置域名
在大多数情况下,需要将域名与的网站相关联。
如果还没有域名,则必须通过注册商购买。
在大多数情况下,需要将域名与的网站相关联。
如果还没有域名,则必须通过注册商购买。
然后为的域名创建类型为 `A` 的 DNS 记录,指向服务器的 IP 地址:
然后为的域名创建类型为 `A` 的 DNS 记录,指向服务器的 IP 地址:
```dns
your-domain-name.example.com. IN A 207.154.233.113
@@ -111,7 +111,7 @@ DigitalOcean 域服务示例“Networking” > “Domains”
## 部署
使用 `git clone``scp` 或任何其他可能适合需要的工具在服务器上复制的项目。
使用 `git clone``scp` 或任何其他可能适合需要的工具在服务器上复制的项目。
如果使用 GitHub则可能需要使用 [部署密钥](https://docs.github.com/en/free-pro-team@latest/developers/overview/managing-deploy-keys#deploy-keys)。
部署密钥也 [由 GitLab 支持](https://docs.gitlab.com/ee/user/project/deploy_keys/)。
@@ -127,7 +127,7 @@ git clone git@github.com:<username>/<project-name>.git
docker compose up -d --wait
```
的服务器已启动并运行,并且已自动为生成 HTTPS 证书。
的服务器已启动并运行,并且已自动为生成 HTTPS 证书。
`https://your-domain-name.example.com` 享受吧!
> [!CAUTION]

View File

@@ -18,7 +18,7 @@ docker cp $(docker create --name static-builder-musl dunglas/frankenphp:static-b
生成的静态二进制文件名为 `frankenphp`,可在当前目录中找到。
如果想在没有 Docker 的情况下构建静态二进制文件,请查看 macOS 说明,它也适用于 Linux。
如果想在没有 Docker 的情况下构建静态二进制文件,请查看 macOS 说明,它也适用于 Linux。
### 自定义扩展
@@ -77,7 +77,7 @@ GITHUB_TOKEN="xxx" docker --load buildx bake static-builder
运行以下脚本以创建适用于 macOS 的静态二进制文件(需要先安装 [Homebrew](https://brew.sh/)
```console
git clone https://github.com/dunglas/frankenphp
git clone https://github.com/php/frankenphp
cd frankenphp
./build-static.sh
```

View File

@@ -96,7 +96,7 @@ docker run \
```
默认情况下,每个 CPU 启动一个 worker。
还可以配置要启动的 worker 数:
还可以配置要启动的 worker 数:
```console
docker run \

View File

@@ -121,7 +121,7 @@ xcaddy build \
Alternatively, it's possible to compile FrankenPHP without `xcaddy` by using the `go` command directly:
```console
curl -L https://github.com/dunglas/frankenphp/archive/refs/heads/main.tar.gz | tar xz
curl -L https://github.com/php/frankenphp/archive/refs/heads/main.tar.gz | tar xz
cd frankenphp-main/caddy/frankenphp
CGO_CFLAGS=$(php-config --includes) CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" go build -tags=nobadger,nomysql,nopgx
```

View File

@@ -89,7 +89,7 @@ The resulting binary is the file named `my-app` in the current directory.
If you don't want to use Docker, or want to build a macOS binary, use the shell script we provide:
```console
git clone https://github.com/dunglas/frankenphp
git clone https://github.com/php/frankenphp
cd frankenphp
EMBED=/path/to/your/app ./build-static.sh
```

View File

@@ -23,7 +23,7 @@ contenant [PHP 8.4](https://www.php.net/releases/8.4/fr.php) et la plupart des e
Sous Windows, utilisez [WSL](https://learn.microsoft.com/windows/wsl/) pour exécuter FrankenPHP.
[Téléchargez FrankenPHP](https://github.com/dunglas/frankenphp/releases) ou copiez cette ligne dans votre terminal pour installer automatiquement la version appropriée à votre plateforme :
[Téléchargez FrankenPHP](https://github.com/php/frankenphp/releases) ou copiez cette ligne dans votre terminal pour installer automatiquement la version appropriée à votre plateforme :
```console
curl https://frankenphp.dev/install.sh | sh

View File

@@ -122,7 +122,7 @@ xcaddy build \
Il est également possible de compiler FrankenPHP sans `xcaddy` en utilisant directement la commande `go` :
```console
curl -L https://github.com/dunglas/frankenphp/archive/refs/heads/main.tar.gz | tar xz
curl -L https://github.com/php/frankenphp/archive/refs/heads/main.tar.gz | tar xz
cd frankenphp-main/caddy/frankenphp
CGO_CFLAGS=$(php-config --includes) CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" go build -tags=nobadger,nomysql,nopgx
```

View File

@@ -91,7 +91,7 @@ Le binaire généré sera nommé `my-app` dans le répertoire courant.
Si vous ne souhaitez pas utiliser Docker, ou souhaitez construire un binaire macOS, utilisez le script shell que nous fournissons :
```console
git clone https://github.com/dunglas/frankenphp
git clone https://github.com/php/frankenphp
cd frankenphp
EMBED=/path/to/your/app ./build-static.sh
```

View File

@@ -78,7 +78,7 @@ docker run \
## Scripts Composer Faisant Références à `@php`
Les [scripts Composer](https://getcomposer.org/doc/articles/scripts.md) peuvent vouloir exécuter un binaire PHP pour certaines tâches, par exemple dans [un projet Laravel](laravel.md) pour exécuter `@php artisan package:discover --ansi`. Cela [echoue actuellement](https://github.com/dunglas/frankenphp/issues/483#issuecomment-1899890915) pour deux raisons :
Les [scripts Composer](https://getcomposer.org/doc/articles/scripts.md) peuvent vouloir exécuter un binaire PHP pour certaines tâches, par exemple dans [un projet Laravel](laravel.md) pour exécuter `@php artisan package:discover --ansi`. Cela [echoue actuellement](https://github.com/php/frankenphp/issues/483#issuecomment-1899890915) pour deux raisons :
- Composer ne sait pas comment appeler le binaire FrankenPHP ;
- Composer peut ajouter des paramètres PHP en utilisant le paramètre `-d` dans la commande, ce que FrankenPHP ne supporte pas encore.

View File

@@ -105,7 +105,7 @@ GITHUB_TOKEN="xxx" docker --load buildx bake static-builder-musl
Exécutez le script suivant pour créer un binaire statique pour macOS (vous devez avoir [Homebrew](https://brew.sh/) d'installé) :
```console
git clone https://github.com/dunglas/frankenphp
git clone https://github.com/php/frankenphp
cd frankenphp
./build-static.sh
```

View File

@@ -78,7 +78,7 @@ docker run \
## Composer Scripts Referencing `@php`
[Composer scripts](https://getcomposer.org/doc/articles/scripts.md) may want to execute a PHP binary for some tasks, e.g. in [a Laravel project](laravel.md) to run `@php artisan package:discover --ansi`. This [currently fails](https://github.com/dunglas/frankenphp/issues/483#issuecomment-1899890915) for two reasons:
[Composer scripts](https://getcomposer.org/doc/articles/scripts.md) may want to execute a PHP binary for some tasks, e.g. in [a Laravel project](laravel.md) to run `@php artisan package:discover --ansi`. This [currently fails](https://github.com/php/frankenphp/issues/483#issuecomment-1899890915) for two reasons:
- Composer does not know how to call the FrankenPHP binary;
- Composer may add PHP settings using the `-d` flag in the command, which FrankenPHP does not yet support.

View File

@@ -43,7 +43,7 @@ Also, [some bugs only happen when using musl](https://github.com/php/php-src/iss
In production environments, we recommend using FrankenPHP linked against glibc.
This can be achieved by using the Debian Docker images (the default), downloading the -gnu suffix binary from our [Releases](https://github.com/dunglas/frankenphp/releases), or by [compiling FrankenPHP from sources](compile.md).
This can be achieved by using the Debian Docker images (the default), downloading the -gnu suffix binary from our [Releases](https://github.com/php/frankenphp/releases), or by [compiling FrankenPHP from sources](compile.md).
Alternatively, we provide static musl binaries compiled with [the mimalloc allocator](https://github.com/microsoft/mimalloc), which alleviates the problems in threaded scenarios.

View File

@@ -37,7 +37,7 @@ docker run -v .:/app/public \
Для Windows используйте [WSL](https://learn.microsoft.com/windows/wsl/) для запуска FrankenPHP.
[Скачать FrankenPHP](https://github.com/dunglas/frankenphp/releases) или выполните следующую команду для автоматической установки подходящей версии:
[Скачать FrankenPHP](https://github.com/php/frankenphp/releases) или выполните следующую команду для автоматической установки подходящей версии:
```console
curl https://frankenphp.dev/install.sh | sh

View File

@@ -76,7 +76,7 @@ sudo make install
Теперь можно собрать итоговый бинарный файл:
```console
curl -L https://github.com/dunglas/frankenphp/archive/refs/heads/main.tar.gz | tar xz
curl -L https://github.com/php/frankenphp/archive/refs/heads/main.tar.gz | tar xz
cd frankenphp-main/caddy/frankenphp
CGO_CFLAGS=$(php-config --includes) CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" go build -tags=nobadger,nomysql,nopgx
```

View File

@@ -87,7 +87,7 @@ composer dump-env prod
Если вы не хотите использовать Docker или хотите собрать бинарный файл для macOS, используйте предоставленный скрипт:
```console
git clone https://github.com/dunglas/frankenphp
git clone https://github.com/php/frankenphp
cd frankenphp
EMBED=/path/to/your/app ./build-static.sh
```

View File

@@ -77,7 +77,7 @@ docker run \
## Скрипты Composer с использованием `@php`
[Скрипты Composer](https://getcomposer.org/doc/articles/scripts.md) могут вызывать PHP для выполнения задач, например, в [проекте Laravel](laravel.md) для команды `@php artisan package:discover --ansi`.
Это [на данный момент не поддерживается](https://github.com/dunglas/frankenphp/issues/483#issuecomment-1899890915) по двум причинам:
Это [на данный момент не поддерживается](https://github.com/php/frankenphp/issues/483#issuecomment-1899890915) по двум причинам:
- Composer не знает, как вызывать бинарный файл FrankenPHP;
- Composer может добавлять настройки PHP через флаг `-d`, который FrankenPHP пока не поддерживает.

View File

@@ -76,7 +76,7 @@ GITHUB_TOKEN="xxx" docker --load buildx bake static-builder
Запустите следующий скрипт, чтобы создать статический бинарный файл для macOS (должен быть установлен [Homebrew](https://brew.sh/)):
```console
git clone https://github.com/dunglas/frankenphp
git clone https://github.com/php/frankenphp
cd frankenphp
./build-static.sh
```

View File

@@ -105,7 +105,7 @@ GITHUB_TOKEN="xxx" docker --load buildx bake static-builder-musl
Run the following script to create a static binary for macOS (you must have [Homebrew](https://brew.sh/) installed):
```console
git clone https://github.com/dunglas/frankenphp
git clone https://github.com/php/frankenphp
cd frankenphp
./build-static.sh
```

View File

@@ -34,18 +34,18 @@ docker run -v $PWD:/app/public \
### Binary Çıktısı
Docker kullanmayı tercih etmiyorsanız, Linux ve macOS için bağımsız FrankenPHP binary dosyası sağlıyoruz
[PHP 8.4](https://www.php.net/releases/8.4/en.php) ve en popüler PHP eklentilerini de içermekte: [FrankenPHP](https://github.com/dunglas/frankenphp/releases) indirin
[PHP 8.4](https://www.php.net/releases/8.4/en.php) ve en popüler PHP eklentilerini de içermekte: [FrankenPHP](https://github.com/php/frankenphp/releases) indirin
Geçerli dizinin içeriğini başlatmak için çalıştırın:
```console
./frankenphp php-server
frankenphp php-server
```
Ayrıca aşağıdaki tek komut satırı ile de çalıştırabilirsiniz:
```console
./frankenphp php-cli /path/to/your/script.php
frankenphp php-cli /path/to/your/script.php
```
## Docs

View File

@@ -68,7 +68,7 @@ sudo make install
Artık Go kütüphanesini kullanabilir ve Caddy yapımızı derleyebilirsiniz:
```console
curl -L https://github.com/dunglas/frankenphp/archive/refs/heads/main.tar.gz | tar xz
curl -L https://github.com/php/frankenphp/archive/refs/heads/main.tar.gz | tar xz
cd frankenphp-main/caddy/frankenphp
CGO_CFLAGS=$(php-config --includes) CGO_LDFLAGS="$(php-config --ldflags) $(php-config --libs)" go build
```

View File

@@ -83,7 +83,7 @@ Elde edilen binary dosyası, geçerli dizindeki `my-app` adlı dosyadır.
Docker kullanmak istemiyorsanız veya bir macOS binary dosyası oluşturmak istiyorsanız, sağladığımız kabuk betiğini kullanın:
```console
git clone https://github.com/dunglas/frankenphp
git clone https://github.com/php/frankenphp
cd frankenphp
EMBED=/path/to/your/app \
PHP_EXTENSIONS=ctype,iconv,pdo_sqlite \

View File

@@ -76,7 +76,7 @@ docker run \
## `@php` Referanslı Composer Betikler
[Composer betikleri](https://getcomposer.org/doc/articles/scripts.md) bazı görevler için bir PHP binary çalıştırmak isteyebilir, örneğin [bir Laravel projesinde](laravel.md) `@php artisan package:discover --ansi` çalıştırmak. Bu [şu anda mümkün değil](https://github.com/dunglas/frankenphp/issues/483#issuecomment-1899890915) ve 2 nedeni var:
[Composer betikleri](https://getcomposer.org/doc/articles/scripts.md) bazı görevler için bir PHP binary çalıştırmak isteyebilir, örneğin [bir Laravel projesinde](laravel.md) `@php artisan package:discover --ansi` çalıştırmak. Bu [şu anda mümkün değil](https://github.com/php/frankenphp/issues/483#issuecomment-1899890915) ve 2 nedeni var:
- Composer FrankenPHP binary dosyasını nasıl çağıracağını bilmiyor;
- Composer, FrankenPHP'nin henüz desteklemediği `-d` bayrağını kullanarak PHP ayarlarını komuta ekleyebilir.

View File

@@ -16,7 +16,7 @@ And tadını çıkarın!
Alternatif olarak, Laravel projelerinizi FrankenPHP ile yerel makinenizden çalıştırabilirsiniz:
1. [Sisteminize karşılık gelen binary dosyayı indirin](https://github.com/dunglas/frankenphp/releases)
1. [Sisteminize karşılık gelen binary dosyayı indirin](https://github.com/php/frankenphp/releases)
2. Aşağıdaki yapılandırmayı Laravel projenizin kök dizinindeki `Caddyfile` adlı bir dosyaya ekleyin:
```caddyfile

View File

@@ -77,7 +77,7 @@ GITHUB_TOKEN="xxx" docker --load buildx bake static-builder
macOS için statik bir binary oluşturmak için aşağıdaki betiği çalıştırın ([Homebrew](https://brew.sh/) yüklü olmalıdır):
```console
git clone https://github.com/dunglas/frankenphp
git clone https://github.com/php/frankenphp
cd frankenphp
./build-static.sh
```

View File

@@ -157,7 +157,7 @@ func calculateMaxThreads(opt *opt) (int, int, int, error) {
var numWorkers int
for i, w := range opt.workers {
if w.num <= 0 {
// https://github.com/dunglas/frankenphp/issues/126
// https://github.com/php/frankenphp/issues/126
opt.workers[i].num = maxProcs
}
metrics.TotalWorkers(w.name, w.num)
@@ -222,7 +222,7 @@ func Init(options ...Option) error {
}
isRunning = true
// Ignore all SIGPIPE signals to prevent weird issues with systemd: https://github.com/dunglas/frankenphp/issues/1020
// Ignore all SIGPIPE signals to prevent weird issues with systemd: https://github.com/php/frankenphp/issues/1020
// Docker/Moby has a similar hack: https://github.com/moby/moby/blob/d828b032a87606ae34267e349bf7f7ccb1f6495a/cmd/dockerd/docker.go#L87-L90
signal.Ignore(syscall.SIGPIPE)

View File

@@ -734,7 +734,7 @@ func TestEnvIsNotResetInWorkerMode(t *testing.T) {
}, &testOptions{workerScript: "env/remember-env.php"})
}
// reproduction of https://github.com/dunglas/frankenphp/issues/1061
// reproduction of https://github.com/php/frankenphp/issues/1061
func TestModificationsToEnvPersistAcrossRequests(t *testing.T) {
runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) {
for j := 0; j < 3; j++ {

View File

@@ -76,9 +76,9 @@ if [ $? -eq 1 ]; then
fi
if type "curl" >/dev/null 2>&1; then
curl -L --progress-bar "https://github.com/dunglas/frankenphp/releases/latest/download/${THE_ARCH_BIN}" -o "${DEST}"
curl -L --progress-bar "https://github.com/php/frankenphp/releases/latest/download/${THE_ARCH_BIN}" -o "${DEST}"
elif type "wget" >/dev/null 2>&1; then
${SUDO} wget "https://github.com/dunglas/frankenphp/releases/latest/download/${THE_ARCH_BIN}" -O "${DEST}"
${SUDO} wget "https://github.com/php/frankenphp/releases/latest/download/${THE_ARCH_BIN}" -O "${DEST}"
else
echo "❗ Please install ${italic}curl${normal} or ${italic}wget${normal} to download FrankenPHP"
exit 1
@@ -91,4 +91,4 @@ echo "🥳 FrankenPHP downloaded successfully to ${italic}${DEST}${normal}"
echo "🔧 Move the binary to ${italic}/usr/local/bin/${normal} or another directory in your ${italic}PATH${normal} to use it globally:"
echo " ${bold}sudo mv ${DEST} /usr/local/bin/${normal}"
echo
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/dunglas/frankenphp${normal}"
echo "⭐ If you like FrankenPHP, please give it a star on GitHub: ${italic}https://github.com/php/frankenphp${normal}"

View File

@@ -178,7 +178,7 @@ func handleWatcherEvent(watchPattern *watchPattern, path string, associatedPath
// some editors create temporary files and never actually modify the original file
// so we need to also check the associated path of an event
// see https://github.com/dunglas/frankenphp/issues/1375
// see https://github.com/php/frankenphp/issues/1375
if associatedPath != "" && watchPattern.allowReload(associatedPath, eventType, pathType) {
watchPattern.trigger <- associatedPath
}

View File

@@ -31,7 +31,7 @@ ENV GOTOOLCHAIN=local
LABEL org.opencontainers.image.title=FrankenPHP
LABEL org.opencontainers.image.description="The modern PHP app server"
LABEL org.opencontainers.image.url=https://frankenphp.dev
LABEL org.opencontainers.image.source=https://github.com/dunglas/frankenphp
LABEL org.opencontainers.image.source=https://github.com/php/frankenphp
LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.vendor="Kévin Dunglas"

View File

@@ -28,7 +28,7 @@ SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
LABEL org.opencontainers.image.title=FrankenPHP
LABEL org.opencontainers.image.description="The modern PHP app server"
LABEL org.opencontainers.image.url=https://frankenphp.dev
LABEL org.opencontainers.image.source=https://github.com/dunglas/frankenphp
LABEL org.opencontainers.image.source=https://github.com/php/frankenphp
LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.vendor="Kévin Dunglas"