PHP 初学者问题(服务器问题)
嘿!!
我刚得到一个运行 debian 的虚拟服务器。我刚刚安装了apache和php。现在服务器应该支持php了。
我上传了文件index.php:
<?
echo "Hallo";
?>
问题是,如果我向网站发出请求,我的浏览器想要下载文件。
可能是什么问题?
谢谢
Hy!!
I just get a vserver running debian. I just installed apache and php. Now the server should support php.
i uploaded the file index.php:
<?
echo "Hallo";
?>
The problem is if i start a request to the site my browser wants to download a file.
Whats could be the problem?
THX
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
安装PHP后重启apache了吗?
have you restarted apache after installing PHP?
这可能意味着该文件的 Mime 扩展名未在 Web 服务器上注册,这意味着您需要检查您的服务器中是否安装了 PHP 解释器作为扩展名/插件。
This could mean that the Mime extension of the File is not registered with the web server which means you will need to check if you have the PHP Interpreter installed as a extension/plugin in your server.
尝试:
默认情况下,short_open_tags 在可能的发行版中被禁用。如果您必须支持遗留页面,您可以在 php.ini 中启用它们,如果不需要,则只需使用上面的内容,您的代码将更加兼容。
Try:
The short_open_tags is disabled in may distributions by default. If you have to support legacy pages you can anable them in php.ini, if not then just use the above, your code will be more compatible.
您的服务器未设置为在输出 PHP 文件之前对其进行解析。
查看这些页面:
http://www.phpbuilder.com/board/archive/index .php/t-7100332.html
http://www.petefreitag.com/item/516.cfm
Your server isn't set to parse PHP files before they are output.
Check out these pages:
http://www.phpbuilder.com/board/archive/index.php/t-7100332.html
http://www.petefreitag.com/item/516.cfm
如果您将其更改为
标记,您的页面可以正常工作,那么 vbence 是对的,可能就像 shanethehat 所说,如果您已经进行了更改,您只需要重新启动 apache到 php.ini,所有这些东西一起工作的乐趣之一是,你需要研究所有选项来找出这些东西在哪里失败,这样你就知道从哪里开始寻找修复它
(找到了为什么它没有显示,我没有将代码放在 php 标签周围)
If your page works if you changed that to the
<?php
tags, then vbence would be right, it could be as shanethehat says that you just need to restart apache if you've already made the change to php.ini, one of the joys of all these things working together you need to work through all the options to find out where these things fall down so you know where to start looking to fix it(Found why it wasnt displaying, I hadnt put code round the php tags)