告诉Apache使用通过phpbrew安装的特定PHP版本 [英] Tell Apache to use a specific PHP version installed using phpbrew

查看:129
本文介绍了告诉Apache使用通过phpbrew安装的特定PHP版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了PHP,MySQL和Apache堆栈以进行开发.该安装使用来自以下位置的配置文件:

I had the PHP, MySQL, and Apache stack installed for development. That installation is using configuration files from:

/etc/apache2/
/etc/php5/

后来,我使用phpbrew安装了多个PHP版本.所有版本均可从CLI访问和切换.但是Apache始终使用未使用 phpbrew 安装的默认版本.

Later I installed multiple PHP version using phpbrew. All versions are accessible and switchable from CLI. But Apache always stays on the default version that was not installed using phpbrew.

这是我已安装的PHP版本的列表.

Here is a list of my installed PHP versions.

$ phpbrew list
Installed versions:
  php-5.4.13       (/home/admin1/.phpbrew/php/php-5.4.13)
                   +default -- --with-bz2=/usr
  php-5.5.5        (/home/admin1/.phpbrew/php/php-5.5.5)

  php-5.3.27       (/home/admin1/.phpbrew/php/php-5.3.27)

我尝试更改配置文件路径,以便它们指向phpbrew的PHP.但是似乎没有任何效果.

I have tried changing configuration file paths so they point to phpbrew's PHP. But nothing seems to be working.

如何告诉Apache使用phpbrew的PHP版本?

How can I tell Apache to use phpbrew's PHP version?

推荐答案

您需要使用apxs2构建PHP:

You need to build a PHP with apxs2:

1).确保已安装sudo apt-get install apache2-dev.

2)运行phpbrew install 5.4.22 +apxs2=/usr/bin/apxs2

然后,您应该在Apache配置文件中看到构建的模块文件.

Then you should see the built module file in your Apache configuration file.

这篇关于告诉Apache使用通过phpbrew安装的特定PHP版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆