问题
I have Apache with PHP installed (on Windows) and run as fastCGI.
My php.ini has this value, upload_max_filesize
= 2M.
I override this value in .user.ini file to 10M.
Every thing works fine until the folder level is deeper than 2 level.
For example:
If I put .user.ini file into www root.
http://localhost/ -> ini_get('upload_max_filesize')
result is 10M
http://localhost/test -> ini_get('upload_max_filesize')
result is 10M
http://localhost/test/lv2 -> ini_get('upload_max_filesize')
result is 10M
http://localhost/test/lv2/lv3 -> ini_get('upload_max_filesize')
result becomes 2M which is php.ini value and this folder has no .user.ini file.
These are not in virtual directory.
How to make .user.ini file works in deeper level of folder?
edited: add httpd.conf for php
<IfModule fcgid_module>
FcgidInitialEnv PHPRC "C:/wwwserver/php/php5.6"
FcgidInitialEnv PATH "C:/wwwserver/php/php5.6;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;C:/Program Files (x86)/ImageMagick-6.9.3-Q16;"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/WINDOWS/Temp"
FcgidInitialEnv TMP "C:/WINDOWS/Temp"
FcgidInitialEnv windir "C:/WINDOWS"
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
FcgidIOTimeout 64
FcgidConnectTimeout 16
FcgidMaxRequestsPerProcess 500
FcgidMaxRequestLen 30000000
<Files ~ "\.php$">
AddHandler fcgid-script .php
FcgidWrapper C:/wwwserver/php/php5.6/php-cgi.exe .php
</Files>
</IfModule>
Reference: https://www.apachelounge.com/viewtopic.php?p=22141
来源:https://stackoverflow.com/questions/41628499/user-ini-file-only-works-2-level-of-folder