How to edit php.ini configuration file for increasing uploading size

Discussion in 'PHP' started by Jalpari, Sep 3, 2009.

  1. #1
    How to edit php.ini configuration file for increasing uploading size

    I import db in wp admin but it says, The uploaded file exceeds the upload_max_filesize directive in php.ini

    So, i need to edit uploading file size in php.ini file, and for doing that i need root access which i do not have because its shared hosting and host says:

    You can modify PHP configuration variables if required by modifying a local copy of the php.ini configuration file.

    Checking php.ini file step is ok but when comes to editing php.ini file then how i can do when i can not see /usr/lib dir. i think its only viewable for server admin :confused:
     
    Jalpari, Sep 3, 2009 IP
  2. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Add:

    
    upload_max_filesize = **M ;
    post_max_size = **M ;
    
    Code (markup):
    You may also want to increase your max_execution_time, max_input_time and memory_limit.
     
    premiumscripts, Sep 3, 2009 IP
  3. Jalpari

    Jalpari Notable Member

    Messages:
    5,640
    Likes Received:
    137
    Best Answers:
    0
    Trophy Points:
    260
    #3
    but how to make php.ini file writable in browser :rolleyes:
     
    Jalpari, Sep 3, 2009 IP
  4. premiumscripts

    premiumscripts Peon

    Messages:
    1,062
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Err, that isn't possible.. You may want to try and put it in the .htaccess file instead...

    php_value post_max_size "20M"
    php_value upload_max_filesize "20M"
    Code (markup):
     
    premiumscripts, Sep 3, 2009 IP
  5. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #5
    Some host like hostgator allow u to edit php.ini and some host allow u to have a php.ini file in the root and it will overwrite the permissions
     
    Bohra, Sep 3, 2009 IP
  6. jamespv85

    jamespv85 Peon

    Messages:
    238
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Yeah there are different setups in hosting environments. The .htacess way is your best bet.

    Have you tried cutting it up into pieces so you can upload it in small parts? Unless it's like gigabytes big, then that indeed would be an issue.

    Can you connect to your remote DB directly?

    How about making a script that would take in values and insert it to your db on that shared hosting. You can run a script to automate it. Overnight, I think that would be done.
     
    jamespv85, Sep 3, 2009 IP
  7. Jalpari

    Jalpari Notable Member

    Messages:
    5,640
    Likes Received:
    137
    Best Answers:
    0
    Trophy Points:
    260
    #7
    Site5 . they says, Please read http://forums.site5.com/showthread.php?t=3689 for more information on how to create a custom php.ini file. You don't need a root access for this.

    executing .php file, adding uploading size and changing permission is ok
    but two statements r confusing ,

    and here Script to create a custom php.ini file file name is php_ini.php now :rolleyes:
     
    Jalpari, Sep 3, 2009 IP
  8. jamespv85

    jamespv85 Peon

    Messages:
    238
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I think #1 is saying that in order for your modifications to take effect, you must put your custom php.ini in places where you would want the changes, otherwise it would default to the server wide php settings if it can't read/find the custom php.ini file.

    #2 is saying that all the things you would normally see in the server wide php.ini file must be in your custom php.ini, otherwise you would lose all the other changes that was done to the former.

    this tutorial looks like it's just specific to one site/host.
     
    jamespv85, Sep 3, 2009 IP
  9. nataliarocon

    nataliarocon Well-Known Member

    Messages:
    199
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    #9
    for increasing uploading size: 100 MB


    ; Maximum allowed size for uploaded files.
    upload_max_filesize = 100M

    ; Maximum size of POST data that PHP will accept.
    post_max_size = 100M

    max_execution_time = 900 ; Maximum execution time of each script, in seconds
    max_input_time = 900 ; Maximum amount of time each script may spend parsing request data
    memory_limit = 25000M ; Maximum amount of memory a script may consume (16MB)
     
    nataliarocon, Sep 3, 2009 IP