PHP denying use of short hand “<?”

2019-01-15 15:31发布

I just installed php 5.3.0 and it won't run php scripts utilizing short open tags like <?, only <?PHP.

3条回答
你好瞎i
2楼-- · 2019-01-15 16:02

http://us2.php.net/manual/en/ini.core.php

you need to

ini_set("short_open_tag", 1)

or adjust your systems php.ini file.

查看更多
做自己的国王
3楼-- · 2019-01-15 16:13

That's because it's simply a bad practice. I suggest re-converting all your scripts to use <?php. If you're lazy, you can use a find and replace, if you have access to powerful command lines like bash you can use sed to do this for you.

查看更多
劳资没心,怎么记你
4楼-- · 2019-01-15 16:27

You need to update your php.ini file.

Set short_open_tag = 1

See the PHP Manual

查看更多
登录 后发表回答