Ways to increase various memory, runtime and filesize limits for a PmWiki installation.
These instructions allow PmWiki to handle larger files and larger or more complex wiki pages. For example, while processing large PageLists, PmWiki reads the files and collects the data, sorts the data and renders the page to the browser, this may require more time and memory. Rendering large page histories too. With a gallery recipe generating a thumbnail, the larger the original picture, the more time and memory will be needed.
The configuration can be done in one of these files:
The last four options may not be available for some or most shared hosting plans.
You can see all possible PHP directives.
Set near the beginning of pmwiki/local/config.php something like this:
ini_set('memory_limit', '64M'); ini_set('max_execution_time', 60); ini_set('post_max_size', '12M'); # may not work in some cases ini_set('upload_max_filesize', '10M'); # may not work in some cases
The values 64M, 12M and 10M are in megabytes (you can change them). The value 60 for max_execution_time is in seconds.
.htaccess or httpd.conf
The file httpd.conf can be located with other program files of the Apache server installation. Refer to your system documentation to find it. On most shared hosting plans, admins cannot edit their httpd.conf file.
The file .htaccess can be located in the directory with pmwiki.php or index.php. If it doesn't exist, you can create it; note that this usually is a "hidden" file and you may need to configure your file/FTP browser to show hidden files. On some hosting plans, this configuration may not work: if you see an "internal server error", just remove them and try the config.php section.
The format for both files is the same.
php_value memory_limit 64M php_value post_max_size 12M php_value upload_max_filesize 10M php_value max_execution_time 60
These lines can be anywhere in a .htaccess file. In a httpd.conf file, they should be inside <VirtualHost *></VirtualHost> or <Directory /path/to/htdocs></Directory> blocks.
After you change httpd.conf, you may have restart the server.
php.ini or .user.ini
The file php.ini can be located with other program files of the PHP installation, or in a directory conf.d of the server installation, or in the directories /etc/php5/cgi or /etc/php5/apache2. Refer to your system documentation to find it. On most shared hosting plans, admins cannot edit their php.ini file.
The file .user.ini can be located in the directory with pmwiki.php or index.php. If it doesn't exist, you can create it; note that this usually is a "hidden" file and you may need to configure your file/FTP browser to show hidden files. This file will only work for PHP version 5.3 or newer, and in a CGI/FastCGI environment.
The format for both files is the same. In php.ini the directives already exist and you can find them and change their values, in .user.ini you may need to add the full lines:
memory_limit = 64M post_max_size = 12M upload_max_filesize = 10M max_execution_time = 60
After you change php.ini, you may have restart the server.