|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-05-04 02:48 UTC] astinky at lycos dot com
Description: ------------ Re: http://bugs.php.net/bug.php?id=36568 It seems this is not quite fixed. This test script below fails, with no error output and does not echo the memory limit at all. This is on Apache 2.2.2 php 5.1.3 eAcclerator 0.9.5-b2. (tested with eAcclerator disabled - same result) The apache2handler I'm using is self compiled, but I suspect it is not the problem as another server (Windows Server 2003, II6 php 5.1.2 or php 5.1.3 shows similar symptoms) I am using the posted windows binaries for php 5.1.3 and apche 2.2.2 Both servers show an error for the webserver exe in the event log on shutdown with the faulting module varying (php5ts.dll, php_mysql.dll, ntdll.dll, msvcrt.dll...) on previous searches of the bugs here this is always attributed to server misconfiguration. I have been running apache/php for years and am intimately fmiliar with its configuration and have been frustrated by this error appearing in recent php versions. I'm going to take a look at the related php code tomorrow and will reprt any findings I might come up with. I notice previous comments about no support for a memory limit in windows, but I'm sure it worked in php 5.0.5... (tried stting it to -1 which also fails) Thanks for any assistance you can offer. Reproduce code: --------------- <?php echo 'memory_limit: '; ini_set("memory_limit", "32M"); echo ini_get("memory_limit"); ?> Expected result: ---------------- I expect to be able to set the memory limit. (particularly for a script of mine that loads huge arrays from a 2.9 MB tab delimited text file - which worked fine in earler php5 versions but its output is truncated in php 5.1.2 and 5.1.3). I do not expect the webserver to fault on shutdown. Actual result: -------------- Unable to set memory limit, webserver faults on shutdown. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 02:00:01 2025 UTC |
Will do... just gimme a bit to download it, I'm on dial-up here. Extensions in use: extension=php_mbstring.dll extension=php_gd2.dll extension=php_mysql.dll (compiled against libMySQL 5.0.21) extension=php_sockets.dll extension=php_pspell.dll zend_extension_ts="eAccelerator.dll" I get the same result without my build of eAcclerator 0.9.5-b2 (php 5.1.4) loaded, so that is not the cause. Here is the memory intensive portion of the script in question: $shipdatarow = array(); $shipcount = 0; $filename = "shiplist.txt"; $fp=fopen("$filename","rt"); while (($shipdata = fgetcsv($fp, 1569, chr(9))) !== FALSE) { if ($shipdata[0] == $shiprace[$WONlogonsubRace]) { $shipdatarow[$shipcount] = $shipdata; $shipcount++; } } The file shiplist.txt is ~2.9MB in size. I optimised it on an apache-php build on QNX I produced myself a few years ago, as it was originally developed on a windows server when there was no memory limit in php on windows and it needed on optimisation to run in a reasonable memory space under my apache-php build for QNX. Here is the application in place: http://www.dynaverse.net/webmap_op_sql/ however you will not be able to see the shipyards page without a forums login on our site and a character account on the game server. I will zip up the works for you to look at (db passwords and some hostnames and paths removed) Much of the code is from when I first started with php (3.x) so don't laugh too hard... here it is: http://www.dynaverse.net/webmap_op_sql/webmap_togo.zip I must emphasise that I did not have this problem with exactly the same config on php 5.0.5 so I know it is not the script or the extensions I am using. Nevertheless, I will test a stripped down version at home that just opens the text file and loads a portion of it into an array. I'll do this with no extensions loaded. Again it will take me some time to download as I'm on dial-up at home here. To test it on our server I'll need to compile eAccelerator and php_mysql against this snapshot (and it seems you've saved me compiling an apache 2.2 module) However the stripped down test on my home PC will get priority.Well, using this code to test: <?php $shipdatarow = array(); $shipcount = 0; $filename = "shiplist.txt"; $fp=fopen("$filename","rt"); while (($shipdata = fgetcsv($fp, 1569, chr(9))) !== FALSE) { if ($shipdata[0] == "Mirak") { $shipdatarow[$shipcount] = $shipdata; $shipcount++; } } echo $shipdatarow[0][2]; echo '<br><br>'; echo $shipdatarow[$shipcount-1][2]; unset($shipdatarow); ?> I cannot reproduce the crash on either our server or my home PC. However the output of the full script is still truncated on our server. I am using identical configurations on the two machines, the only difference being that our server is running Windows Server 2003 and Symantec Corporate AV (not my choice, I hate Norton with a passion) and I'm running WinXP SP2 at home with no virus scanner. This is still php 5.1.4. I'll now test that snapshot at home and on the server to see the effect on my script and whether or not I can set the memory limit. Its starting to look like I've sent you on a wild goose chase.That snapshot still does not allow setting the memory_limit in either the script or the php.ini. I ran the snapshot as-is at home on WinXP SP2 with no extensions loaded at all. (aside: the apache 2.2 handler still reports itself as "Apache 2.0 Handler") <?php echo 'memory_limit: '; echo ini_get("memory_limit"); ?> <?php echo 'memory_limit: '; ini_set("memory_limit", "32M"); echo ini_get("memory_limit"); ?> Both output only "memory_limit: " with no error generated. My fgetcsv test script does not crash on this version either. I'm kinda baffled at this point. If we get a working memory_limit for php on windows, great, I'll test it on my live shipyards script to see if it is the issue causing it to stop short of completion, if not, I'll have to track down other changes since 5.0.5 that may be causing this issue for me.