0
0

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.

Apacheで特定のディレクトリについてPHPを無効にする

Last updated at Posted at 2021-11-24

以下の設定を<Directory>ディレクティブ内に記載する。

httpd.conf
<Directory "/var/www/html/foo/bar">
   php_value engine off
</Directory>

有効にしたい場合は

httpd.conf
<Directory "/var/www/html/foo/bar">
   php_value engine on
</Directory>

より深い階層の設定が有効になるので、上記の組み合わせで「全体で無効、特定のディレクトリで有効」という設定も可能。

ちなみに以下のように記載するという記事もあったが、自分の環境ではうまく動かなかった。

httpd.conf
<Directory "/var/www/html/foo/bar">
    RemoveType .php
</Directory>
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?