개발! 딱 깔끔하고 센스있게!

Liux Fdora 에서 Apache 의 PHP 를 어떻게 사용 합 니까? 본문

개발 스크랩 메모/PHP

Liux Fdora 에서 Apache 의 PHP 를 어떻게 사용 합 니까?

렉사이 2020. 12. 13. 02:36

제목 의 차이 가 많 지 않 아 이 점 을 요약 하 였 다.

나 는 Fdora 를 실행 하고 있 으 며, "httpd" 를 통 해 Apache 를 설치 했다.

내 아 이 프 치 는 잘 돌아 가지 만 PHP 는 아무 소 용이 없 는 것 같다.

나 는 내 기계 에 그것 (Liux 의 새 버 전) 이 설치 되 어 있다 는 것 이 확실 하 다.

나 는 / var / ww / html / 디 렉 터 리 에서 "test. pp" 파일 을 만 들 었 습 니 다.

그 중 다음 코드 를 포함 합 니 다: 그러나 내 브 라 우 저 에 텍스트 를 인쇄 하기 위해 서 는 제대로 표시 되 지 않 았 습 니 다.

그래서 저 는 PHP 가 제 Apache 설정 에 설 치 된 것 이 아니 라 고 생각 합 니 다.

이 점 을 설명 하고 어떻게 역할 을 해 야 하 는 지 에 대해 조언 을 해 주 실 수 있 나 요?

미리 감사합니다!

편집, 이것 은 나의 httptd. config 파일:

ServerRoot "/etc/httpd" Listen 80 Include conf.modules.d/*.conf User apache Group apache ServerAdmin [email protected]  AllowOverride none Require all denied  DocumentRoot "/var/www/html"  AllowOverride None Require all granted   Options Indexes FollowSymLinks AllowOverride None Require all granted   DirectoryIndex index.html   Require all denied  ErrorLog "logs/error_log" LogLevel warn  LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common  LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio  CustomLog "logs/access_log" combined   ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"   AllowOverride None Options None Require all granted   TypesConfig /etc/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType text/html .shtml AddOutputFilter INCLUDES .shtml  AddDefaultCharset UTF-8 MIMEMagicFile conf/magic EnableSendfile on IncludeOptional conf.d/*.conf 

대답 하 다.

  1. yum install php
  2. Restart apache.
  3. Try again.

PHP 는 직접 설치 해 야 합 니 다.

PHP 가 먼저 설치 되 어 있 지 않 은 apache 모듈 이 아 닙 니 다.

Comments