# cd /usr/ports/lang/php84/ && make install clean# cd /usr/ports/lang/php84-extensions/ && make install clean# cd /usr/ports/www/mod_php84 && make install clean
# service php_fpm enable
php_fpm enabled in /etc/rc.conf
# service php_fpm start
Performing sanity check on php-fpm configuration:
[25-Feb-2025 20:28:32] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful
Starting php_fpm.
# service php_fpm status
php_fpm is running as pid 2592.
# pkg info -D mod_php84
mod_php84-8.4.4_1:
On install:
******************************************************************************
Consider switching to php-fpm and mod_fast_cgi as per Apache httpd project
recommendation. See https://cwiki.apache.org/confluence/display/HTTPD/PHP-FPM
建议根据 Apache httpd 项目的推荐,切换到 php-fpm 和 mod_fast_cgi。详情请见 https://cwiki.apache.org/confluence/display/HTTPD/PHP-FPM
******************************************************************************
If you are building PHP-based ports in poudriere(8) or Synth with ZTS enabled,
add WITH_MPM=event to /etc/make.conf to prevent build failures.
如果你在 poudriere(8) 或 Synth 中构建启用了 ZTS 的 PHP 基础端口,请将 WITH_MPM=event 添加到 /etc/make.conf,以防止构建失败。
******************************************************************************
Make sure index.php is part of your DirectoryIndex.
确保 index.php 是 DirectoryIndex 的一部分。
You should add the following to your Apache configuration file:
你应该将以下内容添加到你的 Apache 配置文件中:
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
******************************************************************************
# service php_fpm restart # 重启 PHP-FPM 服务以应用配置更改
Performing sanity check on php-fpm configuration:
[25-Feb-2025 20:59:12] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful
Starting php_fpm.
# service nginx restart # 重启 Nginx 服务以应用配置更改
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Stopping nginx.
Waiting for PIDS: 1153.
Performing sanity check on nginx configuration:
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
Starting nginx.