I’m hoping to tap some of the community knowledge here on a migration to ASO that is encountering something odd.
The code works fine on my MacBook that I use for development, and everything functions normally in my local dev setup. However the same templates are not displaying correctly when on ASO using PHP5.5. If I use the PHP 5.4 that is ASO’s default PHP package, the problems go away. Given that 5.4 is near EOL and my dev environment is 5.5, I’d like to understand what is causing this issue to match versions between environments.
Under PHP 5.5:
Looking into the source, some things like conditionals in navigation are not being parsed.
Template:
<li{if segment_1 == ""} class=“active”{/if}>Home</li>
Rendered HTML:
<li{if segment_1 == ""} class=“active”>Home</li>
In other instances, {site_url} in some link tags is not being parsed out and results in the disallowed characters error.
The rest of the site, including channel entries, channel categories, etc are working just fine, and query the database correctly. Under 5.5, many links are broken and the HTML tags are broken due to partial rendering of the template tags.
My .htaccess:
AddType application/x-httpd-php55 .php
<IfModule mod_rewrite.c>
RewriteEngine on
# Removes index.php from ExpressionEngine URLs
RewriteCond $1 !\.(css|js|gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>
When logged in to the CP as admin, the following errors are displayed:
A PHP Error was encountered
Severity: Warning
Message: preg_match(): Compilation failed: unknown option bit(s) set at offset 0
Filename: Parser/AbstractLexer.php
Line Number: 70
However, as mentioned, this all goes away as a problem if I use PHP 5.4.
Questions:
- What is the likely culprit on the errors under 5.5? Is this a PCRE issue requiring some newer version?
- Given EOL for PHP 5.4 in 2015 (my understanding), are there any known risks in staying for now with 5.4? It’s my short-term answer, but it would be nice to have a longer term perspective…