PHP文件 - 下载而不是在浏览器中加载?

问题描述:

I have this file, index.php. I FTP'd it to my web server. When I go to the page mydomain.com/index.php my browser downloads the php file instead of loading the page.

The only code in the php file is <?php echo "hello world;" ?>.

Why isn't the page loading as intended?

我有这个文件,index.php。 我将它FTP到我的网络服务器。 当我转到页面mydomain.com/index.php时,我的浏览器会下载php文件而不是加载页面。 p>

php文件中唯一的代码是&lt;? php echo“hello world;” ?&gt; code>。 p>

为什么页面没有按预期加载? p> div>

If you have PHP installed on the server already, you should ensure that Apache recognizes it by configuring httpd.conf properly.

This occuers becase of web server . your web server think php files like text files or pdf files . you should install a program for your web server to interpret php files .

This occuers becase of web server . your web server think php files like text files or pdf files . you should install a program for your web server to interpret php files.

sorry I was not logged in before :)

The server most likely doesn't have PHP installed.