Installing and upgrading help
where is php.ini for the windows Xampp server?
- ◄ Missing forum images
- Can not initialise PHP session ►
I just downloaded the Windows Xampp installer and I'm trying to restore a course. I need to increase the allowable file upload size. I went to C:\moodle\server\php\php.ini and made the change from 20M to 200M. However, in Moodle I go to site administration - server - php info and it says that max_upload_filesize is 32M. As well, in the php info, for Loaded Configuration File, it has C:\moodle\server\php\php.ini so I don't understand where the 32M is coming from.
Moodle 3.9.1
Hi Doug, C:\moodle\server\php\php.ini is the correct location for your installation of Moodle. To be able to
upload files larger than 32 MB, you actually need to change 2 settings in php.ini. It's not a Moodle specific thing but a PHP requirement. The two settings in your php.ini should be set to identical values (128 MB in this example) upload_max_filesize = 128M After making the change, you must stop and restart your
Moodle/Apache server for the changes to take effect. By default, Moodle will automatically accept these settings and use them. However, if you ever changed the maximum uploaded file size setting in Moodle, it may now be limiting your maximum upload size. You might
need to go into Moodle's settings and update the maximum uploaded file size by navigating to: Site administration > Security > Site security settings > Maximum uploaded file size If you don't need to change it, don't even save this setting in Moodle unless you want to make it lower than Apache/PHP's maximum that you set above. For more information on adjusting the maximum upload size,
see:
post_max_size = 128M
//docs.moodle.org/en/File_upload_size
Best regards,
Michael Milette
Hello, I have both upload_max_filesize and post_max_size set to 128M and then restarted my computer. However, in my server php settings, Site administration > Server > PHP info > Maximum uploaded file size still says the upload_max_filesize is
32M. The post_max_size is now 128M I then went to the XAMPP control panel, clicked on the apache config button, clicked php.ini and it is showing the setting upload_max_filesize 128M I then went to Site administration > Security > Site security settings > Maximum uploaded file size and it is set to 32MB. This is the largest value I can pick from a dropdown box. It seems to me that this unchangeable setting is overriding my php.ini.
I'm using the windows installer so I don't think I have a separate Apache server to restart. I start and stop Xampp.
- ◄ Missing forum images
- Can not initialise PHP session ►
Altrea wrote:Hi,
What is the conents of your \xampp\apache\conf\extra\httpd-xampp.conf ?
Hi.
See bellow. I use several versions of PHP in my xampp with virtual hosts for different ports.
Ricardo.
#
# XAMPP settings
#
<IfModule env_module>
SetEnv MIBDIRS "C:/xampp/php/extras/mibs"
SetEnv MYSQL_HOME "\\xampp\\mysql\\bin"
SetEnv OPENSSL_CONF "C:/xampp/apache/bin/openssl.cnf"
SetEnv PHP_PEAR_SYSCONF_DIR "\\xampp\\php"
# SetEnv PHP_PEAR_SYSCONF_DIR "C:/xampp/php"
SetEnv PHPRC "\\xampp\\php"
# SetEnv PHPRC "C:/xampp/php"
SetEnv TMP "\\xampp\\tmp"
# SetEnv TMP "C:/xampp/tmp"
</IfModule>
#
# PHP-Module setup
#
#LoadFile "C:/xampp/php/php7ts.dll"
#LoadFile "C:/xampp/php/libpq.dll"
#LoadFile "C:/xampp/php/libsqlite3.dll"
#LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
#
# PHP-CGI setup
#
#<FilesMatch "\.php$">
# SetHandler application/x-httpd-php-cgi
#</FilesMatch>
#<IfModule actions_module>
# Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
#</IfModule>
<IfModule php7_module>
PHPINIDir "C:/xampp/php"
</IfModule>
<IfModule mime_module>
AddType text/html .php .phps
</IfModule>
ScriptAlias /php-cgi/ "C:/xampp/php/"
<Directory "C:/xampp/php">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>
<Directory "C:/xampp/cgi-bin">
<FilesMatch "\.php$">
SetHandler cgi-script
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler
None
</FilesMatch>
</Directory>
<Directory "C:/xampp/htdocs/xampp">
<IfModule php7_module>
<Files "status.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
</Directory>
<IfModule alias_module>
Alias /licenses "C:/xampp/licenses/"
<Directory "C:/xampp/licenses">
Options +Indexes
<IfModule autoindex_color_module>
DirectoryIndexTextColor
"#000000"
DirectoryIndexBGColor "#f8e8a0"
DirectoryIndexLinkColor "#bb3902"
DirectoryIndexVLinkColor "#bb3902"
DirectoryIndexALinkColor "#bb3902"
</IfModule>
Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
Alias /phpmyadmin "C:/xampp/phpMyAdmin/"
<Directory "C:/xampp/phpMyAdmin">
AllowOverride AuthConfig
Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
Alias /webalizer "C:/xampp/webalizer/"
<Directory "C:/xampp/webalizer">
<IfModule php7_module>
<Files "webalizer.php">
php_admin_flag safe_mode off
</Files>
</IfModule>
AllowOverride AuthConfig
Require local
ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var
</Directory>
</IfModule>
##
#Hosts virtuais para execução de várias versões de PHP em portas diferentes
##
##
#PHP 7.3 na porta
8083
##
ScriptAlias /php_7.3 "C:/xampp/php_7.3"
<Directory "C:/xampp/php_7.3">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>
Listen 8083
<VirtualHost *:8083>
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadFile "C:/xampp/php/libsqlite3.dll"
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
UnsetEnv
PHPRC
<FilesMatch "\.php$">
php_flag engine off
SetHandler application/x-httpd-php
Action application/x-httpd-php "/php_7.3/php-cgi.exe"
</FilesMatch>
</VirtualHost>
##
#PHP 7.2 na porta 8082
##
ScriptAlias /php_7.2 "C:/xampp/php_7.2"
<Directory "C:/xampp/php_7.2">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>
Listen
8082
<VirtualHost *:8082>
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadFile "C:/xampp/php/libsqlite3.dll"
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
UnsetEnv PHPRC
<FilesMatch "\.php$">
php_flag engine off
SetHandler application/x-httpd-php
Action application/x-httpd-php "/php_7.2/php-cgi.exe"
</FilesMatch>
</VirtualHost>
##
#PHP 7.1 na porta 8081
##
ScriptAlias /php_7.1
"C:/xampp/php_7.1"
<Directory "C:/xampp/php_7.1">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>
Listen 8081
<VirtualHost *:8081>
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadFile "C:/xampp/php/libsqlite3.dll"
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
UnsetEnv PHPRC
<FilesMatch "\.php$">
php_flag engine off
SetHandler application/x-httpd-php
Action application/x-httpd-php "/php_7.1/php-cgi.exe"
</FilesMatch>
</VirtualHost>
##
#PHP 7.0 na porta 8080
##
ScriptAlias /php_7.0 "C:/xampp/php_7.0"
<Directory "C:/xampp/php_7.0">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>
Listen 8080
<VirtualHost *:8080>
UnsetEnv PHPRC
LoadFile "C:/xampp/php/php7ts.dll"
LoadFile "C:/xampp/php/libpq.dll"
LoadFile "C:/xampp/php/libsqlite3.dll"
LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
<FilesMatch "\.php$">
php_flag engine off
SetHandler application/x-httpd-php
Action application/x-httpd-php "/php_7.0/php-cgi.exe"
</FilesMatch>
</VirtualHost>
##
#PHP 5.6 na porta 8079
##
ScriptAlias /php_5.6 "C:/xampp/php_5.6"
<Directory
"C:/xampp/php_5.6">
AllowOverride None
Options None
Require all denied
<Files "php-cgi.exe">
Require all granted
</Files>
</Directory>
Listen 8079
<VirtualHost *:8079>
UnsetEnv PHPRC
#LoadFile "C:/xampp/php_5.6/php5.dll"
#LoadFile "C:/xampp/php_5.6/libpq.dll"
#LoadModule php5_module "C:/xampp/php_5.6/php5apache2_4.dll"
<FilesMatch "\.php$">
php_flag engine off
SetHandler
application/x-httpd-php_5.6-cgi
Action application/x-httpd-php_5.6-cgi "/php_5.6/php-cgi.exe"
</FilesMatch>
</VirtualHost>