PHP not rendering in HTML(PHP不在HTML中呈现)
问题描述
我正在使用带有 IIS 7 的 Windows 7.我正在尝试开始使用 PHP.我执行了以下操作:
I am using Windows 7 with IIS 7. I am trying to get started with PHP. I have performed the following:
- 使用 Web 平台安装程序安装 PHP
- 通过在我的网站根文件夹内的 PHP 管理器上使用检查 phpinfo()"验证 PHP 已安装(全部在我的本地计算机上)
当我测试 PHP 是否正在处理一个简单的 HTML 页面时,如下所示:
When I test to see if PHP is working with a simple HTML page as follows:
<!DOCTYPE html>
<html>
<body>
<?php
echo "My first PHP script!";
?>
</body>
</html>
Chrome 不渲染任何东西.我期待看到文字.
Chrome does not render anything. I am expecting to see the text.
谁能告诉我如何进行?
谢谢
推荐答案
如果出现此问题请检查:
If this problem ocurrs check:
- 文件是否有扩展名
.php
? - 服务器上的路径是否正确?
重要的是要记住,我假设您有一个激活了 php 支持的服务器.在服务器上,PHP文件的默认扩展名是.php
,但您可以向管理员查询以保证.
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.
您还可以检查错误日志是否已启用.当它被禁用并且代码有语法错误时,屏幕上不会显示任何内容.您可以在此处阅读更多信息:https://stackoverflow.com/a/5438125/1735789
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
这篇关于PHP不在HTML中呈现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHP不在HTML中呈现


基础教程推荐
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何替换eregi() 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01