Jump to:

23369 Posts in 18145 Topics by 2863 members

General Questions

SilverStripe Forums » General Questions » Php.ini ignored

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 582 Views
  • paradigm
    Avatar
    Community Member
    5 Posts

    Php.ini ignored Link to this post

    Hi,

    when I access a page without mod_rewrite (e.g. "/index.php/about-us") the correct php.ini - in the root of the Silverstripe site - is loaded and enough memory is allowed for the site to run. However if I just access "/about-us" the default php.ini for the hosting account is read and the site will error with a memory exhausted fatal error.

    I am using a shared web host (CPanel) and am at a complete loss as to why it would be loaded in all cases except when using mod_rewrite.

    Has anyone encountered this issue and found a workaround for it?

    Thanks,
    David.

  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Re: Php.ini ignored Link to this post

    From http://php.net/manual/en/configuration.file.per-user.php:
    In addition to the main php.ini file, PHP scans for INI files in each directory, starting with the directory of the requested PHP file, and working its way up to the current document root (as set in $_SERVER['DOCUMENT_ROOT']). In case the PHP file is outside the document root, only its directory is scanned.

    In many shared hosting environments, this is the case. As the mod_rewrite rules handle the request to sapphire/main.php, PHP will only look for a user ini file in sapphire.

  • paradigm
    Avatar
    Community Member
    5 Posts

    Re: Php.ini ignored Link to this post

    Thank you Simon for your solution, it worked perfectly.

    -David.

    582 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.