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

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 proceeds through the checkout, at submission of the checkout they get "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 a page on Stack Overflow and elsewhere saying 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 (7.78) 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
tr’s picture

Status: Active » Closed (works as designed)

The core PHP module in Drupal is an optional module that provides a way to add site-specific PHP code in certain places. The error is telling you that the PHP module had a problem parsing the site-specific code provided by you for your site.

Ubercart does not require or use the PHP module, and does not provide any site-specific code for the PHP module.

Modules like Rules, which Ubercart requires, can use the PHP module if the PHP module is enabled, but they do not require the PHP module.

There is nothing in Ubercart that can cause this error - it is happening because you have the PHP module enabled and because the PHP module is having a problem with code provided by you for your site.