Xampp and --enable-memory-limit

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Xampp and --enable-memory-limit

Postby Samad » 10. April 2006 13:29

Hello,

I've installed Xampp for windows but I can't use memory_get_used() function.

According to php doc, I have to install php with --enable-memory-limit, but How can I do this with xampp ??

Anyone can help me ??
thx
Samad
 
Posts: 1
Joined: 10. April 2006 13:05

Postby Wiedmann » 10. April 2006 13:46

"memory_limit" is not availible on Windows (at the moment).
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby babaudus » 05. May 2006 11:39

Wiedmann wrote:"memory_limit" is not availible on Windows (at the moment).


Hi,
Sorry for my poor english. :oops:

It seems that the new version 5.1.3 of PHP has the "--enable_memory_limit" possibility. But the binaries on the php site doesn't have compiled with this tag.

If somebody have a environement for doing this, it is perhaps possible to include this functionality in the future versions of xampp for Windows.

It is very usefull to have this implementation tag because most ISP have memory limit on their "hébergement de page perso". So we can test php script developpement on our computer in same condition of ISP works.

Thank's in advance.
Babaudus
babaudus
 
Posts: 2
Joined: 05. May 2006 11:28

Postby Wiedmann » 19. May 2006 23:19

It seems that the new version 5.1.3 of PHP has the "--enable_memory_limit" possibility. But the binaries on the php site doesn't have compiled with this tag.

You are right. I have build a 5.1.4 with "--enable_memory_limit" and it's really working (with XP, no test with Win9x yet) :-)
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby babaudus » 24. May 2006 20:37

Wiedmann wrote:
It seems that the new version 5.1.3 of PHP has the "--enable_memory_limit" possibility. But the binaries on the php site doesn't have compiled with this tag.

You are right. I have build a 5.1.4 with "--enable_memory_limit" and it's really working (with XP, no test with Win9x yet) :-)


Hi,

Does your built version with "--enable_memory_limit" will be intergrate in the future version of xampp ?

Thank's in advance
Babaudus
babaudus
 
Posts: 2
Joined: 05. May 2006 11:28

Postby Wiedmann » 29. May 2006 15:03

Does your built version with "--enable_memory_limit" will be intergrate in the future version of xampp ?

It don't seam so...

As I can see, the packager havn't use our special build versions (Apache/MySQL/PHP) for the new release XAMPP 1.5.3.
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby Mantucket » 29. May 2006 15:37

I would also like to beg that this be included at some point -- it's hard to do proper profiling when you can't track memory usage. :(
Mantucket
 
Posts: 2
Joined: 29. May 2006 15:32

Postby Naneau » 30. May 2006 13:17

what you are asking for is quite advanced php coding. Also it relies on a relatively new feature of php. There are tools out there that have tracking and debugging options (Zend Studio for instance). You might want to give them a try.

I lifted this of the php site:

Code: Select all
<?php
if( !function_exists('memory_get_usage') )
{
   function memory_get_usage()
   {
       //If its Windows
       //Tested on Win XP Pro SP2. Should work on Win 2003 Server too
       //Doesn't work for 2000
       //If you need it to work for 2000 look at http://us2.php.net/manual/en/function.memory-get-usage.php#54642
       if ( substr(PHP_OS,0,3) == 'WIN')
       {
               if ( substr( PHP_OS, 0, 3 ) == 'WIN' ):
               $output = array();
               exec( 'tasklist /FI "PID eq ' . getmypid() . '" /FO LIST', $output );
     
               return preg_replace( '/[\D]/', '', $output[5] ) * 1024;           
       }else
       {
           //We now assume the OS is UNIX
           //Tested on Mac OS X 10.4.6 and Linux Red Hat Enterprise 4
           //This should work on most UNIX systems
           $pid = getmypid();
           exec("ps -eo%mem,rss,pid | grep $pid", $output);
           $output = explode("  ", $output[0]);
           //rss is given in 1024 byte units
           return $output[1] * 1024;
       }
   }
}
?>


though this may not be an ultimate solution, as it relies on command line tools that are OS-dependent
Naneau
 
Posts: 14
Joined: 18. May 2006 14:45

Postby Mantucket » 31. May 2006 00:15

Thanks Naneau, that might be helpful.

It's not really a solution, though, because it still won't work with Xdebug. All that really has to be done is build PHP with --enable-memory-limit. It isn't worth the trouble of installing the whole toolchain I'd need to compile it myself, or the money for Zend Studio, but it'd be very useful. Wiedmann says it works, so, if it won't adversely affect anything else, please!... :)
Mantucket
 
Posts: 2
Joined: 29. May 2006 15:32


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 115 guests