在 Unix 系统上安装 PHP
目录
- Debian GNU/Linux 及其相关发行版上从软件包中安装 PHP
- Installing from packages on GNU/Linux distributions that use DNF
- OpenBSD 上从软件包或者 ports 中安装 PHP
- Installing from source on Unix and macOS systems
- CGI 和命令行设置
- Unix 系统下的 Apache 2.x
- Unix 系统下的 Nginx 1.4.x
- Unix 平台的 Lighttpd 1.4
- Unix 系统下的 LiteSpeed、OpenLiteSpeed Web 服务器
- 针对 Solaris 的安装提示
大多数 Unix(和 Linux)操作系统和发行版都通过其打包系统提供 PHP 和扩展的打包版本。其中有部分章节介绍了使用这些系统安装 PHP 的基本信息。
对于某些发行版,还有第三方软件包存储库,通常包含更多可用的版本和扩展。
PHP 还可以作为某些第三方应用服务器的组件进行安装。
最后,PHP 始终可以从源码中安装,这样可以最大程度地灵活选择要启用的功能、扩展和服务器 API。其中有部分章节介绍了编译和配置 PHP 以及与不同的服务器 API 配合使用的信息。
+添加备注
用户贡献的备注 1 note
cj3 at clifjackson dot net ¶
7 years ago
I recently ran in to a situation where I was building PHP 7.1.13 from source. Configuration & make went fine, however, when I ran make install it hung. It turns out that if you are building PHP with Apache (apxs) the make file calls apxs with the -a flag which tells it to modify the httpd.conf file. If, for whatever reason, the file is not writeable then it fails and you get the hang.
Line 108 in my Makefile looks like this:
INSTALL_IT = $(mkinstalldirs) '$(INSTALL_ROOT)/usr/lib64/httpd/modules' && $(mkinstalldirs) '$(INSTALL_ROOT)/etc/httpd/conf' && /usr/sbin/apxs -S LIBEXECDIR='$(INSTALL_ROOT)/usr/lib64/httpd/modules' -S SYSCONFDIR='$(INSTALL_ROOT)/etc/httpd/conf' -i -a -n php7 libphp7.la
I had to remove the -a flag and then it was fine.