Hi,
I’m using MODx 0.9.5 and I’m very glad about this software. Till now everything works very fine. But recently I’ve got a serious problem that I can’t solve myself.
The problem:
Inside a snippet I update a self created table. On development server the snippet works fine. On production server the snippet causes a php error on this part of the snippet-code:
$query = 'UPDATE `tix__mob_ratesdata` SET'.
' `ratename`=\''.uml($_POST["ratename"]).'\','.
' `artnumber`=\''.$_POST["artnumber"].'\','.
' `networkid`=\''.$_POST["networkid"].'\','.
' `validto`=\''.$_POST["validto"].'\','.
' `validfrom`=\''.$_POST["validfrom"].'\','.
' `deeplink`=\''.$_POST["deeplink"].'\','.
' `mobiletype`=\''.$_POST["mobiletypeid"].'\','.
' `minpricemobile`=\''.str_replace(',', '.', $_POST["minpricemobile"]).'\','.
' `billtype`=\''.$_POST["billtype"].'\','.
' `contracttype`=\''.$contracttypestring.'\','.
' `contractterm`=\''.$_POST["contractterm"].'\','.
' `timingdevice`=\''.uml($_POST["timingdevice"]).'\','.
' `infolink`=\''.$_POST["infolink"].'\','.
' `minusesmsincl`=\''.$_POST["minusesmsincl"].'\','.
' `fixedprice`=\''.str_replace(',', '.', $_POST["fixedprice"]).'\','.
' `minuse`=\''.str_replace(',', '.', $_POST["minuse"]).'\','.
' `allinclminutes`=\''.$_POST["allinclminutes"].'\','.
' `owninclminutes`=\''.$_POST["owninclminutes"].'\','.
' `owninclminfixednet`=\''.$_POST["owninclminfixednet"].'\','.
' `priceonwayworkdayfixednetwork`=\''.str_replace(',', '.', $_POST["priceonwayworkdayfixednetwork"]).'\','.
' `priceonwayworkdayownnetwork`=\''.str_replace(',', '.', $_POST["priceonwayworkdayownnetwork"]).'\','.
' `priceonwayworkdayothernetworks`=\''.str_replace(',', '.', $_POST["priceonwayworkdayothernetworks"]).'\','.
' `rateremark`=\''.uml($_POST["rateremark"]).'\','.
' `rateonlineadvantage`=\''.uml($_POST["rateonlineadvantage"]).'\''.
' WHERE `providerid`='.$_POST["providerid"].' AND `id`='.$_POST["rateid"];
$dbresult = $modx->dbQuery($query);
The php-error is all the time:
PHP Fatal error: Out of memory (allocated 1016856576) (tried to allocate 335618727 bytes) in \manager\includes\document.parser.class.inc.php on line 1289
The line 1289 in the document.parser is:
$msg= mysql_escape_string($msg);
I already tried to do:
1.
After several checks of the php.ini settings I used the php.ini (production) from the production server on my development server. The snippet works fine on development server although the php.ini is the same like on production server. So I believe php-settings can’t cause the error.
2.
When I decrease the number of table cells to update in the snippet, then the snippet is working on production server too.
(So the workaround is to split the update command into several update commands and it is working. But this is not satisfying me).
3.
According to php.net ‘mysql_escape_string’ is old and should be replaced by mysql_real_escape_string’. Unfortunately I couldn’t try this till now because I would need to change this on the production server inside the document.parser. (Remember: On development server everything works fine). I’ll set up a backup-website on the production server soon and then I’ll try this there.
Could anyone provide some additional ideas for help?
Last but not least some environmental data of the production server:
PHP Version 5.2.0
MySQL Version 5.0.22
Apache Version: 2.0.59
Operating System: Windows NT 5.2 build 3790 (WIN2k3 SP2) but also didn’t work on SP1
Client OS or Browser doesn’t matter to this error
MODx Version 0.9.5
No Changes made in MODx files
No Plugins called
On Development Server I’m using XAMPP 1.5.4 (Apache 2.2.3, PHP 5.1.6, MySQL 5.0.24a)