0

I have successfully migrated wordpress site to my localhost using "All-in-One WP Migration" plugin.

But I am getting errors on some pages:

Parse error: syntax error, unexpected '}' in C:\xampp\apps\wordpress\htdocs\wp-content\themes\XXX\XXXXpage.php on line 112

editing that file, there is some hard-to-read 'if else' statement wih 'HTML tags'

one error I have fixed was changing

<?if (!is_mobile() && !is_tablet()){?>

to

<?php if (!is_mobile() && !is_tablet()){?>

anybody knows why the first statement worked on my web, but not on localhost? perhaps due to some PHP version?

  • This great answer have all hints about the difference between the short <? and long <?php php tag. – bueltge Jan 26 '17 at 12:52
0

Some PHP versions require the explicit declaration of <?php instead of just <? declarations or the other way around. Settings such as short_open_tag in your php.ini file.

You can read more here http://php.net/manual/en/ini.core.php

|improve this answer|||||
  • thank you, @codiiv ! :) this has fixed all other parsing errors – mravec Jan 26 '17 at 13:03
  • Glad I can help – codiiv Jan 26 '17 at 13:11
0

PHP Short Tags are enabled on your web server & its disabled on your localhost. the solution is to either turn on short tags or write full code.

Solution One Enable short tags.

  • open up php.ini file
  • set short_open_tag=On
  • and Restrat Apache server

Solution two replace short tags with full

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.