Upload max size in PHP?

The following options are relevant: PHP: upload_max_filesize (in php.ini or .htaccess only, won’t work using ini_set()) PHP: post_max_size (ditto) PHP: max_input_time (ditto, thanks @Thorstein, forgot this one) and possibly Apache: LimitRequestBody

create ini file, write values in PHP

Found following code snippet from the comments of the PHP documentation: function write_ini_file($assoc_arr, $path, $has_sections=FALSE) { $content = “”; if ($has_sections) { foreach ($assoc_arr as $key=>$elem) { $content .= “[“.$key.”]\n”; foreach ($elem as $key2=>$elem2) { if(is_array($elem2)) { for($i=0;$i<count($elem2);$i++) { $content .= $key2.”[] = \””.$elem2[$i].”\”\n”; } } else if($elem2==””) $content .= $key2.” = \n”; else $content … Read more

How to locate the php.ini file (xampp)

For Windows, you can find the file in the C:\xampp\php\php.ini-Folder (Windows) or in the etc-Folder (within the xampp-Folder). Under Linux, most distributions put lampp under /opt/lampp, so the file can be found under /opt/lampp/etc/php.ini. It can be edited using a normal Text-Editor. Clarification: Xampp (X (for “some OS”), Apache, MySQL, Perl, PHP) Lampp (Linux, Apache, … Read more

How to read and write INI file with Python3?

This can be something to start with: import configparser config = configparser.ConfigParser() config.read(‘FILE.INI’) print(config[‘DEFAULT’][‘path’]) # -> “/path/name/” config[‘DEFAULT’][‘path’] = ‘/var/shared/’ # update config[‘DEFAULT’][‘default_message’] = ‘Hey! help me!!’ # create with open(‘FILE.INI’, ‘w’) as configfile: # save config.write(configfile) You can find more at the official configparser documentation.

Reading/writing an INI file

Preface Firstly, read this MSDN blog post on the limitations of INI files. If it suits your needs, read on. This is a concise implementation I wrote, utilising the original Windows P/Invoke, so it is supported by all versions of Windows with .NET installed, (i.e. Windows 98 – Windows 10). I hereby release it into … Read more