맛집 여행 캠핑 일상 생활

[CentOS] 7.x Apache2.4 + PHP7.2 mod_fcgid 에러 본문

IT이야기

[CentOS] 7.x Apache2.4 + PHP7.2 mod_fcgid 에러

영은파더♥ 2020. 7. 14. 16:18

CentOS 7.x minimal 로 설치 후 php 버전을 확인해 보면 5.4 버전입니다.

PHP 7.2 버전도 함께 사용하려고 mod_fcgid 모듈을 설치하고 설정이 잘 못 된 경우 발생하는 에러입니다.

 mod_fcgid: error reading data from FastCGI server

위 에러는 chmod +x /var/www/cgi-bin/php72.fcgi 실행 권한을 주면 됩니다.

Forbidden
You don't have permission to access /index.php on this server.

위 에러는 Options +ExecCGI 를 추가하면 됩니다.

mod_fcgid: stderr: PHP Warning:  mkdir(): Permission denied

위 에러는 해당 디렉토리의 소유권을 바꿔주시면 됩니다. ( chown apache:apache /var/www/html )

 

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot /var/www/html
    <Directory "/var/www/html">
        Options +ExecCGI
        Require all granted
        AddType application/x-httpd-php .php .html
    </Directory>
    <IfModule mod_fcgid.c>
        AddHandler fcgid-script .php
        AddHandler fcgid-script .html
        FCGIWrapper /var/www/cgi-bin/php72.fcgi .php
        FCGIWrapper /var/www/cgi-bin/php72.fcgi .html
    </IfModule>
</VirtualHost>

이제 아파치를 재시작 후 테스트 해보세요~

 

Trackback : | Comments :