Home  >  Article  >  Backend Development  >  How to dynamically set php.ini

How to dynamically set php.ini

藏色散人
藏色散人Original
2020-07-02 10:04:582482browse

How to dynamically set php.ini: first open the php.ini file; then find the "ini_set()" configuration item; finally set the time zone, display error and maximum memory limit by modifying the parameters.

How to dynamically set php.ini##

php -ini | grep short_open_tag //查看 php.ini 配置

Dynamic settings

ini_set(string $varname , string $newvalue);
ini_set('date.timezone', 'Asia/Shanghai'); //设置时区
ini_set('display_errors', '1'); //设置显示错误
ini_set('memory_limit', '256M'); //设置最大内存限制

For more related knowledge, please visit

PHP Chinese website !

The above is the detailed content of How to dynamically set php.ini. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn