JSON

Status
Not open for further replies.

r0nmltx1

New Member
Messages
29
Reaction score
0
Points
1
ok i'll try closing the account and reopening it and see what happens

thanks a lot for your time
 

r0nmltx1

New Member
Messages
29
Reaction score
0
Points
1
closing the account is not an option as reopening the account from my country is no possible. i opened the account 5 years ago and maybe back then the restriction were not in place. so my only other option remains to hope for an admin to see to this thread
 

r0nmltx1

New Member
Messages
29
Reaction score
0
Points
1
i'm bumping this again as my json modules are still not loading to PHP

heeeeeellllppppp
 

darknessiseek

Member
Messages
58
Reaction score
8
Points
8
Read the error...
Fatal error: Call to undefined function json_decode() in xxxxxx.php on line 24

In your script you are calling the function json_decode() it is undefined because there is no such function that exists. The fatal error has nothing to do with the server but bad coding habits.
Line 24 is where you called the function, the function would have to been written before you called the function. Or else you will get Fatal Error of an undefined function, it means exactly what it says.
 

r0nmltx1

New Member
Messages
29
Reaction score
0
Points
1
I'm not sure I am understanding what you mean. json_decode() is NOT a custom function, it is part of the Json module that is loaded on PHP startup. If you go into "Select PHP Module" from Cpanel you can see that you can check or uncheck the json module. Notwithstanding toggling, the module is still not loaded and the json functions are not available for use.
 

darknessiseek

Member
Messages
58
Reaction score
8
Points
8
I'm not sure I am understanding what you mean. json_decode() is NOT a custom function, it is part of the Json module that is loaded on PHP startup. If you go into "Select PHP Module" from Cpanel you can see that you can check or uncheck the json module. Notwithstanding toggling, the module is still not loaded and the json functions are not available for use.
I know it's not a custom function, it means it's missing, and if it's missing you have it disabled or it's not compatible with your php version.

You may want to make a custom function such:
https://gajendrakrjain.wordpress.com/2014/10/07/alternative-for-json_decode-and-json_encode/
 

caftpx10

Well-Known Member
Messages
1,534
Reaction score
114
Points
63
I know it's not a custom function, it means it's missing, and if it's missing you have it disabled or it's not compatible with your php version.

You may want to make a custom function such:
https://gajendrakrjain.wordpress.com/2014/10/07/alternative-for-json_decode-and-json_encode/
It's there (as in it being an option and supported) but it appears that some modules won't load for some users due to an issue in the backend.

The custom json_decode function on the page you had linked to uses a blacklisted function (eval).
 

darknessiseek

Member
Messages
58
Reaction score
8
Points
8
It's there (as in it being an option and supported) but it appears that some modules won't load for some users due to an issue in the backend.

The custom json_decode function on the page you had linked to uses a blacklisted function (eval).
I know it uses eval function, it can be recoded not to have to use eval in it, I was giving an example to an alternative, when the json function does not work. There are many other alternatives than that,it was an idea how to go about it.
 

r0nmltx1

New Member
Messages
29
Reaction score
0
Points
1
I appreciate your effort darknessiseek and at some point I will have to look into altering the script to work around the issue without using json_decode() or implementing an alternative json_decode().

In a quick attempt yesterday I just copied and pasted the code you referred to and my script stopped giving the error that json_decode() doesn't exist and started giving a new error:

Fatal error: Class 'DOMDocument' not found in xxxxxxxxxx on line 8


Now please remember that this script was working until something broke AND this script works on other hosting providers.

So even if I manage to work around json_decode() I will have to face this scenario that DOMDocument class does not exist!!!!

Something is definately broken and for the love of me I cannot understand what it is.
 

r0nmltx1

New Member
Messages
29
Reaction score
0
Points
1
Thanks for the support caftpx10 and the effort to get to the root of this problem.

I tried to go through all the checks again with this issue. I changed through all the PHP versions, I toggled DOM and XML modules, but to no avail.

I appreciate darknessiseek's effort into directing me to an alternative which would have worked BUT now how would I go about rewriting the DOMDocument class. I do not think this is the right approach and now I am thinking there might be a whole lot of other modules that are not loading up. I have written a small routine to list all the modules that are loading up on my account.

<?php
$extensions = get_loaded_extensions();

foreach($extensions as $extension) {
echo $extension , "<br>";
}
?>

This is the comparison of the two scripts run on different hosting servers. The 1st coloumn is x10hosting.com the second is heliohost.org. Clearly DOM & json modules are not being loaded but likewise others. Mbstring used to be loaded as my script depends on that too and now its not being loaded.

Would anyone be willing to run the script on his account to list the discrepancies?

Untitled.jpg
 
Last edited:

bdistler

Well-Known Member
Prime Account
Messages
3,534
Reaction score
196
Points
63
Would anyone be willing to run the script on his account to list the discrepancies?
-
which servers did you get your list from ?
###

Code:
server xo3    server Tommy
-----         -----
bcmath        bcmath
bz2
calendar      calendar
                    cgi-fcgi
Core            Core
ctype           ctype
curl             curl
date            date
dom            dom
ereg            ereg
exif             exif
fileinfo         fileinfo
filter            filter
ftp               ftp
gd              gd
geoip
gettext       gettext
gmp
hash          hash
iconv         iconv
imap          imap
intl             intl
ionCube Loader
json           json
libxml         libxml
litespeed
mbstring     mbstring
mcrypt        mcrypt
mhash        mhash
mongo
mysql         mysql
mysqli        mysqli
mysqlnd      mysqlnd
openssl       openssl
pcntl            pcntl
pcre             pcre
PDO            PDO
pdo_mysql     pdo_mysql
                    pdo_pgsql
pdo_sqlite    pdo_sqlite
                    pgsql
Phar             Phar
posix            posix
pspell           pspell
readline       readline
Reflection    Reflection
session        session
shmop
SimpleXML   SimpleXML
soap            soap
sockets        sockets
SPL             SPL
sqlite3          sqlite3
standard      standard
timezonedb
tokenizer     tokenizer
                    wddx
xdebug
xml               xml
xmlreader    xmlreader
xmlrpc         xmlrpc
xmlwriter     xmlwriter
xsl               xsl
                    Zend OPcache
zip               zip
zlib              zlib
###
you need to slide down - to see the full list
 
Last edited:

cloudwhe

New Member
Messages
20
Reaction score
0
Points
1
are you really sure json module was click on the php version settings? I was having a problem with this also before.
 

r0nmltx1

New Member
Messages
29
Reaction score
0
Points
1
I am on xo1 so there could be a clue why some have environs that work and others not.



Re: cloudwhe I have been toggling the switches so many of those times they have gone wobbly.
 

r0nmltx1

New Member
Messages
29
Reaction score
0
Points
1
Any body can reproduce the same script on xo1. As I have a suspician the issue surrounds xo1.

Code:
| my xo1.x10hosting.com         | bdistler's  xo3.x10hosting.com| bdistler's tommy.heliohost.org| my tommy.heliohost.org        |
|                               | bcmath                        | bcmath                        | bcmath                        |
| bz2                           | bz2                           |                               |                               |
| calendar                      | calendar                      | calendar                      | calendar                      |
|                               |                               | cgi-fcgi                      | cgi-fcgi                      |
| Core                          | Core                          | Core                          | Core                          |
| ctype                         | ctype                         | ctype                         | ctype                         |
| curl                          | curl                          | curl                          | curl                          |
| date                          | date                          | date                          | date                          |
|                               | dom                           | dom                           | dom                           |
| ereg                          | ereg                          | ereg                          | ereg                          |
| exif                          | exif                          | exif                          | exif                          |
|                               | fileinfo                      | fileinfo                      | fileinfo                      |
| filter                        | filter                        | filter                        | filter                        |
| ftp                           | ftp                           | ftp                           | ftp                           |
|                               | gd                            | gd                            | gd                            |
|                               | geoip                         |                               |                               |
| gettext                       | gettext                       | gettext                       | gettext                       |
| gmp                           | gmp                           |                               |                               |
| hash                          | hash                          | hash                          | hash                          |
| iconv                         | iconv                         | iconv                         | iconv                         |
|                               | imap                          | imap                          | imap                          |
|                               | intl                          | intl                          | intl                          |
|                               | ionCube Loader                |                               |                               |
|                               | json                          | json                          | json                          |
| libxml                        | libxml                        | libxml                        | libxml                        |
| litespeed                     | litespeed                     |                               |                               |
|                               | mbstring                      | mbstring                      | mbstring                      |
|                               | mcrypt                        | mcrypt                        | mcrypt                        |
| mhash                         | mhash                         | mhash                         | mhash                         |
|                               | mongo                         |                               |                               |
|                               | mysql                         | mysql                         | mysql                         |
|                               | mysqli                        | mysqli                        | mysqli                        |
|                               | mysqlnd                       | mysqlnd                       | mysqlnd                       |
| openssl                       | openssl                       | openssl                       | openssl                       |
| pcntl                         | pcntl                         | pcntl                         | pcntl                         |
| pcre                          | pcre                          | pcre                          | pcre                          |
|                               | PDO                           | PDO                           | PDO                           |
|                               | pdo_mysql                     | pdo_mysql                     | pdo_mysql                     |
|                               |                               | pdo_pgsql                     | pdo_pgsql                     |
|                               | pdo_sqlite                    | pdo_sqlite                    | pdo_sqlite                    |
|                               |                               | pgsql                         | pgsql                         |
|                               | Phar                          | Phar                          | Phar                          |
|                               | posix                         | posix                         | posix                         |
|                               | pspell                        | pspell                        | pspell                        |
| readline                      | readline                      | readline                      | readline                      |
| Reflection                    | Reflection                    | Reflection                    | Reflection                    |
| session                       | session                       | session                       | session                       |
| shmop                         | shmop                         |                               |                               |
| SimpleXML                     | SimpleXML                     | SimpleXML                     | SimpleXML                     |
|                               | soap                          | soap                          | soap                          |
|                               | sockets                       | sockets                       | sockets                       |
| SPL                           | SPL                           | SPL                           | SPL                           |
| sqlite3                       | sqlite3                       | sqlite3                       | sqlite3                       |
| standard                      | standard                      | standard                      | standard                      |
|                               | timezonedb                    |                               |                               |
| tokenizer                     | tokenizer                     | tokenizer                     | tokenizer                     |
|                               |                               | wddx                          | wddx                          |
|                               | xdebug                        |                               |                               |
| xml                           | xml                           | xml                           | xml                           |
|                               | xmlreader                     | xmlreader                     | xmlreader                     |
|                               | xmlrpc                        | xmlrpc                        | xmlrpc                        |
|                               | xmlwriter                     | xmlwriter                     | xmlwriter                     |
|                               | xsl                           | xsl                           | xsl                           |
|                               |                               | Zend OPcache                  | Zend OPcache                  |
|                               | zip                           | zip                           | zip                           |
| zlib                          | zlib                          | zlib                          | zlib                          |
 
Status
Not open for further replies.
Top