cpanel The uploaded file exceeds the upload_max_filesize directive in php.ini

We just moved our shared hosting from GoDaddy’s linux hosting to the new cPanel hosting. I am trying to move over my websites and the wordpress ones work fine, until I try to upload new media.

No matter what I do the error is always:
The uploaded file exceeds the upload_max_filesize directive in php.ini.

Read More

To migrate my site, I did the following:

  1. Exported my Database.
  2. Created a database in the new host (cPanel)
  3. Then I imported the database
  4. I corrected the wp-config file
  5. I uploaded all my files on to the correct folder for that site.

The website works fine and looks fine. Until I try to upload the images.

Solutions tried
1. created a php.ini and pasted – upload_max_filesize = 100M
memory_limit = 200M
post_max_size = 300MB
2. tried it by renaming to php5.ini
3. tried changing the .htaccessfile
4. tried talking to godaddy that basically said its nothing on their side and they dont know what to do

I am frustrated I do not understand what created this issue and why it refuses to work.

Related posts

3 comments

  1. Are you trying to upload the new media via WordPress? Please try via FTP.

    Option 3 – Try uploading files via FTP.


    You’ve already tried Options 1 and 2.

    Option 1 – Find php.ini and change:

    ; Maximum allowed size for uploaded files.
    ; http://php.net/upload-max-filesize
    upload_max_filesize = 2M
    

    Option 2 – Try asking your hosting provider to increase the php memory limit for you.

  2. I started a fresh cPanel (reset everything).
    I used the wordpress APP to install my first add on domain (I am yet to confirm if this is the real reason it works)

    I think what fixed it was that I created a php.ini *if you have cPanel the file has to be php.ini (not php5.ini) + the .user.ini file
    [keep in mind I had tried this step before but I do not know why it was not reading it and accepting it]

    files_upload = On
    post_max_size = 200M
    upload_max_filesize = 100M 
    

    in both the .ini files

    and used kill processes (which never actually showed any processes)

  3. you can try forcing this in your themes function.php with

    @ini_set( 'upload_max_size' , '64M' );
    @ini_set( 'post_max_size', '64M');
    

Comments are closed.