dongxiangqian1855 2013-08-28 23:07
浏览 73

Apache,PHP,Centos 6

When I navigate to my website (e.g. www.mydomain.com), the browser opens a pop-up window to download a file.

In my httpdocs folder i have: - index.html - index.php () - I do NOT have .htaccess file

Checking in the browser: - www.mydomain.com/index.html -> it works fine - www.mydomain.com/index.php -> it works WRONG (it downloads the index.php file) - www.mydomain.com -> it works WRONG (it download "descarga" file with index.php contents).

PHP is installed, and when I run the php -v command, it says that I am using PHP 5.3

I have other domains on the same server working fine with php files, so AddHandler or LoadModule should not be the problem as far as PHP is a constant for all my domains.

This is my php.conf and looks like everythin is right:

# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
<IfModule prefork.c>
  LoadModule php5_module modules/libphp5.so
</IfModule>
<IfModule worker.c>
  LoadModule php5_module modules/libphp5-zts.so
</IfModule>

#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

What should I try to navigate to my domain successfully?

  • 写回答

3条回答 默认 最新

  • drzrzzkh462254 2013-08-28 23:11
    关注

    Make sure you have the PHP module loaded. Somewhere in your config you should see something like:

    LoadModule php5_module    modules/libphp5.so
    

    Then, make you you add a handler to handle files with the php extension:

    AddHandler application/x-httpd-php .php .php5 .phtml
    AddHandler application/x-httpd-php-source .phps
    
    评论

报告相同问题?

悬赏问题

  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号