2

I have tried to install php5-mod-json, but it did not help. I would prefer a solution without any other frameworks. PHP version that I am running is 5.4.5 Also I am using nginx and OpenWRT

Thank you in advance.

2
  • 5
    possible duplicate of PHP Fatal error: Call to undefined function json_decode() Commented Aug 25, 2015 at 12:27
  • 1
    This is not duplicate... The platform is 'embedded' where its is running under OpenWRT as I can see. The solution in the link is for workstation running Ubuntu. I am also looking for the json package for OpenWRT which can solve this issue. I am unable to find it through opkg package manager. Commented Oct 22, 2015 at 8:10

1 Answer 1

1

I tried installing the php5-mod-json. It is working fine for me.

opkg install php5-mod-json

if it doesn't work for you, you need to add the URL http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/oldpackages in your package list.

// File content 'index.php'
echo json_encode(array('ok'));

Test

root@openWRT:/www/html# php-cli index.php 
["ok"]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.