psalm: Call to undefined function json_decode()

Call to undefined function json_decode() File: vendor/vimeo/psalm/src/command_functions.php on line 127

I already googled, but the issue I am having is different, bc I have json installed.

Also json_decode is working for all php-fpm (web) as well as CLI things, EXCEPT psalm.

php -m | grep json
json

php -i | grep json
/etc/php.d/20-json.ini,
json
json support => enabled
json version => 1.7.0
proto_binary_fetched_json => 0

I am using psalm 3.6.1

php -v
PHP 7.3.8 (cli) (built: Jul 30 2019 09:26:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.8, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.8, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v2.7.2, Copyright (c) 2002-2019, by Derick Rethans

Any suggestions on how I could further debug this? Is there perhaps some special way psalm calls php which could cause this problem?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

Thanks.

Checked, and they are completely different. The one composer creates is complete crap, bc it loads the absolute barebones, so all common extensions that are normally placed in /etc/php.d are completely missing: redis, imagick,…

Since this isn’t really an issue with psalm, but composer, I think this can be closed, and I will just keep using the XDEBUG flag.