2012-11-01 2 views
3

이유를 모르겠습니다. php 파일을 실행하는 대신, 그는 다운로드로 나를 서비스합니다.아파치는 php 파일을 실행하지 않지만 mod_php5는 활성화되어 있습니다.

다운로드 된 파일에는 PHP 소스가 있습니다.

내 테스트 파일은, 그것은 매우 간단 info.php라고

<?php 

phpinfo(); 

내 가상 호스트 :

AddType application/x-httpd-php .php 

: 아파치의 conf에서

<VirtualHost some_ip:80> 
DocumentRoot /var/www/vhosts/my_vhost/htdocs 
ServerName www.my_vhost.com 

<Directory /var/www/vhosts/my_vhost/htdocs/> 
    Options All -MultiViews 
    AllowOverride None 
    Order allow,deny 
    allow from all 
</Directory> 

ErrorLog /var/www/vhosts/my_vhost/logs/error.log 
LogLevel warn 
CustomLog /var/www/vhosts/my_vhost/logs/access.log combined 

</VirtualHost> 

내가 라인을 가지고 Apache 사용 모듈 :

apache2ctl -M 
Loaded Modules: 
core_module (static) 
log_config_module (static) 
logio_module (static) 
mpm_prefork_module (static) 
http_module (static) 
so_module (static) 
actions_module (shared) 
alias_module (shared) 
auth_basic_module (shared) 
auth_digest_module (shared) 
authn_file_module (shared) 
authz_default_module (shared) 
authz_groupfile_module (shared) 
authz_host_module (shared) 
authz_user_module (shared) 
autoindex_module (shared) 
bw_module (shared) 
cgi_module (shared) 
dav_module (shared) 
dav_fs_module (shared) 
dav_lock_module (shared) 
dav_svn_module (shared) 
authz_svn_module (shared) 
deflate_module (shared) 
dir_module (shared) 
env_module (shared) 
fcgid_module (shared) 
include_module (shared) 
mime_module (shared) 
negotiation_module (shared) 
perl_module (shared) 
php5_module (shared) 
python_module (shared) 
reqtimeout_module (shared) 
rewrite_module (shared) 
setenvif_module (shared) 
ssl_module (shared) 
status_module (shared) 
suexec_module (shared) 
userdir_module (shared) 
wsgi_module (shared) 
Syntax OK 

무엇을 디버깅하고 해결해야합니까?

phpmyadmin도 설치되어 있으며 제대로 작동합니다.

+1

은 .htaccess 또는 다른 .conf 파일의 add-type 지시문 일 수 있으며 apache2.conf에있는 지시문을 무시합니다. –

+0

DirectoryIndex ??? – slash28cu

+0

DirectoryIndex가 누락 되었습니까? 그것이 어떻게 설정되어야 하는가? – apelliciari

답변

1

문제를 발견.

그들은이 있었다 :

정도

  • 내 가상 호스트에서 NameVirtualHost 111.22.33.44:80의 부족을 다운로드

    • PLESK, 구성이 저를 혼동하고 파일을 저를 다시주고 있었다 내가 plesk에 의해 모든 include를 제외 시켰습니다. 그리고 나서 문제는 분명합니다; 그 전에 다른 IP 기반 가상 호스트가 있었기 때문에 가상 호스트를 확인할 수 없었습니다.

      도움을 주셔서 감사합니다.

  • 0

    확인이는 "개조-가능"으로 "php5.conf"와 "php5.load"파일이있는 경우 (기본 경로 :/등/아파치/개조-가능)

    그렇지 않을 경우, 만드는 것과 같은 방법으로 생성 그래서 :

    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/*/site> 
          php_admin_value engine Off 
         </Directory> 
        </IfModule> 
    </IfModule> 
    

    php5.load :

    # default PATH : /usr/lib/apache2/module/libphp5.so 
    LoadModule php5_module PATH/libphp5.so 
    

    phpMyAdmin을 설정 파일 n의 링크를 추가 PHP를 사용하기 위해 필요한 명령과 함께 "/etc/apache2/conf.d"로 AME "phpmyadmin.conf는"

    <Directory /usr/share/phpmyadmin> 
        Options FollowSymLinks 
        DirectoryIndex index.php 
    
        <IfModule mod_php5.c> 
         AddType application/x-httpd-php .php 
    
         php_flag magic_quotes_gpc Off 
         php_flag track_vars On 
         php_flag register_globals Off 
         php_value include_path . 
        </IFModule> 
    </Directory> 
    
    +0

    예 저는 phpmyadmin conf와 모두 있습니다. myadmin은 작동하지만 내 가상 호스트는 없습니다. – apelliciari