modifiedcontent Posted February 13, 2017 Posted February 13, 2017 If I get unparsed code like this on my homepage: Spoiler compile(\ProcessWire\wire("config")->paths->root . 'site/templates/_head.php',array('includes'=>true,'namespace'=>true,'modules'=>true,'skipIfNamespace'=>true))); ?> compile(\ProcessWire\wire("config")->paths->root . 'site/templates/_nav.php',array('includes'=>true,'namespace'=>true,'modules'=>true,'skipIfNamespace'=>true))); ?> {$page->body} ... What does that mean? What is PW missing? What misconfiguration would produce this result? And the admin area works as normal. I am troubleshooting an attempt to install Processwire on Amazon EC2, but suspect this could be an unrelated issue.
LimeWub Posted February 13, 2017 Posted February 13, 2017 Maybe a silly question, but is php properly installed on your server?
modifiedcontent Posted February 13, 2017 Author Posted February 13, 2017 PHP should be installed properly. The installation procedure gave no signs of problems and the admin area works as normal.
DaveP Posted February 13, 2017 Posted February 13, 2017 It looks like some of the unparsed code is from the file compiler, and that you are using the new 'regions' markup thingy(?). What is in your code immediately before {$page->body}? 1
modifiedcontent Posted February 13, 2017 Author Posted February 13, 2017 Quote ... you are using the new 'regions' markup thingy ... Not consciously... ;-| Could bad syntax in a template really bring down the entire front-end? I have this in my home page template: <div class=left><? echo "<p>{$page->body}</p>" ?></div> That is wrong on many levels... Not sure how that got there. 1
LostKobrakai Posted February 13, 2017 Posted February 13, 2017 <? ?> is removed in php 7.0 is only available with short_tags enabled in php, which it isn't by default, use <?= ?>, which are always available. See here: http://php.net/manual/de/language.basic-syntax.phptags.php 3
modifiedcontent Posted February 13, 2017 Author Posted February 13, 2017 Thanks! Is there a way to enable short_tags via command line, 'sudo something'? I'd still prefer to use <? ?> instead of <?= ?> To be clear, I should search/replace as follows? <? echo becomes <?= <? becomes <?php
LostKobrakai Posted February 13, 2017 Posted February 13, 2017 It's mentioned in the linked docs page. You'd need to edit your php.ini. In case of an ubuntu os it's somewhere in /etc/php[7.0]/
modifiedcontent Posted February 13, 2017 Author Posted February 13, 2017 After fixing what I could, I still get this bit at the bottom of each page with front-end editing enabled: editable()) { echo "EDIT"; } ?> So I guess there is even a bad php tag in that module somewhere.
matjazp Posted February 13, 2017 Posted February 13, 2017 It would be helpfull if we could see your template files and includes (like footer.inc), I suspect there's still some mistake there - Oculi plus vident quam oculus 1
modifiedcontent Posted February 13, 2017 Author Posted February 13, 2017 You're right matjazp, missed one more <? in the footer. Apparently you can also enable short tags support by adding this line to .htaccess: php_value short_open_tag 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now