23369 Posts in 18145 Topics by 2863 members
|Go to End|
26 November 2011 at 10:00pm
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?
26 November 2011 at 11:26pm
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.
26 November 2011 at 11:34pm
Thank you Simon for your solution, it worked perfectly.
|Go to Top|