Jump to content

Short tags on EC2


arbitrageur

Recommended Posts

HI,

 

I'm using;

https://github.com/onassar/PHP-Pagination

 

It works on my local test server, but on EC2, short tags are apparently not enabled by default.

 

The pagination is printing php:

<div class="pagination"><ul class="<?php= implode(' ', $classes) ?>">
<li class="<?php= implode(' ', $classes) ?>"><a href="<?php= ($href) ?>"><?php= ($previous) ?></a></li>
<li class="number active"><a data-pagenumber="<?php= ($current) ?>" href="#"><?php= ($current) ?></a></li>
<li class="number"><a data-pagenumber="<?php= ($current + $x + 1) ?>" href="<?php= ($href) ?>"><?php= ($current + $x + 1) ?></a></li>
<li class="number"><a data-pagenumber="<?php= ($current + $x + 1) ?>" href="<?php= ($href) ?>"><?php= ($current + $x + 1) ?></a></li>
<li class="<?php= implode(' ', $classes) ?>"><a href="<?php= ($href) ?>"><?php= ($next) ?></a></li>

I tried replacing <? with <?php to no avail. Not sure if the fact that one dependency is named "render.inc.php" instead of just ".php" which is causing the issue. Any ideas why apache is doing this? I'd rather not edit the .ini. Thanks..

Link to comment
https://forums.phpfreaks.com/topic/292238-short-tags-on-ec2/
Share on other sites

<?php= does not exist. <?= would become <?php echo (with a space between the echo and any following value)

 

this isn't an Apache problem. it's a php configuration problem and people using php's lazy-way short-cuts in code they publish for others to use that is not portable between php versions/configurations.

Link to comment
https://forums.phpfreaks.com/topic/292238-short-tags-on-ec2/#findComment-1495586
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.