Hi,
I just moved my site to a new server with php5.2 and am now getting out of memory errors. I was running on php4 with no problems like this.
So I upgraded to the latest si version - no difference.
My php.ini is set at 32M.
I get the following error when trying to generate a pdf invoice (wah! I LOVE that feature)
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77 bytes) in /home/blahblahblah/public_html/simpleinvoices/include/pdf/utils_units.php on line 70
Any suggestions?
Linda
Hey Linda,
hmm. 32M should be more than enoughmemory_limit = 24M ; Maximum amount of memory a script may consume (8MB)
;;;;;;;;;
just double check it is the memory_limit setting in the .ini
anyone else got this issue?
Cheers
Justin
Thanks Justin,
In fact yes, well, I upped it to 64MB and am still getting:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77 bytes) in /home//public_html/simpleinvoices/include/pdf/utils_units.php on line 70
memory_limit = 64M ; Maximum amount of memory a script may consume (8MB)Checking the error log I see the following:
[05-Feb-2008 08:17:36] Guessed: 'http://www.mysite.com/simpleinvoices/./templates/invoices/default/style.css'
[05-Feb-2008 08:17:36] Fetching: http://www.mysite.com/simpleinvoices/./templates/invoices/default/style.css
[05-Feb-2008 08:17:36] Status code:200
[05-Feb-2008 08:17:36] Guessed: 'http://www.mysite.com/simpleinvoices/./templates/invoices/logos/_default_blank_logo.png'
[05-Feb-2008 08:17:36] Fetching: http://www.mysite.com/simpleinvoices/./templates/invoices/logos/_default_blank_logo.png
[05-Feb-2008 08:17:36] Status code:200
[05-Feb-2008 08:17:37] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 24 bytes) in /home/mysite/public_html/simpleinvoices/include/pdf/list-style.image.php on line 13
[04-Feb-2008 12:42:59] Guessed: 'http://www.mysite.com/simpleinvoices/./images/logo/_default_blank_logo.png'
[04-Feb-2008 12:42:59] Fetching: http://www.mysite.com/simpleinvoices/./images/logo/_default_blank_logo.png
[04-Feb-2008 12:42:59] Status code:200
[04-Feb-2008 12:43:00] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77 bytes) in /home/mysite/public_html/simpleinvoices/pdf/css.border.inc.php on line 200
Hey Linda,
probably best to ask Bluehost.com
they may have some special php.ini setup or something
let us know how you go
Cheers
Justin
I am having the same trouble.
My memory limit is set to 32M
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 72 bytes) in /home/***/public_html/invoices/include/pdf/css.margin.inc.php on line 9
I upgraded successfully to the newest version but I still have the same problem.
Hey Arzajac
One thing you can try is to set the values in .htaccess if possible
you can override the default php.ini setting using .htaccess
also may want to check all the memory values in http://yourinstall.com/simpleinvoices/phpinfo.php to ensure there all OK
http://us3.php.net/manual/en/function.ini-set.php#80210
if all else fails ask your host - maybe there are doing some funky thing that overrides your mods to php.ini
let us know how you go
Cheers
Justin
[quote=justin]
also may want to check all the memory values in http://yourinstall.com/simpleinvoices/phpinfo.php to ensure there all OK
I have increased it to 64M. I confirmed that with phpinfo from invoices. I still get the same error (reporting the same problem with 33554432 bytes exhausted) Since you said that 32M should be more than enough, I wonder what the problem would be.
[quote=justin]
if all else fails ask your host - maybe there are doing some funky thing that overrides your mods to php.ini
I asked them, and am waiting for an answer. Do you have any possible idea what the problem could be related to? This trouble appeared all of a sudden. It may be that they upgraded php or changed some settings...
Hey Arzajac,
not really sure, i normally use on 24MB and it works fine - so 32 should work - but who know - your host may have made some changes
was pdf working before?
Cheers
Justin
if it was working fine and you changed nothing then most likely the webhost did something
one thing to try is to do a fresh install of Simple Invoices in a new directory
cheers
justin
I got it working.
My hosting provider mentioned that a php.ini must be present in every subdirectory that requires setting different than the "master" (global) settings. The default memory setting is 32M. I upped the memory to 64M in the /include/pdf subfolder and I got it to work.
Interestingly, the previous settings for php were 24M and everything worked fine then. Perhaps there have been point releases of PHP5 which make some things consume more ram(?)
I experimented and found that I could not generate a pdf with anything less than 35 Megs of ram allocated in the /include/pdf subfolder. All other folders have a limit of 32M.
Please let me know if there is anything else I can tell you about this issue.
Thanks!
Andrew
Thanks Andrew
good to hear its working now!
i'll try using different memory levels on my PC and see how i go -might have to update the docs about this one
Cheers
Justin
[quote=justin]
you can override the default php.ini setting using .htaccess
I'm having the same problem and would like a little more info on how to accomplish this in a more explicit information. I don't know really anything useful about PHP but I can follow the directions of those that do.
hey flatloop
ive never used .htaccess to set php.ini setting but believe its possible
basically add a .htaccess file in your Simple Invoices directory
then you can add the php.ini memory setting in there
ie. memory_limit = 64M
or php memory_limit = 64M
don't know the exact syntax but it'll be something like above
anyone else know the correct way to set php.ini settings via .htaccess?
refer: http://us2.php.net/configuration.changes for more info
Cheers
Justin
256, damn thats alot!!
Cheers
Justin
Hey Linda,
great to hear its working now!!
Thanks again Andrew!
Cheers
Justin
Cichawoda, I just used your trick on the first line of index.php (after the comments) and it worked perfect (i just had to set mine at 256M it failed at 72 then 128 so i just went to 256 and it worked like a champ!) Thanks!
@rednectar With the new version we will have a new PDF library. Then we will need a lot less memory and the problem is gone.
I have read the whole post and apply all the things but still i am getting Fatal errors.
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71 bytes) in /home2/itutilis/public_html/tiger/library/pdf/css.state.class.php on line 99
i have this in php.ini file ( memory_limit=1024M ) still doesn't work.
In index file i have following code below.
ini_set('memory_limit','1024M');
<?php<br />
$host = $_SERVER['HTTP_HOST'];
preg_match("#^(.*)/[^/]*$#", $_SERVER['REQUEST_URI'], $matches);
$uri = $matches[1];
header("Location: http://${host}${uri}/demo/index.php");
?>
Can some one please help me solve this question. thanks