Jump to content

[SOLVED] Local PHP issues


mnybud

Recommended Posts

You should try to avoid using short tags (<? ?> <?= ?>) within your scripts. Short tags are depreciated and are not recommended. Hence why they are disabled by default. You should note they are soon to be removed completely as of PHP6.

 

I would highly recommend you to convert your scripts to use the full PHP tags.

 

However you can enabled them by setting the short_open_tag directive to On within your php.ini

Link to comment
Share on other sites

If you do a search and replace of <?= to <? echo followed by a search and replace of <? to <?php your problem will be solved and your code will work on any server. Sooner or later you will end up on a server where you won't have the ability to turn on the setting.

 

Php.net made a blunder when they created a second tag that defines where code starts and an even bigger blunder when that tag could be turned off. The tag that defines what code is should be unique and should always work.

Link to comment
Share on other sites

If you do a search and replace of <?= to <? echo followed by a search and replace of <? to <?php your problem will be solved

 

And that could be done to every file ending with the extension .php on a Linux machine using....

 

find . -name '*.php' -exec sed -e 's/<?=/<? echo/g' -e 's/<?/<?php/g' {} \;

 

edit: eww, that broke the


tags.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.