The solution to the ineffectiveness of ini_set in PHP
This article will explain in detail the solution to the ineffectiveness of ini_set in PHP. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
The solution that PHP ini_set does not work: 1, modify the htaccess file; 2, configure "AllowOverride All" in httpd.conf.
This article operating environment: Windows7 system, PHP7.1 version, Dell G3 computer.
The reason why PHP ini_set () is invalid:
In PHP configuration, post_max_size,upload_max_filesize cannot be modified with the ini_set () method.
The correct thing to do is to use the .htaccess file:
Php_value upload_max_filesize 1024M php_value post_max_size 1024M
For the .htaccess file to take effect, you need to configure the site in httpd.conf: AllowOverride All
Reason: the modifiable scope of upload_max_filesize is PHP_INI_PERDIR, which can be modified in php.ini,httpd.conf or .htaccess files, but not with ini_set ().
Knowledge points:
PS:
Magic_quotes_gpc is obtained with get_magic_quotes_gpc () and cannot be modified with set_magic_quotes_gpc because there is no such function.
Magic_quotes_runtime can be set with set_magic_quotes_runtime ()
This is the end of this article on "the solution to the ineffectiveness of ini_set in PHP". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.