包括Apache的几个PHP版本

包括Apache的几个PHP版本

本文介绍了包括Apache的几个PHP版本,通过AddHandler的指令可切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是提供在同一服务器上的PHP的几个版本的共享虚拟主机:5.2,5.3和5.4。他们使人们有可能在这些版本之间通过命名的文件扩展名切换 .php54 分别 .php53 ,或通过的.htaccess指令:

A shared web host I'm using is offering several versions of PHP on the same server: 5.2, 5.3 and 5.4. They make it possible to switch between these versions by naming the file extensions .php54 and .php53 respectively, or via an .htaccess directive:

AddHandler php5.4-script .php

我一直没能完全弄清楚他们的Apache服务器的配置来支持这个虽然。一切我发现似乎在说,只有一个mod_php的可以同时被编译成Apache的。请问这表明, php5.4脚本是某种自定义包装模块?还是有其不同的PHP模块可以根据不同的处理程序名称编译晦涩的方式?

I have not been able to completely figure out how their Apache server is configured to support this though. Everything I found seemed to say that only one mod_php can be compiled into Apache at a time. Would this suggest that php5.4-script is some sort of custom wrapper module? Or are there obscure ways in which different PHP modules can be compiled under different handler names?

推荐答案

据的的资源,这是因为你已经想到 A(快速)CGI包装这允许改变通过如用过的PHP版本htaccess的。

According to the resource I've found after researching on this topic, it is as you already thought a (Fast) CGI wrapper which allows you to change the PHP version used via e.g. .htaccess .

如何实现这一目标是彻底了说明:的。

How to achieve this is explained thoroughly here: http://linuxplayer.org/2011/05/intall-multiple-version-of-php-on-one-server .

在情况下,该网站无法访问,在这里我要列出的步骤:

In case the site is not reachable, here I'm going to list the steps:


  1. 安装所需开发包

  2. 编译和安装

  3. 创建一个FastCGI的包装脚本

    • 编译并安装如PHP-5.3与FPM启用

    • 配置PHP-FPM

    • 开始FPM

    • 安装和设置的mod_fastcgi,mod_fcgid

这篇关于包括Apache的几个PHP版本,通过AddHandler的指令可切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 20:58