0

我正在使用带有 IIS 7 的 Windows 7。我正在尝试开始使用 PHP。我执行了以下操作:

  1. 使用 web 平台安装程序安装 PHP
  2. 通过在我的网站根文件夹内的 PHP 管理器上使用“检查 phpinfo()”验证了 PHP 是否已安装(全部在我的本地计算机上)

当我测试 PHP 是否正在处理一个简单的 HTML 页面时,如下所示:

<!DOCTYPE html>
<html>
<body>

<?php
echo "My first PHP script!";
?>  

</body>
</html>

Chrome 不渲染任何东西。我期待看到文字。

谁能告诉我如何进行?

谢谢

4

1 回答 1

1

If this problem ocurrs check:

  • Does the file have extension .php?
  • Does the path is correct on the server?

Its is important to remember that I am assuming that you have a server with php suport activated. On the server, the default extension to PHP files is .php, but you can check with the administrator to garantee.

You can also check if the error log is enable. When it is disabled, and the code has a syntax error, nothing is showed on the screen. You can read more here: https://stackoverflow.com/a/5438125/1735789

于 2013-05-03T20:05:35.890 回答