Simple Invoices logo
    • CommentAuthorlvanderb
    • CommentTimeFeb 4th 2008 edited
     permalink
    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
    • CommentAuthorjustin
    • CommentTimeFeb 5th 2008 edited
     permalink
    Hey Linda,

    hmm. 32M should be more than enough

    memory_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
    • CommentAuthorlvanderb
    • CommentTimeFeb 5th 2008 edited
     permalink
    Thanks Justin,

    In fact yes, well, I upped it to 64MB and am still getting:
    [quote]Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77 bytes) in /home/<snipped>/public_html/simpleinvoices/include/pdf/utils_units.php on line 70[/quote]

    However, from the message, it looks like it's set at 32MB.

    I'm hosted with bluehost.com and they do permit use of php.ini, and I'm not sure if I need it in every folder.

    Here's the line in my php.ini
    [code]
    memory_limit = 64M ; Maximum amount of memory a script may consume (8MB)[/code]

    Something weird is going on... I might ask bluehost.com then if nobody else has had this happen.

    Linda
    • CommentAuthorlvanderb
    • CommentTimeFeb 5th 2008 edited
     permalink
    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


    and
    [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


    When I look at my folders - there is no invoices folder
    • CommentAuthorlvanderb
    • CommentTimeFeb 5th 2008 edited
     permalink
    Hi,

    Just ignore that last line - I'm really not sure what the problem is!

    I do have those files, they are returning a 200 code.

    Thanks,
    Linda
    • CommentAuthorjustin
    • CommentTimeFeb 7th 2008 edited
     permalink
    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
    • CommentAuthorarzajac
    • CommentTimeFeb 25th 2008 edited
     permalink
    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.
    • CommentAuthorarzajac
    • CommentTimeFeb 25th 2008 edited
     permalink
    I increased the memory limit by adding an edited php.ini file to the invoices directory, and phpinfo reveals that the memory is indeed 64M, but I still get the same error.

    Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77 bytes)
    • CommentAuthorjustin
    • CommentTimeFeb 25th 2008 edited
     permalink
    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
    • CommentAuthorarzajac
    • CommentTimeFeb 25th 2008 edited
     permalink


    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.


    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...
    • CommentAuthorjustin
    • CommentTimeFeb 26th 2008 edited
     permalink
    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
    • CommentAuthorarzajac
    • CommentTimeFeb 26th 2008 edited
     permalink



    was pdf working before?


    Yes, perfectly fine.
    • CommentAuthorjustin
    • CommentTimeFeb 26th 2008 edited
     permalink
    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
    • CommentAuthorarzajac
    • CommentTimeFeb 27th 2008 edited
     permalink
    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
    • CommentAuthorjustin
    • CommentTimeFeb 27th 2008 edited
     permalink
    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
    •  
      CommentAuthorflatloop
    • CommentTimeMar 17th 2008 edited
     permalink

    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.
    • CommentAuthorjustin
    • CommentTimeMar 19th 2008 edited
     permalink
    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
    • CommentAuthorelghai
    • CommentTimeMar 24th 2008 edited
     permalink
    Hey folks

    I also got the same error. For me the solution was to set the memory limit to 256!! I'm using XAMPP with php 5.2.5
    • CommentAuthorjustin
    • CommentTimeMar 24th 2008 edited
     permalink
    256, damn thats alot!!

    Cheers

    Justin
    • CommentAuthorlvanderb
    • CommentTimeApr 18th 2008 edited
     permalink
    Thanks Andrew, adding a php.ini file into my include/pdf/ folder did the trick for generating pdf files. Woohoo!

    Happy again :)
    Linda
    • CommentAuthorjustin
    • CommentTimeApr 18th 2008 edited
     permalink
    Hey Linda,

    great to hear its working now!!

    Thanks again Andrew!

    Cheers

    Justin