search
HomeBackend DevelopmentPHP ProblemWhat to do if modifying php.ini does not take effect under Linux

The solution for php.ini not taking effect: first reload the php.ini file and print out "phpinfo();"; then search for the modified configuration; then check the "php-fpm.conf" configuration file; Finally, modify the configuration of "php-fpm".

What to do if modifying php.ini does not take effect under Linux

The main reasons why php.ini modification does not take effect are as follows:
1. After modifying the php.ini configuration file, php is not reloaded. ini configuration file.
2. There are multiple php.ini configuration files
3. The configuration in php.ini is overwritten by the configuration in other files
Problem troubleshooting:
1. After modifying the configuration, reload php.ini file, print out phpinfo(); Check which configuration file is read, and make sure the configuration file you modified is correct. As shown below.
What to do if modifying php.ini does not take effect under Linux
2. Search for the configuration you modified in the printed phpinfo();. Pay attention to Local Value (local variable) and Master Value (main variable). Local Value will Override the value of Master Value. Master Value is the value of your php.ini configuration item, and Local Value may be the value set in the code, as shown below, eg: ini_set('display_errors',true); ,
In addition, Baidu said that the settings of php.ini can be rewritten in the Apache configuration file, which may be in conf/httpd.conf or conf.d/**.conf, usually in conf. d/php.conf, but the conf.d file is not found under Windows. There may be a conf.d file under the Linux version of apache.
What to do if modifying php.ini does not take effect under Linux
3. In the Linux environment, php-fpm has not been included in php before php5.3.3. The configuration of php is basically in php.ini. In php5.3.3 and later, except in php.ini In addition to configuration, you can also configure it in php-fpm.conf, and php-fpm.conf has a higher priority than php.ini.
Check the php-fpm.conf configuration file, or whether the configuration in the php-fpm.d/
.conf file covers the configuration in php.ini. The configuration example of php-fpm is as follows: php_value[ session.save_handler] = redis php_value[session.save_path] = "tcp://***.***.***.***:6379?auth=***"

For more related knowledge, please visit PHP Chinese website!

The above is the detailed content of What to do if modifying php.ini does not take effect under Linux. 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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools