uncatcrea / wp-appkit

WP-AppKit WordPress plugin (create mobile apps connected to WordPress)
http://uncategorized-creations.com/
194 stars 66 forks source link

Parse error: syntax error, unexpected end of file... #341

Closed steveboj closed 6 years ago

steveboj commented 6 years ago

When I click the 'Preview' button I just see a white screen and get the following error in my php error log:

Parse error: syntax error, unexpected end of file in /home/myacount/mysite.com/wp-content/themes-wp-appkit/q-ios/php/add-custom-data.php on line 32

I also see that same error when I click the 'View config.js' or 'View config.xml' links.

This is on a new fresh Wordpress install with permalinks activated and no other plugins running, so I'm assuming it has something to do with my server setup?

lpointet commented 6 years ago

Hi, This is probably due to the fact there is the closing tag at the end of this file (?>). Could you please remove it and retry to see if it's better?

steveboj commented 6 years ago

Hi Thanks for the suggestion, but removing the closing php tag hasn't changed anything. Is there anything else you can think of that I can try?

lpointet commented 6 years ago

Could you please send us the error you have now without the last line in the file?

steveboj commented 6 years ago

The error is still the same, but it now says "line 30" instead of 32.

Parse error: syntax error, unexpected end of file in /home/myacount/mysite.com/wp-content/themes-wp-appkit/q-ios/php/add-custom-data.php on line 30

mleroi commented 6 years ago

Hi! Can you please try to remove all the php comments (lines starting with "//") inside the _wpak_add_customdata function of the add-custom-data.php file ? One of our previous user was having the same problem some time ago and I'm not sure why but it apparently solved the problem for him.

steveboj commented 6 years ago

Aha, yes, that's solved it!

It's the <%= xxx %> tags inside the comments that are causing the problem. Remove them and it works fine.

mleroi commented 6 years ago

Thanks for the feedback, we thought it could be those tags that messed up with PHP parsing indeed... even if it's surprising as there's inside PHP comments... This is probably due to a specific PHP config setting somewhere as this happens very rarely. Anyway we will fix that in next q-ios theme version. Thanks for helping narrowing this down and have fun with WP-AppKit!

larsonreever commented 4 years ago

This is probably due to a specific PHP config setting here's a very detailed tutorial on this, i liked the way they explained it - https://secure.wphackedhelp.com/blog/fix-parse-error-syntax-error-unexpected-wordpress/