Author Topic: Help Please Fatal error: call to undefined function json_last_error  (Read 4240 times)

aglezt

  • Beginner
  • *
  • Posts: 1
  • A beginner
  • Skype Name: aglezt
i install VirtueMart3.0.10_Joomla_2.5.28-Stable-Full_Package  but i have this error

Fatal error: Call to undefined function json_last_error() in /home/biohogar/public_html/administrator/components/com_virtuemart/helpers/config.php on line 1076

------------------------------------------------

public static function parseJsonUnSerialize($in,$b64Str = false){

      $value = json_decode($in ,$b64Str);
      $ser = false;
      switch(json_last_error()) {
         case JSON_ERROR_DEPTH:
            echo ' - Maximum stack depth exceeded';
            return null;
         case JSON_ERROR_CTRL_CHAR:
            echo ' - Unexpected control character found';
            $ser = true;
            break;
         case JSON_ERROR_SYNTAX:
            //echo ' - Syntax error, malformed JSON';
            $ser = true;
            break;
         case JSON_ERROR_NONE:
            return $value;
      }

      if($ser){
         try {
            if($b64Str and $b64Str==='offline_message' ){
               $value = @unserialize(base64_decode($in) );
            } else {
               $value = @unserialize( $in );
            }
            vmdebug('Error in Json_encode use unserialize ',$in,$value);
            return $value;
         }catch (Exception $e) {
            vmdebug('Exception in loadConfig for unserialize '. $e->getMessage(),$in);
         }
      }
   }

------------------------------------------------
anyone knows how to solve it?  Thanks all

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10144
  • VM3.9 Eagle Owl
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Help Please Fatal error: call to undefined function json_last_error
« Reply #1 on: October 27, 2015, 09:40:00 am »
your php version is too low!
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/