php - 在 Ubuntu 上安装 Apache 服务器 HTTPD

标签 php apache ubuntu

我正在尝试安装 Apache Server在我的 Ubuntu 上使用 PHP 制作的网页.
我下载了pcre , aprapr-util我配置、制作并安装了所有这些。

然后,当我回到 Apache 文件夹时,执行以下命令

sudo ./configure --prefix=/home/test/Apache/srclib/apr-util 
                 --with-apr=/home/test/Apache/srclib/apr 
                 --with-pcre=/home/test/Apache/pcre 
                 --with-included-apr

成功了。

甚至命令
sudo make 

成功了。但是,当我键入 sudo make install 时,出现以下错误:
Makefile:79: recipe for target 'install' failed
make[2]: *** [install] Error 1
make[2]: Leaving directory '/home/test/Apache/srclib/apr-util'
/home/test/Apache/build/rules.mk:75: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/home/test/Apache/srclib'
/home/test/Apache/build/rules.mk:75: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

拜托,你能给我任何提示吗?谢谢

最佳答案

也许 aprapr-util缺少 Apache 2.4.x 所需的版本?或者,也许您只需要 -dev包?

cd /usr/local/src/httpd-2.4.20/srclib
curl --remote-name http://archive.apache.org/dist/apr/apr-1.5.2.tar.gz
curl --remote-name http://archive.apache.org/dist/apr/apr-util-1.5.4.tar.gz
tar -xzvf apr-1.5.2.tar.gz
tar -xzvf apr-util-1.5.4.tar.gz
mkdir apr
mkdir apr-util
mv apr-1.5.2/ apr
mv apr-util-1.5.4/ apr-util
cd ..

然后编译
./configure --prefix=/usr/local/apache-2.4.20 --with-included-apr

好资源:http://httpd.apache.org/docs/current/install.html
以下是他们对 APR 和 APR-Util 的评价:

APR and APR-Util Make sure you have APR and APR-Util already installed on your system. If you don't, or prefer to not use the system-provided versions, download the latest versions of both APR and APR-Util from Apache APR, unpack them into /httpd_source_tree_root/srclib/apr and /httpd_source_tree_root/srclib/apr-util (be sure the directory names do not have version numbers; for example, the APR distribution must be under /httpd_source_tree_root/srclib/apr/) and use ./configure's --with-included-apr option. On some platforms, you may have to install the corresponding -dev packages to allow httpd to build against your installed copy of APR and APR-Util.

关于php - 在 Ubuntu 上安装 Apache 服务器 HTTPD,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46368140/

相关文章:

php - 使用Eloquent获取模型子类型的实例

php - 问题模拟 Laravel 可引导模型特征

php - 在 PHP 中返回 void 和 null 有区别吗?

php - 拒绝应用来自 ... 的样式,因为它的 MIME 类型 ('text/html' ) 不是受支持的样式表 MIME 类型,并且启用了严格的 MIME 检查

python - 如何在 vim 中启用 python3?

c++ - 自由人 : Unable to compile the Java API on Ubuntu

php - 拉维尔 5.8 : Trying to make a where model by using data pulled from database

php - 管理长时间运行的 php 脚本的最佳方法?

linux - Apache - 奇怪的首字节时间问题

linux - 系统错误 “failed to start service: unit service is not loaded properly: exec format error”