问题描述
我安装了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版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!