[ubuntu] 개인 디렉토리(public_html)에서 php 사용하도록 세팅하기

2015. 1. 4. 17:13 from Dev/Linux

지난번 포스팅에서는 개인 유저 디렉토리를 apache2에서 이용할 수 있도록 하는 방법을 정리하였습니다. 이제는 php도 이용가능하도록 세팅을 해야겠습니다. ubuntu에서는 기본적으로 개인 폴더에서 php를 이용할 수 없도록 되어 있습니다.

관련된 설정 모듈은 /etc/apache2/mods-available에서 찾아볼 수 있습니다. php5.conf 설정을 보시면, 다음과 같은 부분이 있습니다 :



# Running PHP scripts in user directories is disabled by default
# 
# To re-enable PHP in user directories comment the following lines
# (from  to .) Do NOT set it to On as it
# prevents .htaccess files from disabling it.

    
        php_admin_flag engine Off
    



이 부분을 주석처리(라인 앞에 # 삽입) 해주신 다음에 service apache2 restart 해주시면 개인 폴더에서도 php가 실행되는 것을 알 수 있습니다.

Posted by banasun :