可能重复:
是什么导致PHP页面始终下载,而不是正常运行
我网站上的所有php文件都提示直接下载,而不是查看页面。
所以例如:在浏览器中去mydomain.com/index.php将直接下载index.php文件。
我所有的档案都是全裸的。
我不知道这是怎么发生的,我怎么能麻烦拍这个?
我正在使用Linux,CentOS,与cPanel。 我的htaccess文件是空的。
你可能没有加载Apache的PHP模块:
尝试下面的命令
apachectl -M
在输出你应该看到
php5_module (shared)
如果你不这样做:1.确保安装了PHP 2.在Apacheconfiguration文件中启用:
more /etc/httpd/conf.d/php.conf <IfModule prefork.c> LoadModule php5_module modules/libphp5.so </IfModule> AddHandler php5-script .php AddType text/html .php DirectoryIndex index.php
由于您正在使用CPanel,因此您应该能够通过CPanelconfiguration选项为您的服务器启用。