컨텍스트하십시오 가상RHEL 7.3에 php.fpm와 Nginx에을 설정합니다. 일반 HTML 또는 간단한 PHP가 포함 된 경우 http://hostname/webcon/index.php을 열 수 있습니다. 그러나, require_once (경로를 확인했습니다) 사용할 때 아래 오류가 발생합니다. 여기 경고 스트림 권한을 열지 못했습니다 VM웨어에 치명적인 오류 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
는은/etc/nginx를
user apache;
worker_processes auto;
error_log /mnt/data/service/caldav/logs/error.log debug;
pid /var/run/nginx.pid;
내 nginx.conf의 조각 여기
; 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
/php-fpm.d
내 www.conf의 조각입니다ps -aux | grep 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 : youd가가있는 경우
파일 권한이 644 디렉토리는 755
변경 사용자 : chmod를가 작동하지 않는 경우
, 어쩌면 당신은이처럼 폴더 및 하위 폴더에 사용자를 할당 할 CHOWN을해야 할 그룹을 www가 데이터 '로 : WWW-data' – baig772
@ baig772, 당신이 제안한대로 했어. php-fpm.service를 다시 시작하는 동안 다른 오류가 발생했습니다. 질문을 업데이트했습니다. tyring 주셔서 감사합니다. :) – f0rfun