Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Call to undefined function ... json_decode() with cli script(Script runs ok in cli, but not in Eclipse PDT)
Call to undefined function ... json_decode() with cli script [message #1638126] Fri, 27 February 2015 02:11 Go to next message
Ernest Wagner is currently offline Ernest WagnerFriend
Messages: 6
Registered: July 2014
Junior Member
Luna Service Release 1a (4.4.1)
php 5.5.21

json.so is enabled by default via /etc/php.d/json.ini according to the php.ini comments.

The json.so library actually is in the php modules folder. Has to be as php -m in the CLI indicates it is loaded but a isual of teh folder confirms it.

json.php is also listed in the php explorer's core API.

Unless Luna is using a built-in PHP interpreter that doesn't know what the /etc/php.d folder is for, I don't know what else to check.

I had to browse to find the /bin/php executable for Eclipse to accept that as the project default.

Any Ideas why php in Eclipse is giving me that error?

Ernie D
Re: Call to undefined function ... json_decode() with cli script [message #1639165 is a reply to message #1638126] Fri, 27 February 2015 13:45 Go to previous messageGo to next message
Dawid Pakula is currently offline Dawid PakulaFriend
Messages: 290
Registered: March 2013
Senior Member
If you enable modules by additional *.ini files (not from php.ini directly, for example in macports, debian, ubuntu, centos), you have to in Preferences / PHP / PHP Exceutables check "Use system default php.ini configuration"

Re: Call to undefined function ... json_decode() with cli script [message #1639650 is a reply to message #1639165] Fri, 27 February 2015 19:00 Go to previous messageGo to next message
Ernest Wagner is currently offline Ernest WagnerFriend
Messages: 6
Registered: July 2014
Junior Member
When I first started Luna (4.4.1), there was no project default PHP until I used the "Installed PHP" button to search for the system php (/bin/php) file. There, I set the PHP and the location of the system (/etc/php.ini) file. Luna then used that as the project default.

Even though the php.ini file indicated that I didn't have to use "extension = /path/to/json.so ", I did add it to the php.ini and the error message stopped.

BUT!!

I reverted to Kepler (PDT 3.2.0) and discovered that it isn't necessary to add "extension=/path/to/json.so to the php.ini. In fact, if it is added, PHP will give a warning that it is already loaded.

So I don't know if that is a bug or not in Luna, but Kepler also fixes another problem: In Luna, xdebug wasn't displaying each step through every statement in a function. Kepler does.

I just noticed that Luna SR 2 has been published so I'll give that a try.

Thanks for your input.

Regards

[Updated on: Fri, 27 February 2015 19:31]

Report message to a moderator

Re: Call to undefined function ... json_decode() with cli script [message #1639717 is a reply to message #1639650] Fri, 27 February 2015 19:45 Go to previous messageGo to next message
Ernest Wagner is currently offline Ernest WagnerFriend
Messages: 6
Registered: July 2014
Junior Member
Just tried SR2 and it doesn't seem to step into included files properly either, but haven't had time to give it a full checkout. Still had to add "Extenion=/path/to/json.so" in php.ini file. So I guess I'll stick with Kepler.
Re: Call to undefined function ... json_decode() with cli script [message #1641416 is a reply to message #1639717] Sat, 28 February 2015 15:32 Go to previous message
Dawid Pakula is currently offline Dawid PakulaFriend
Messages: 290
Registered: March 2013
Senior Member
If step into still not work, please prepare bug report on bugs.eclipse.org

On kepler sometimes extension= was required sometimes not. You have check "use system default php.ini configuration" in php configuration if your modules are loaded via additional *.ini files (for example macport and debian users).


Previous Topic:Cut'n paste really slow
Next Topic:stop comments being autoformatted with newline
Goto Forum:
  


Current Time: Thu Oct 10 02:39:35 GMT 2024

Powered by FUDForum. Page generated in 0.04896 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top