PHP 应用程序使用 格式...在本地不起作用

发布于 2024-10-21 21:22:50 字数 628 浏览 5 评论 0原文

我不是一个精通 php 的人,但我几乎可以应付任何事情。我过去开发过许多 php 应用程序,但我不太记得了。作为一个朋友的恩惠,我试图帮助他们追踪 php 应用程序中的问题。我在我的机器(osx.6)php Entropy 5.3.3 apache 上设置了它。

它似乎大部分都在运行,但我在管理登录方面遇到了问题...注意到它没有登录,给出了错误或任何东西。

不管怎样,我的具体问题涉及我正在查看的一行,其中登录错误被转储到视图中:

即使我明确设置值,它也不会输出任何内容 例如:

<?php $problem="There is a problem."?>
<?= $problem ?>

但是,如果我说:

<?php $problem="There is a problem."?>
<?php echo ($problem); ?>

这让我想知道我在本地测试应用程序时遇到的问题是否是由于某些 mods 未加载或 php 版本问题造成的?

这些语法之间有什么区别,为什么一种可以工作而另一种则不行?

我试过用谷歌搜索这个...但我想我今天不太敏锐...

I'm not a huge php guy, but I can muddle through just about anything. I've worked on a number of php apps in the past, but I don't really remember much. As a favor for a friend I'm trying to help them trace a problem in a php app. I got it set up on my machine (osx.6) php Entropy 5.3.3 apache.

It seems to run for the most part, but I'm having problems with the admin login...noticed that it wasn't logging in, giving an error or anything.

Anyway, my specific question deals with a line I am looking at where login errors are dumped to the view:

This outputs nothing, even when I set the value explicity Eg:

<?php $problem="There is a problem."?>
<?= $problem ?>

However it does work if I say:

<?php $problem="There is a problem."?>
<?php echo ($problem); ?>

This makes me wonder if the problems I'm having testing the app locally are due to some mods not being loaded, or a php version issue?

What's the diff between these syntaxes, and why would one work and the other not?

I've tried googling this...but I guess I'm not really sharp today...

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

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

发布评论

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

评论(1

┼── 2024-10-28 21:22:50

您需要启用 short_open_tag选项。

You need to enable the short_open_tag option in php.ini.

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