技术支持
Support
Server for PHP
支持 macOS 12 及以上版本(Apple Silicon)· 内置 PHP 8.5.x(PHP License v3.01)
Compatible with macOS 12 and later (Apple Silicon) · Bundled with PHP 8.5.x (PHP License v3.01)
感谢您使用 Server for PHP。本页面提供功能说明、常见问题解答以及联系方式。
功能介绍
- 启动 / 停止 / 重启 — 一键控制 PHP 内置服务器
- 端口自动避让 — 优先使用配置端口;被占用时自动获取系统随机空闲端口
- 仅本地访问 — 默认开启,仅允许本机访问;可关闭限制可供局域网设备访问
- 开机自启 — 登录系统时自动启动应用
- 一键复制访问地址 — 快速复制 http://127.0.0.1:port 地址
- 工作目录访问 — 一键打开 php.ini、php.pid 与日志目录
- Web Root 管理 — 一键在 Finder 中打开网页根目录
- Web Root 自定义选择 — 文件夹选择器自定义网页根目录,安全书签持久化
- 状态栏指示 — 图标透明度直观显示服务状态
常见问题
如何启动 PHP 服务?
点击菜单栏中的应用图标,选择 Start 即可启动 PHP 内置服务器。
端口被占用了怎么办?
应用会自动检测端口占用情况。如果默认端口 8000 被占用,会先尝试 8000,如果仍被占用则从 8001 开始顺延到下一个可用端口。
如何访问 PHP 服务?
服务运行时,在浏览器中打开 http://127.0.0.1:端口 即可访问;也可点击菜单中的 Port: XXXXX 复制该地址。
Local Access Only 是什么?默认状态?
默认关闭,服务监听 0.0.0.0,允许局域网内其他设备访问。开启后仅接受本机(127.0.0.1)的连接。
如何设置网页根目录(Web Root)?
点击 Select Web Root…,在文件夹选择器中选择你的 PHP 项目目录。选择后若服务正在运行会自动重启生效;若未运行则下次启动时生效。路径通过安全书签持久化,重启应用后无需重新选择。
Open Web Root 为什么是灰色的?
说明尚未设置网页根目录。请先通过 Select Web Root… 选择一个文件夹,之后 Open Web Root 即可在 Finder 中打开该目录。
切换设置时服务未运行会怎样?
切换 Local Access Only 或选择 Web Root 时,若服务未运行,不会自动启动服务,设置会在下一次服务启动时生效;若服务正在运行,则会自动重启以立即应用新设置。
如何查看日志?
点击菜单中的 Working Directory 打开工作目录,其中包含:logs/(日志)、php.ini(配置文件)、php.pid(进程 PID)。
如何卸载?
将应用拖入废纸篓即可。如需删除所有数据,请手动删除 ~/Library/Application Support/ServerForPHP/ 目录。
联系我们
开源许可证
Thank you for using Server for PHP. This page covers features, common questions, and how to reach us.
Features
- Start / Stop / Restart — One-click control of PHP's built-in server
- Port Auto‑Avoidance — Prefers the configured port; automatically allocates a random free port if occupied
- Local Access Only — Enabled by default, restricting to localhost; disable to allow LAN access
- Launch at Login — Auto-starts when you log in to your system
- Copy Access URL — Quickly copy the http://127.0.0.1:port URL
- Working Directory — Open php.ini, php.pid, and log folders in one click
- Web Root Management — Open the web root directory in Finder in one click
- Web Root Selection — Pick your web root via the folder picker, persisted with a Security-Scoped Bookmark
- Status Indicator — Icon opacity reflects running state
FAQ
How do I start the PHP server?
Click the app icon in the menu bar and choose Start to launch PHP's built-in server.
What if the port is taken?
The app auto-detects port usage. If 8000 is occupied, it tries 8000 first; if still taken, it falls back to 8001 and continues upward.
How do I access the PHP server?
While the service is running, open http://127.0.0.1:port in your browser. You can also click Port: XXXXX in the menu to copy the URL.
What does Local Access Only do, and what's the default?
It's enabled by default — only connections from localhost (127.0.0.1) are accepted. Disable it to allow LAN access.
How do I set the Web Root?
Click Select Web Root… and pick your PHP project folder. If the service is running, it restarts automatically; if not, the new root takes effect on the next start. The path is persisted via a Security-Scoped Bookmark, so you won't need to reselect it after restarting the app.
Why is Open Web Root grayed out?
It means no web root has been set yet. Use Select Web Root… to choose a folder first, then Open Web Root will open it in Finder.
What happens if I change settings while the service is not running?
Toggling Local Access Only or selecting a Web Root while the service is stopped will not start the service; the setting takes effect on the next start. If the service is running, it restarts automatically to apply the new setting immediately.
How do I view logs?
Click Working Directory in the menu. It contains: logs/ (logs), php.ini (config), and php.pid (process PID).
How do I uninstall?
Drag the app to the Trash. To remove all data, manually delete ~/Library/Application Support/ServerForPHP/.
Contact
Open Source License
This app bundles PHP 8.5.x, licensed under the PHP License v3.01. See php.net/license/3_01.txt.
This is not an official PHP product; it is a third-party management tool for PHP's built-in server.