Change the upload_max_filesize setting

Discussion in 'PHP' started by sharpweb, Sep 12, 2005.

  1. #1
    Does anyone know how to change this setting without access to the ini file? Perhaps with a .htaccess file?

    Thanks!
     
    sharpweb, Sep 12, 2005 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    ini_set() wouldn't work because the file is already passed to your script within the HTTP request (before the script has a chance to set a new value).

    So your only two options will be php.ini or .htaccess (I'm not sure if upload_max_filesize is something that can be overridden outside of php.ini, but it's worth a try).
     
    digitalpoint, Sep 12, 2005 IP
  3. sharpweb

    sharpweb Guest

    Messages:
    246
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    php_value upload_max_filesize 10485760

    Would that set upload_max_filesize to 10 Mb...assuming it works

    EDIT: didn't work (500 Internal Server Error), does anyone know if this is possible?
     
    sharpweb, Sep 12, 2005 IP
  4. michele

    michele Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you're on shared hosting, i wouldn't be surprised if the ISP went out of their way to make sure you couldn't change this value as it could have dire consequences for server performance. I know I would :)
     
    michele, Sep 20, 2005 IP
  5. INV

    INV Peon

    Messages:
    1,686
    Likes Received:
    101
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you have good hosting, even if it's shared, you can ask that to be changed and they will do it. I did that for a forum I have
     
    INV, Sep 20, 2005 IP
  6. michele

    michele Peon

    Messages:
    30
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I guess if you ask the host and it is reasonable, a good host would do it. But letting users change it themselves is risky.
     
    michele, Sep 20, 2005 IP