Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The solution to the ineffectiveness of ini_set in php

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces the php ini_set does not work in the solution, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor with you to understand.

The solution that php ini_set does not work: 1, modify the configuration such as post_max_size with ".htaccess" file; 2, configure "AllowOverride All" in "httpd.conf".

Operating environment of this article: Windows7 system, PHP7.1 version, Dell G3 computer

Situations where ini_set doesn't work

Ini_set-sets the value for a configuration option

1. Not all valid options for php.ini can be set with ini_set

two。 Not available when an option can be set, but when the server has a virtual host.

Php ini_set doesn't work?

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:

Constant value meaning

PHP_INI_USER, 1, configuration options can be set in the user's PHP script or Windows registry

PHP_INI_PERDIR, 2, configuration options can be configured in php.ini, .htaccess or httpd.conf

PHP_INI_SYSTEM, 4, configuration options can be configured in php.ini or httpd.conf

PHP_INI_ALL, 7, configuration options can be set everywhere

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 ()

Thank you for reading this article carefully. I hope the article "the solution to the ineffectiveness of ini_set in php" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report