XAMPP:无法让 PHP 工作

发布于 2024-09-27 15:42:56 字数 379 浏览 2 评论 0原文

我将 .php 文件保存到 file:///C:/xampp/htdocs/tester/tester.php,虽然我的 XHTML 和 CSS 可以工作,但我的 PHP 却不能。我把

作为正文的第一行,并且

echo "

你好世界

";
?>

但是当我查看页面时,根本没有显示 phpinfo() 的任何内容,并且 Hello World 位显示为:

Hello World"; ?>

Apache 和 MySQL 正在运行。我已经搜索了互联网上找不到解决方案,但我觉得这可能是我缺少的一些非常基本的东西。

I saved a .php file to file:///C:/xampp/htdocs/tester/tester.php, and though my XHTML and CSS are working, my PHP is not. I put

<?php phpinfo(); ?>

as the first line of the body, and

<?php
echo "<p>Hello World</p>";
?>

a couple of paragraphs in. But when I view the page, nothing for phpinfo() shows up at all, and the Hello World bit shows up as:

Hello World"; ?>

Apache and MySQL are running. I've scoured the internet and can't find a solution, but I feel like it's probably something very basic that I'm missing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独﹏钓一江月 2024-10-04 15:42:57

尝试使用以下命令调用您的文件

本地主机/tester/tester.php

而不是 file:///C:/xampp/htdocs/tester/tester.php

Try to call your file with

localhost/tester/tester.php

instead of file:///C:/xampp/htdocs/tester/tester.php.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文