コンテキスト:仮想RHEL 7.3にphp.fpmでnginxのを設定します。私はhttp://hostname/webcon/index.phpをプレーンhtmlかシンプルなPHPが含まれていれば開くことができます。しかし、require_once(私はパスをチェックした)を使用すると、私は以下のエラーが発生しています。ここで警告は、ストリーム許可を開くことができませんでしたVMware社に致命的なエラーなrequire_once PHP + nginxの+ RHELを拒否
Warning: require_once(/mnt/data/service/common/dbconfig.php): failed to open stream: Permission denied in /mnt/data/service/webcon/user.php on line 7
Fatal error: require_once(): Failed opening required '/mnt/data/service/common/dbconfig.php' (include_path='.:/usr/share/pear:/usr/share/php') in /mnt/data/service/webcon/user.php on line 7
ここ/php-fpm.d
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = apache
; RPM: Keep a group allowed to write in log dir.
group = apache
の私www.confのスニペットは、/ etc/nginxの
user apache;
worker_processes auto;
error_log /mnt/data/service/caldav/logs/error.log debug;
pid /var/run/nginx.pid;
の私nginx.confの抜粋です
ps -aux |グレップのnginxのは示しています
root 43982 0.0 0.0 58756 1064 ? Ss 15:07 0:00 nginx: master process /usr/sbin/nginx
apache 43983 0.0 0.0 61340 2624 ? S 15:07 0:00 nginx: worker process
root 44199 0.0 0.0 112648 960 pts/1 S+ 15:23 0:00 grep --color=auto nginx
私はまた、必要なすべての親/サブフォルダへのchmod 777を割り当てました。それらのすべては今のところroot/rootによって所有されています。私は何をする必要があるか分からない。 WWW-データにグループ:ユーザーを変更しようとしました
:私は...
編集1をグーグルでいる間、私が見つけた無駄すべての答え/提案で試してみました。以下のエラーを取得します。
Oct 26 15:32:25 nixs systemd[1]: Starting The PHP FastCGI Process Manager...
Oct 26 15:32:25 nixs php-fpm[44320]: [26-Oct-2017 15:32:25] ERROR: [pool www] cannot get uid for user 'www-data'
Oct 26 15:32:25 nixs php-fpm[44320]: [26-Oct-2017 15:32:25] ERROR: FPM initialization failed
Oct 26 15:32:25 nixs systemd[1]: php-fpm.service: main process exited, code=exited, status=78/n/a
Oct 26 15:32:25 nixs systemd[1]: Failed to start The PHP FastCGI Process Manager.
Oct 26 15:32:25 nixs systemd[1]: Unit php-fpm.service entered failed state.
Oct 26 15:32:25 nixs systemd[1]: php-fpm.service failed.
編集2:
編集3:
ファイルのパーミッション644のディレクトリが755
変更ユーザー:chmodコマンドが動作しない場合
、多分あなたは、このようなあなたのフォルダとサブフォルダにユーザーを割り当てることがCHOWNを行う必要があるグループをWWW-データ 'へ:WWW-data' – baig772
@ baig772は、あなたが提案した通りでした。 php-fpm.serviceを再起動している間に別のエラーに遭遇しました。質問が更新されました。タイリングに感謝します。 :) – f0rfun