2019/12/03

페어라인 테니스 사용자 홈 디렉토리 php 언어 지원 개발 환경

2. PHP 개발 언어
일반 사용자 public_html php 언어지원 환경 구축

2.2 php 환경 설정.

cat /etc/apache2/mods-enabled/php5.conf

원본파일
<IfModule mod_php5.c>
    <FilesMatch "\.ph(p3?|tml)$">
        SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
    </FilesMatch>
    # To re-enable php in user directories comment the following lines
    # (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
    # prevents .htaccess files from disabling it.
    <IfModule mod_userdir.c>
        <Directory /home/*/public_html>
            php_admin_value engine Off
        </Directory>
    </IfModule>
</IfModule>

vi /etc/apache2/mods-enabled/php5.conf
변경 파일
<IfModule mod_php5.c>
    <FilesMatch "\.ph(p3?|tml)$">
        SetHandler application/x-httpd-php
    </FilesMatch>
    <FilesMatch "\.phps$">
        SetHandler application/x-httpd-php-source
    </FilesMatch>
    # To re-enable php in user directories comment the following lines
    # (from <IfModule ...> to </IfModule>.) Do NOT set it to On as it
    # prevents .htaccess files from disabling it.
    #<IfModule mod_userdir.c>
    #    <Directory /home/*/public_html>
    #        php_admin_value engine Off
    #    </Directory>
    #</IfModule>
</IfModule>

2.3 웹서버 재시자.
invoke-rc.d apache2 force-reload
invoke-rc.d apache2 restart

3 php 동작테스트
3.1 php 버전 정보 확인.
vi /home/user/public_html/phpinfo.php
<?php phpinfo() ?>

3.2 접근
http://host:port/~user/phpinfo.php

댓글 없음:

댓글 쓰기