PHP + SOAP memory allocation problem

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
billymartin
Forum Newbie
Posts: 2
Joined: Tue Dec 15, 2009 2:16 pm

PHP + SOAP memory allocation problem

Post by billymartin »

I have a script that needs to load a big array using SOAP. I get the following error:

Fatal error: Uncaught SoapFault exception: [SOAP-ENV:Server] Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes)

So the array is probably to big, but I need that data, so I need to allocate more memory for SOAP. Now this is the problem. I thought I could just do that by the PHP variable memory_limit. Strange as it seems, this indeed increases the memory for PHP, but not for the SOAP extension.

When I set memory_limit to 512MB, the error stays the same and when I set it to 32MB, it also stays the same.

This is the script that casues the error:

Code: Select all

$soapurl = 'http://www.domein.nl/api/soap/?wsdl'; 
$soapuser = 'user'; 
$soappassword = 'pass'; 
$proxy = new SoapClient($soapurl, array("user_agent"=>"PHP-SOAP/php-version")); 
$sessionId = $proxy->login($soapuser, $soappassword); 
 
print 'MEMORY LIMIT = '.ini_get('memory_limit').'<br />'; 
 
$filters = array('created_at' => array('gt'=>'2009-10-01')); 
$orders = $proxy->call($sessionId, 'sales_order.list', array($filters));
Anybody any ideas?

PHP 5.2.11

'./configure' '--prefix=/usr/local/php5' '--enable-force-cgi-redirect' '--enable-fastcgi' '--withconfig-file-path=/etc/php5/cgi' '--with-curl=/usr/local/lib' '--with-gd' '--with-gettext' '--with-jpegdir=/usr/local/lib' '--with-freetype' '--with-freetype-dir=/usr/local/lib' '--with-kerberos' '--withmcrypt' '--with-mhash' '--with-mysql=/usr' '--with-mysqli=/usr/bin/mysql_config' '--with-pear' '--with-png-dir=/usr/local/lib' '--enable-xml' '--with-xmlrpc' '--with-imap' '--with-imap-ssl' '--withxsl' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--enable-zip' '--with-openssl' '--withiconv=/usr/local' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-track-vars' '--enable-mbstring' '--enable-gd-native-ttf' '--enablesoap'
billymartin
Forum Newbie
Posts: 2
Joined: Tue Dec 15, 2009 2:16 pm

Re: PHP + SOAP memory allocation problem

Post by billymartin »

Solved. Took me a while, but it's the setting on the soap-server side, not the client side (where the script runs).
jgoulet
Forum Newbie
Posts: 1
Joined: Wed Jan 13, 2010 1:04 pm

Re: PHP + SOAP memory allocation problem

Post by jgoulet »

Billy Martin

Would you please indication how/where the setting on the soap-server side, not the client side is 'adjusted'

TIA
Jerry
Post Reply