무소의 뿔처럼

php apach24 본문

알아두기/PHP

php apach24

값을변경 2022. 9. 26. 09:31

 

설치 후

apach24폴더 - conf - httpd.conf 메모장으로 열어 Define SRVROOT 경로 수정

DirectoryIndex에 index.php를 추가

# Do not add a slash at the end of the directory path.  If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used.  If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#
Define SRVROOT "C:\아파치가있는폴더\Apache24"

ServerRoot "${SRVROOT}"

##########

#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

##########

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:\APM\Apache24\htdocs"
<Directory "${SRVROOT}/htdocs">

###########

#맨 아랫줄에 추가
PHPIniDir "C:/php7"
LoadModule php7_module "C:/php7/php7apache2_4.dll"
AddType application/x-httpd-php .html .php
AddHandler application/x-httpd-php .php

LoadModule php7_module "C:/php7/php7apache2_4.dll"를 할때 

그 경로에는 php7가 설치되어 있을것이고, " php7apache2_4.dll " 파일도 있어야 한다.

처음 다운로드 받은 php는 php7apache2_4.dll 파일이 없었다.

 

 

환경변수 path: apach24\bin 까지 해서 추가

cmd - 관리자모드 - httpd -k install 

apach24 폴더 - bin - apach service monitor에서 실행하고 초록불까지 확인.

 

 

브라우저에 apach24실행 확인

http://localhost/

 

 

Comments