Jump to content

Processwire on Ubuntu Issue - Outputting code instead of Executing


FrancisChung
 Share

Recommended Posts

Hi there,
A colleague of mine is trying to get our site running on his local Ubuntu LAMP Setup (Ubuntu 17.10, Apache 2.4.27, PW 3.0.62, PHP 7.1.11)

When he types in the Homepage URL, he's getting code outputted instead of being executed.
Does any one know why?

Update : 

Just Figured it out.
Apparently, it's a new PHP7 security feature that disables from code executing if the code module starts with <? instead of <php
I'm using MAMP locally so I'm guessing MAMP is somehow circumventing this but LAMP isn't.

I'm posting this so people can save themselves hours pulling their hair out.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

If I'm getting this right, you're talking about short open tags? That's not exactly a new thing, but rather something that users have been discouraged to use for a very long time. Though you can still enable short open tags with the short_open_tag php.ini setting, if you've still got code that relies on short opening tags, you should consider updating it to the regular <?php opening tags :)

That being said, in PHP7 they did remove some utterly obsolete tags: the ASP style tags (<% %>) and the script tags (<script language="php"></script>). My guess is that most users probably didn't even know that those existed.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

18 hours ago, teppo said:

 if you've still got code that relies on short opening tags, you should consider updating it to the regular <?php opening tags :)

1

Thanks for your advice. I will do as suggested. Never expected a simple syntax idiosyncrasy like that would completely catch me out. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...