none
Adjust php.ini settings ( or equivalent ) in Azure Website Preview.

    Question

  • How can I make adjustments to settings that would normally be found in the php.ini file on an Apache server in the Azure Website environment? Specifically speaking, I need to raise the 2MB max upload size.
    Friday, June 08, 2012 8:46 PM

Answers

All replies

  • Hi Spencer,

    Unfortunately, we do not support custom PHP settings at this point. We are considering custom PHP.INI support for future release.

    AJ


    Apurva Joshi, This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, June 08, 2012 9:24 PM
    Owner
  • So there is no way to increase the max upload size of 2MB?
    Friday, June 08, 2012 9:31 PM
  • Unfortunately, there is no workaround to this today.

    Apurva Joshi, This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, June 08, 2012 10:02 PM
    Owner
  • With that very low upload limit, any suggestion on how to load backups of posts & comments from an existing Wordpress site?

    Saturday, June 09, 2012 2:04 PM
  • Azure Websites viability as a candidate for hosting of an enterprise level WordPress site goes out the window with this limit. Moreover, this cripples many CMS apps built on PHP that are deployable to Azure. Your awesome technology starts to resemble a really cool toy without access to these fundamental settings. Has this feature been put on the roadmap for a specific release date?
    Saturday, June 09, 2012 3:32 PM
  • Hi Spencer,

    We are aware of the specific issue you have identified, and it is something we are considering for a future release.

    Thanks!

    Ryan

    Saturday, June 09, 2012 3:41 PM
    Owner
  • Have you tried using set_ini to adjust upload limits?
    Friday, June 15, 2012 9:29 PM
    Owner
  • I would really appreciate if you could tell me how to use set_ini with a wordpress site. A lot of MS demos for Azure were talking about not needing to write code for setup, etc. But how is a normal person supposed to get their themes working? I'm trying to figure out how this was overlooked.

    Friday, June 15, 2012 9:40 PM
  • Can you please try something like,

    <?php
    echo ini_get('display_errors');

    if (!ini_get('display_errors')) {
        ini_set('display_errors', 1);
    }

    echo ini_get('display_errors');
    ?>

    You can try and replace 'display_errors' with  'upload_max_filesize' and appropriate value if you like.

    Please let me know if this works. Sorry away from actual computer to try this out myself.

    Thanks,

    AJ


    Apurva Joshi, This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, June 15, 2012 10:00 PM
    Owner
  • I tried. It stayed at 2M.
    Friday, June 15, 2012 10:10 PM
  • As per PHP.NET this setting is changeable PERDIR (PHP_INI_PERDIR)

    http://www.php.net/manual/en/ini.list.php

    Therefore it may not be set using ini_set().

    From http://www.php.net/manual/en/configuration.changes.modes.php

    Where a configuration setting may be set

       These modes determine when and where a PHP directive may or may not   be set, and each directive within the manual refers to one of these   modes. For example, some settings may be set within a PHP script   using ini_set(), whereas others may require   <var class="filename">php.ini</var> or <var class="filename">httpd.conf</var>. 

       For example, the   output_buffering setting   is PHP_INI_PERDIR therefore it may not be set using   ini_set(). However, the   display_errors directive is   PHP_INI_ALL therefore it may be set anywhere,   including with ini_set().


    Apurva Joshi, This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, June 15, 2012 10:36 PM
    Owner
  • So we aren't able to change it since we don't have access to php.ini.
    Friday, June 15, 2012 10:41 PM
  • Unfortunately it seems this way. Again, we are working on enabling custom PHP INI support in future releases.

    Apurva Joshi, This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, June 15, 2012 10:48 PM
    Owner
  • Since this is a preview of new features you shall be forgiven.. ;)

    Upload limit 2M ... Thats a complete nogo! Please change to 5MB at least. 

    And please check upload_max_filesize and post_max_size  at the same time too..



    Thursday, June 21, 2012 2:35 PM
  • That virtually makes WordPress on Windows Azure unusable for web sites that want to go beyond just a blog.

    I tried to install S2Member (www.s2member.com) and hit the 2M limit.

    That's really a bummer.


    Raphael Londner - www.riolinx.com

    Friday, June 22, 2012 8:05 PM
  • Even at 5MB, you can forget importing an existing site with even a small amount of posts. Of course, you could always modify the WordPress importer to handle files already on the server and then upload them via FTP. :D
    Friday, July 27, 2012 5:18 PM
  • basically, upload a .user.ini file to root folder of your web site which contains following line;

    upload_max_filesize = 10M

    Fatih Boy

    Visual C# MVP

    http://www.enterprisecoding.com

    http://twitter.com/fatihboy

    Sunday, July 29, 2012 10:01 AM
  • Thanks, Fatih Boy. That method allows you to increase the max upload file size alright. However, there appears to be a hard limit of 8MB on the Azure Websites Instance. Better, but still no good. :(
    Monday, July 30, 2012 8:05 PM
  • A workaround for a wordpress import is to use a tool called WXR File Splitter. It will take your exported xml and split it into multiple files. That way you can upload one at a time under the 2mb limit.
    Tuesday, July 31, 2012 8:24 PM
  • A workaround for a wordpress import is to use a tool called WXR File Splitter. It will take your exported xml and split it into multiple files. That way you can upload one at a time under the 2mb limit.

    True, but this is still not very feasible for a site with a huge number of posts. For instance, 1.5GB of site data and we're up to no less than 750 individual files. For everyone of those files, you'll need to be sure the authors are mapped correctly and the import doesn't foul up. What a nightmare! Even at a max upload size of 8MB, you'll still have over 187 individual files to deal with. It can be done, but I'd just like to see that upload size increase. :D

    Small blogs should be fine with this route, though.

    Wednesday, August 01, 2012 5:31 PM
  • Easy one! Just download the wp-config.php from Windows Azure and grab the connection string. Export your old database with something like MySql WorkBench and run the SQL on your Windows Azure database. I've just did that and it works like a charm.

    Cheers!

    Thursday, August 30, 2012 1:48 PM
  • Thanks, Fatih Boy, I tried this option -- uploaded a .user.ini file to the root with the line you give, and it's proceeding to upload the file.

    Cheers,




    • Edited by Jeff Stucker Tuesday, September 11, 2012 4:36 AM
    Tuesday, September 11, 2012 3:48 AM
  • basically, upload a .user.ini file to root folder of your web site which contains following line;

    upload_max_filesize = 10M

    Fatih Boy

    Visual C# MVP

    http://www.enterprisecoding.com

    http://twitter.com/fatihboy


    Fatih Boy! Thanks! This worked!!!

    http://blog.camantrix.com/sharepoint

    Thursday, October 25, 2012 9:39 AM
  • Wonderful!!  Thanks worked for me...

    - GB

    Monday, October 29, 2012 11:29 AM
  • basically, upload a .user.ini file to root folder of your web site which contains following line;

    upload_max_filesize = 10M

    Fatih Boy

    Visual C# MVP

    http://www.enterprisecoding.com

    http://twitter.com/fatihboy


    Worked for me too! Thanks!
    Tuesday, November 20, 2012 2:47 PM
  • The solution mentioned above did worked for me. Thanks for the POST!

    I like to add a REF to another issue that is likely to happen if you encounter the upload_max_filesize scenario out of Windows Azure Joomla hosted site, which is the /logs (Log directory)Unwritable and /tmp (Temp directory)Unwritable issue when you attempt to upload a module/component/template/plugin, etc to your joomla website. The solution for the unwritable issue is available here: http://social.msdn.microsoft.com/Forums/en-US/windowsazurewebsitespreview/thread/2701eadc-9977-46ab-9c56-81a2234bdce4

    Thursday, February 14, 2013 12:26 AM
  • Thank you Fatih Boy - much appreciated! This simple "fix" worked perfectly for my needs [uploading a 2.7 MB theme file] just now on WordPress version 3.5.1, PHP 5.3 and Azure Web Sites Preview.

    Spencer, Juan, Linard, Raphael and the rest of the folks who find the 2MB limit to be impractical for anything but tinkering with WordPress on Azure... I couldn't agree more!

    Apurva or other Azure team members, is this still under consideration, or has it moved onto the roadmap?

    Wednesday, May 08, 2013 9:57 AM
  • amazing! this should be marked as the answer!!!!

    gChao

    Sunday, May 12, 2013 11:27 AM
  • Spencer and I discovered that the user.ini file actually needs to contain two settings in order to break through the 8MB limit...

    upload_max_filesize = 1000MB
    post_max_size = 1000MB
    We've been able to upload import files into WordPress that are well over 100MB in size with these values.

    • Proposed as answer by PatrickBates Thursday, May 30, 2013 4:03 PM
    Thursday, May 30, 2013 4:02 PM
  • Hi.  this is a simple question I am hoping you will be able to help with.

    What are the step by step instructions of actually uploading the user.in file? 

    How do I get to do it?

    Friday, May 31, 2013 1:22 PM
  • I'd also like step by step instructions for this, please. Thank you!
    Friday, October 04, 2013 9:09 AM
  • Same here, Unable to figure it out.

    Can someone help us with that? It makes us 3 people trying to work this through.


    Bigdata1.org

    Friday, October 11, 2013 12:58 AM
  • Are you using WebMatrix to manage your Azure Web Site?  If so, you might try this:

    Create a new text (TXT) file named user.txt in the root of your site.

    Add the lines to it.

    Rename it user.ini

    Friday, October 11, 2013 2:03 AM
  • Yes i tried and i got an error saying it has exceeded the php size.


    Bigdata1.org

    Friday, October 11, 2013 9:27 PM
  • I think I had a typo in my post.  Try naming the file

    .user.ini

    Note the leading period.

    Friday, October 11, 2013 11:18 PM
  • hello AJ

    Is this resolved?

    How do we custom the php.ini file?

    Saturday, October 22, 2016 5:37 PM