LoginSignup
3

More than 5 years have passed since last update.

posted at

updated at

CentOS > Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Fatal error: Unknown: Failed opening required '/home/user/public_html/index.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0 > SELinux

動作確認
CentOS 6.5 (64bit)

httpdをインストールして、php環境をセットアップ、ブラウザからlocalhost/index.phpを表示しようとしたら以下のエラーがブラウザに表示された。

Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0 Fatal error: Unknown: Failed opening required '/home/user/public_html/index.php' (include_path='.:/usr/share/php:/usr/share/pear') in Unknown on line 0

ファイルのパーミッション関連をいじったが変化なかった。

SELinux関連のようだ。

http://park1.wakwak.com/~ima/centos4_selinux0001.html
を参考に試しに以下を実行したらindex.phpが見えるようになった。

setenforce 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
What you can do with signing up
3