0

When attempting to update a Drupal 7 site through the UI or Drush, I get Error: Call to undefined function json_decode() in home/xxxxx/drush/includes/output.inc, line 403 , code: 255)

The server is running PHP 7.3 with json enabled - I've verified this with phpinfo(). I'm at a loss here, and even if I apply updates by ftp, I still can't run database updates. Shared hosting without root access.

  • PHP 7.3.13
  • Drush 5.9
  • Drupal 7.x
2
  • Doesn't the same happen in a local copy of the site? Does the same happen on the live server when you call json_decode in a completely unrelated bare PHP script? Then this probably has nothing to do with Drupal, but with the hosting. – leymannx Feb 9 '20 at 12:48
  • I have not made a local copy of the site, however it does occur on the production and staging site on the same server. json_decode does work from a script called from the web root. I spent an hour with hosting support to be told it's not a server issue. The only common denominator is drush, since both sites use that same install. So I'll try reinstalling drush and see if that changes anything. – Bruski Feb 10 '20 at 5:49
0

So I finally found the culprit. A php symlink in the bin directory linking to an old version of php. I guess even though drush showed it was using version 7.3, those scripts used that symlink and was pulling in an older php version. Error is gone and I can finally update through drush.

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.