PHP NuSOAP - Allowed memory size of error XXXXXX

PHP is connected to SOAP between NuSOAP and I can recieve data from PHP. After getting data, I get timeout error because of data size is huge which is received. You can see xdebug print out on below.I can run same service using PHP native SOAP command.

I am using following settings. I can not get a solution about the above error although I increased maximum limit as possible as much.

ini_set('memory_limit', "512M");
ini_set('max_execution_time', 60000); //x saniye
ini_set("display_errors", 1);
ini_set("max_input_time ", 6000);

Open in new window

I am waiting your solution about this issue urgently. Thank for your support.

Edit: My NuSOAP client function:

function nusoapCall($method,$params,$returnType="array"){
    global $WSDLURL,$debugMode;
    $soapClient = new nusoap_client($WSDLURL, 'wsdl');
    $soapClient->soap_defencoding = 'UTF-8';
    $soapClient->decode_utf8 = false;
    $soapClient->setCurlOption(CURLOPT_CONNECTTIMEOUT, 60);
    if($debugMode == 1){
        $soapClient->debug_flag = false;

    $tResult = $soapClient->call( $method,$params);
        $tResult = array_to_object($tResult);

    $soapError = $soapClient->getError();
    echo $soapClient->getDebug();
    if (!empty($soapError)) {

        $errorMessage = 'Nusoap object creation failed: ' . $soapError;
        throw new Exception($errorMessage);
        return false;
        return $tResult;

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ultimately, if you're trying to solve the time-out, just add set_time_limit(0); to the top of your script. However, that will not resolve data size issues, so if you're running out of memory, the only thing to do is either request less data per SOAP call (if that applies here), or increase the memory limit further.
benchpresserAuthor Commented:
Firstly I want to say thanks for your answer gr8gonzo.
Unfortunately, I get the same error despite using site_time_limit(0). However, it is so weird I can take same size data with using Php native SOAP command. In here the reason I didn’t use Php native SOAP command is the connection has some problem uncertain frequency and can not take data. NuSOAP is perfect I have no connection problem and also other problems. It is so clear and usebility but only problem is memory_limit error. I have to solve this problem.
Thanks for your support.
set_time_limit, not site_time_limit. Double-check the spelling...
OWASP: Avoiding Hacker Tricks

Learn to build secure applications from the mindset of the hacker and avoid being exploited.

benchpresserAuthor Commented:
sorry :) I mean using set_time_limit(0) replace to using site_time_limit(0)
Okay, so your original description states:
"After getting data, I get timeout error"...

Are you talking about the "Allowed memory size of error XXXXXX" error message in the title? If so, that is not a timeout error, that is a memory limit error. Very different errors, so I just want to make sure we're on the same page.

Also, there's not much you can do about memory limits except try to increase the value in php.ini. The site can usually make use of virtual memory to go past the physical memory limit, but it works a little slower.

As I said before, you can also try to reduce the amount of data you're requesting (e.g. if you are querying a web service for 1000 pieces of data, try querying them in 100 pieces at a time, and just do 10 queries to get all 1000). Aside from that, there's not much you can do.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Following up. What's the verdict?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.