1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

CGI版PHPで動くディレクトリの下層でモジュール版PHPを動かす(.htacecss)

Last updated at Posted at 2021-04-08

目的

CGI版のPHPが動いているディレクトリの下層でモジュール版PHPを動かしたい

環境

  • CentOS7
  • Apache/2.4.6 (CentOS)

対象

今、/var/www/htmlに以下のように書いているとして、
下記のように、例えば /var/www/htmlにはPHP5.4で動いてほしいアプリケーションがあるとする。

/var/www/html/.htaccess
Options +ExecCGI
FCGIWrapper /usr/bin/php54-cgi .php
<FilesMatch \.php$>
     SetHandler fcgid-script
</FilesMatch>

/var/www/html/app01に新しいプロジェクトを置いて、
モジュール版(ここではPHP7系)を動かしたい場合,

.htaccess

/var/www/html/app01/.htaccess
<FilesMatch \.php$>
     SetHandler application/x-httpd-php
</FilesMatch>

結果

モジュール版PHPを動かすことができる。

参考

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?