I've tried googling this but I can't find the setting. I have a production server that accepts <?
as well as <?php
but I'm trying to use the site in WAMP but it doesn't accept <?
alone, it insists on using <?PHP
. Is this something I can set in WAMP?
In your php.ini change the short-open-tag to short_open_tag=On
short_open_tag boolean Tells PHP whether the short form (
<? ?>
) of PHP's open tag should be allowed. If you want to use PHP in combination with XML, you can disable this option in order to use<?xml ?>
inline. Otherwise, you can print it with PHP, for example:<?php echo '<?xml version="1.0"?>'; ?>
. Also, if disabled, you must use the long form of the PHP open tag (<?php ?>
).Note:
This directive also affected the shorthand
<?=
before PHP 5.4.0, which is identical to<? echo
. Use of this shortcut required short_open_tag to be on. Since PHP 5.4.0,<?=
is always available.
If you are using WampServer you can also left click on the icon down at the bottom right on your windows task bar. Roll over PHP, the PHP Settings, and the 4th item is "short open tag" just click that and it will turn it on for you without having to modify any files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With