PHP 8.1.31 Released!

在 Unix 系统上安装 PHP

目录

大多数 Unix(和 Linux)操作系统和发行版都通过其打包系统提供 PHP 和扩展的打包版本。其中有部分章节介绍了使用这些系统安装 PHP 的基本信息。

对于某些发行版,还有第三方软件包存储库,通常包含更多可用的版本和扩展。

PHP 还可以作为某些第三方应用服务器的组件进行安装。

最后,PHP 始终可以从源码中安装,这样可以最大程度地灵活选择要启用的功能、扩展和服务器 API。其中有部分章节介绍了编译和配置 PHP 以及与不同的服务器 API 配合使用的信息。

添加备注

用户贡献的备注 1 note

up
38
cj3 at clifjackson dot net
6 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.
To Top