Portal Home > Knowledgebase > PHP > Custom php.ini


Custom php.ini


If you see an error such as Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 23456789 bytes) in somefile.php you have hit your memory limit.

Below is a guide on how to setup your own php.ini. If you want us to set up your php.ini for you please submit a ticket to support

 
1. Login to your account via SSH. If you do not have an account please submit a ticket to support with your picture ID for verification.
 
2. Next, we need to copy the default php.ini file into our home directory with the following command:
 
cp /usr/local/lib/php.ini ~/php.ini
 
3. We now need to tell the web server where it should look for our custom php.ini file. This can easily be setup with the following command (you don’t need to edit this command at all, just run it):
echo "SuPHP_ConfigPath $HOME" >> ~/public_html/.htaccess
 
If you already have a .htaccess file in your public_html directory, make sure that the command placed the SuPHP details on a NEW line inside the file. You may also want to move it to the top of the htaccess file.
 
4. You can then edit your php.ini file and make the necessary customization. Any changes you make to your php.ini file will occur immediately and never require a web server restart.
 
An easy way to edit your new php.ini file is to use either a FTP/SFTP client.

We do set the maximum memory limit at 256 MB for our Magento package (268,435,456 bytes). If you want to go higher, you will need a to contact support.

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article