Jump to content

json error


helmut2509
 Share

Recommended Posts

Hello,

In my pw app I am using a webservice to fetch data for a selectbox.

Sporadically (not always!) I cannot json_decode the json string I get from the webservice, I get json error code 4 (syntax error).

When this occurs I also get the following error message:

"Severity: Core Warning

Message: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/php_soap.dll' - /usr/lib/php/20151012/php_soap.dll: cannot open shared object file: No such file or directory".

....though I do NOT use a soap function!

the strange thing is that I fetch always the same data and sometimes it works, sometimes it does not work.

 

Any suggestions?

Link to comment
Share on other sites

4 minutes ago, helmut2509 said:

that's already done.....

I know, but

30 minutes ago, helmut2509 said:

Unable to load dynamic library

this error points out that some ini file somewhere is trying to load the php_soap extension from an nonexistent path.

To find if there's a call to soap methods, you can perform a project wide search using the methods here http://php.net/manual/en/book.soap.php

Link to comment
Share on other sites

5 minutes ago, abdus said:

I know, but

this error points out that some ini file somewhere is trying to load the php_soap extension from an nonexistent path.

To find if there's a call to soap methods, you can perform a project wide search using the methods here http://php.net/manual/en/book.soap.php

I guess the error is somehow related to the $session-object (of PW). 

When I logout and then login again, all works fine (in the majority of cases).

But then at subsequent calls of one page the error occurs again.

Link to comment
Share on other sites

12 minutes ago, helmut2509 said:

I guess the error is somehow related to the $session-object (of PW). 

How so? PW doesn't use SOAP, as far as I know.

What does the error log say, specifically? Where does the error occur? What code is being executed when the error pops up?

Link to comment
Share on other sites

6 minutes ago, JoshoB said:

How so? PW doesn't use SOAP, as far as I know.

What does the error log say, specifically? Where does the error occur? What code is being executed when the error pops up?

This is my code:

if(!isset($session->sprachen)){
   $action = 'fetchdata/sprachen';
   $resultJson = sendData($webserviceUrl,$action,$params);
   echo "sprachen vom webservice:".$resultJson.'<p>';//correct json string. after the string comes
   //the error message "Unable to load dynamic library '/usr/lib/php/20151012/php_openssl.dll'"
   $session->sprachen = json_decode($resultJson,true);
   echo "json-error-code-sprachen=".json_last_error().'<p>';//here json error 4 occurs (syntax error?!)
   echo "sprachen22:<pre>";print_r($session->sprachen);echo " count-sprachen=".count($session->sprachen)."</pre>";//$session->sprachen is empty!
}
Link to comment
Share on other sites

On 5.10.2017 at 5:24 PM, helmut2509 said:

This is my code:


if(!isset($session->sprachen)){
   $action = 'fetchdata/sprachen';
   $resultJson = sendData($webserviceUrl,$action,$params);
   echo "sprachen vom webservice:".$resultJson.'<p>';//correct json string. after the string comes
   //the error message "Unable to load dynamic library '/usr/lib/php/20151012/php_openssl.dll'"
   $session->sprachen = json_decode($resultJson,true);
   echo "json-error-code-sprachen=".json_last_error().'<p>';//here json error 4 occurs (syntax error?!)
   echo "sprachen22:<pre>";print_r($session->sprachen);echo " count-sprachen=".count($session->sprachen)."</pre>";//$session->sprachen is empty!
}

I found it: there was still another dll-entry in the php.ini I had to comment out. Now it works like a charm.

But I still do not understand, why and where these components have been referenced and why this error  occurred simoultaneously

with a json syntax error...and only sporadically.  very strange! 

Link to comment
Share on other sites

59 minutes ago, helmut2509 said:

But I still do not understand, why and where these components have been referenced and why this error  occurred simoultaneously

with a json syntax error...and only sporadically.  very strange! 

It's likely just the current PHP instance in FastCGI or the Apache child reaching its maximum lifetime. Depending on the web server and how PHP is invoked, a new PHP instance is spun up every so often. The new PHP instance gets loaded, and if error reporting is active, it just coughs this warning into the next output stream. So it has nothing to do with calling soap methods.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...