Need more memory and want to change maximum file upload size

My host allows me to change these settings by going in and editing the php.ini file but the support instructions to editing or creating these files comes with a warning that it is advanced and to use at your own risk with no support by tech support. Hmmmmm... I am a bit worried about going in and breaking my site.
I've already tried the normal routes like changing the wp-config file and htaccess file so it looks like php.ini is the only way. I can't find this file on the server using ftp and I have already checked that there are not any hidden files. How do I find this php.ini file or create one correctly?

  • Vaughan


    You can sometimes just create a file called php.ini and upload it your domains root folder.

    if you can edit the php.ini from your cpanel it's easier, your host should be able to give you instructions on how to edit or add the php.ini.

    The lines you would want to add are:

    memory_limit = 256M
    upload_max_filesize = 200M

    This might help.

    Hope this helps

  • Leslie

    Hi there, Thanks for your response so soon.

    Below in italics are the instructions from my host: What is the difference between a php.ini and a phprc file and which one do I create? I have php/5.3

    Not sure how to create this file using cpanel at all. do I go into phpmyadmin and access the database and what do I do when I get there?

    If I use ftp which I am more comfortable with, where do I put the php.ini file? root? is that wp-admin or the level before before that? and does this php.ini file need more than just this short code snippet regarding the memory changes? I've already tried adding a php.ini to wp admin with no results but what do I name it? I did not add the dot before php so is that what I missed?


    Setting up a phprc file that is used by all the sites hosted under a user is easy to do.
    To setup a phprc file, start by creating the folders for the custom settings file using the shell or an FTP program.
    Create a new folder named .php in your user's home directory /home/USERNAME/.
    Note: This folder name starts with a '.' or dot, and if you're using an FTP program you may need to turn on "view hidden files and folders" to see it after you create it (for more information about that check out FTP#How do I show hidden files?.
    Inside that create another folder based on what version of PHP you're using (either 5.3 or 5.4).
    The shell command for 5.3 is:
    mkdir -p ~/.php/5.3
    The shell command for 5.4 is:
    mkdir -p ~/.php/5.4
    Inside all those folders, /home/USERNAME/.php/PHP_VERSION_NUM/, create a new text file named phprc.
    Note: Make sure that's the exact name, with no file extension. This phprc file is where you will put all your custom PHP settings.
    phprc and php.ini

    Anything set in both phprc and php.ini:
    uses the phprc values, while
    everything else uses the values set in php.ini.
    It's an easy way to change what you want and ignore the rest.
    You can also:
    use different phprcs for each domain.
    use a phprc to test out new configurations and eventually move them to php.ini.
    edit php.ini directly.
    Replacing the system php.ini entirely

    To replace the system php.ini entirely:
    Create a file under .php/5.3/ (or .php/5.4/) named php.ini (make sure you know which version of PHP you're working with).
    Note: If this file exists, PHP will not read the system php.ini at all, so you should probably start by copying /etc/php53/php.ini or /etc/php54/php.ini as a starting point. In most cases, this file is not necessary. Please use a phprc if at all possible.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.