Several ways:

(1) PHP still reads a php.ini file, so you could set it there; try a

        php -i | grep php.ini

to find out where the commandline php thinks it is (and/or do

        php -i | grep memory_limit

to find the default memory limit setting.

(2) You can set it at execution time via the -d command option:

        php -d memory_limit=20M -f yourprogram.php

(3) Set it in your program with the ini_set() command:

        http://php.he.net/manual/en/function.ini-set.php


-steve



At 11:29 PM -0500 9/9/02, Damian Harouff wrote:
>Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
>allocate 53738 bytes) in /var/cli/mp3anal/mp3anal.php on line 68.
>Segmentation fault
>
>This is line 68: while ($found = fscanf ($fp, "%s - - 
>[%[A-Za-z0-9/]:%[0-9:] %[+-0-9]] \"%[A-Z-] %s %[A-Z0-9/.]\" %[0-9-] 
>%[0-9-]\n",
>&$ip, &$date, &$time, &$ofset, &$request, &$file, &$protocol, 
>&$code, &$bytes)) {
>
>Since this is a command line program, is it possible to set the memory
>allocation higher? It's a program to read the mp3 lines out of an apache
>log file.
>
>This is the entire program:
>http://www.cekkent.net/upload/mp3anal/mp3anal.phps
>


-- 
+------------------------------------------------------------------------+
| Steve Edberg                                      [EMAIL PROTECTED] |
| University of California, Davis                          (530)754-9127 |
| Programming/Database/SysAdmin               http://pgfsun.ucdavis.edu/ |
+------------------------------------------------------------------------+
| The end to politics as usual:                                          |
|                 The Monster Raving Loony Party (http://www.omrlp.com/) |
+------------------------------------------------------------------------+

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to