PHP 文件不会在浏览器中打开 - 只能下载.我需要更改什么才能使其正常工作? [英] PHP Files won't open in browser - only download. What do I need to change to make it work properly?
问题描述
我尝试重新安装 PHP.PHP 正在运行,Apache2 正在运行.不知道为什么在浏览器中打不开也不能正常显示.
I have tried reinstalling PHP. PHP is working, and Apache2 is running. I don't know why it's not opening in a browser and displaying normally.
请注意 - 我的 httpd.conf 是空的 - 而我在 apache2.conf 中拥有所有内容.这是因为我使用的是 Ubuntu.
Just so you know - my httpd.conf is empty - and instead I have everything in apache2.conf. This is because I'm using Ubuntu.
你能帮我吗?我知道这很简单,但我似乎找不到答案.
Can you help me? I know it's something simple, but I can't seem to find the answer.
推荐答案
你有这个项目的虚拟主机吗?
Have you virtual host on this project?
你是用 http://localhost/file.php 打开 php 文件还是直接像 file://...../file.php ?
Are you open php file with http://localhost/file.php or directly like file://...../file.php ?
这篇关于PHP 文件不会在浏览器中打开 - 只能下载.我需要更改什么才能使其正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!