EDIT: Ignore this issue, it seems to be working again now. It wasn't yesterday...

I have an e-commerce D7 site running Ubercart. I upgraded my server last month, the only difference in the configuration being the PHP version which the hosting company failed to mention. Since the upgrade, when the customer places an order, at the completion page where they are meant to get a confirmation of the order and an email, instead they get no email and see on the site "The website encountered an unexpected error. Please try again later" with the precise error being:
ParseError: syntax error, unexpected 'endif' (T_ENDIF), expecting end of file in php_eval() (line 13 of /home/mysite/domains/mysite.com/public_html/modules/php/php.module(80) : eval()'d code).

Googling for the error I have found this pageand others which say to change short_open_tag= Off to short_open_tag= On. I have done this, but it hasn't made any difference.

My new server has four versions of PHP available (7.0, 7.2, 7.3 and 7.4) and depending on version selected I either get the above error alone or additional PHP errors in other modules.

The hosting company enabled PHP 5.6 on my server and I have switched to that, which fixed the original problem, enabling the customer to see the checkout confirmation page, but this in turn broke some custom Ubercart address fields, with the fields not showing to the customer at checkout and then the token placeholders showing instead of the field values on the completion page. I never saw these issues before on my site while it was on the old server for many years.

I asked the hosting company to enable the exact same version of PHP that was running on the old server on the assumption that this would fix the problem, but they have been unable to say what version it was, despite the upgrade only happening two weeks ago.

Drupal core is fully up to date on my site as are the Token and Ubercart modules.

Any suggestions or tips would be much appreciated.

Comments

thoughtcat created an issue. See original summary.

thoughtcat’s picture

Issue summary: View changes
longwave’s picture

Category: Bug report » Support request
Status: Active » Fixed

If the error is coming from php_eval() in the PHP module, this means that you have some custom PHP code embedded somewhere in your site that is causing the error. This isn't anything we can fix in Drupal core, and without being able to see the custom code then it is difficult to know what to suggest - and the error message isn't very helpful in telling you where that code might be be embedded.

However, if as you say this is fixed, then that's good news and we can close this issue :)

thoughtcat’s picture

Thanks Longwave!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.