I want to use the CakePHP shorthand <? in my project code instead of <?php, but my WAMP server (v2.1d-x64 on localhost) doesn't recognize it.
How can I开发者_如何学Python activate it?
In your php.ini, turn short_open_tag to on.
This is not recommended for portability reasons. My advice is to stick with the longer version.
In you php.ini, add the following line:
short_open_tag On
Note that in your question, that's not what you've done.. There should be no "Default Value: On", just short_open_tag On on a line by itself.
This is PHP syntax, not part of your CakePHP framework. You need to edit your PHP configuration file (php.ini), change short_open_tag to 1, and restart Apache.
http://php.net/manual/en/ini.core.php
You can activate it in your php.ini file. But good practice is to use the full string (<?php ... ?>). Not every PHP configuration allows the shorthand, and you do not have access to every server's php.ini (that is, if you host in a shared environment).
Set the configuration parameter short_open_tag to On in your php.ini file and restart your Apache server.
加载中,请稍侯......
精彩评论