AuthorizeNet / sample-code-php

This repository contains working code samples which demonstrate php integration with the Authorize.Net API
MIT License
175 stars 197 forks source link

Fatal error: Call to undefined function JMS\Serializer\json_decode() #83

Closed avrain27 closed 7 years ago

avrain27 commented 7 years ago

I have tested the code on my local computer and it seems to run well. But I get the following error;

Fatal error: Call to undefined function JMS\Serializer\json_decode() in /home/havis2/public_html/authorize/vendor/jms/serializer/src/JMS/Serializer/JsonDeserializationVisitor.php on line 27

when I try to run the code after uploading it to an online server.

My local PHP installation is version 5.6.28 and the one at the server is version 5.6.30.

Here is a screenshot of the active modules at the online server that is running into the error.

screen shot 2017-04-21 at 23 09 06

Any help would be appreciated.

kikmak42 commented 7 years ago

json_decode() is function provided by the json module of php. As the error says undefined function json_decode(), the reason could be no json module installed or incorrectly json module installed.

Your screenshot shows you have the json module already installed, so try reinstalling it once again.

avrain27 commented 7 years ago

Thank you kikmak42.

I went over to the account and created a simple script that’d run the json_decode() function and it returned a similar fatal error. So this is clearly not an authorize.net API issue, rather an issue at the server hosting the website. I will contact godaddy for a fix.