Why does the configuration file php.ini not take effect?
Reasons why the configuration file "php.ini" does not take effect: 1. After modifying the configuration file, the "php.ini" configuration file is not reloaded. You only need to restart the service and reload the configuration file; 2. There are multiple "php.ini" configuration files; 3. The configuration in the "php.ini" file is overwritten by the configuration in other files.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
After modifying the configuration file php.ini The main reasons why it does not take effect are as follows:
1. After modifying the php.ini configuration file, the php.ini configuration file was not reloaded.
2. There are multiple php.ini configuration files
3. The configuration in php.ini is overwritten by the configuration in other files
Troubleshooting:
1. After modifying the configuration, reload the php.ini file and print out phpinfo();
Check which configuration file is read and make sure the configuration file you modified is correct . As shown below:
#2. Search for the configuration you modified in the printed phpinfo();
, pay attention to the Local Value (local variable) and Master Value (main variable), Local Value will overwrite 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.
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, php5.3.3 and later. , in addition to configuring in php.ini, 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=***"
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of Why does the configuration file php.ini not take effect?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to turn off the cache in php.ini: 1. Find and open the php.ini configuration file; 2. Find the "opcache.enable" and "opcache.enable_cli" options and modify them to "opcache.enable=0" and "opcache. enable_cli=0”; 3. Save the modified file.

Why should we write the fixed file of the configuration file? We can directly write it as a .py file, such as settings.py or config.py. The advantage of this is that we can directly import parts of it through import in the same project; but if we need to use it in other When sharing configuration files on non-Python platforms, writing a single .py is not a good choice. At this time we should choose a common configuration file type to store these fixed parts. Currently, the commonly used and popular configuration file format types mainly include ini, json, toml, yaml, xml, etc. We can access these types of configuration files through standard libraries or third-party libraries.

If you bought your laptop from a mobile operator, you most likely had the option to activate an eSIM and use your cellular network to connect your computer to the Internet. With eSIM, you don't need to insert another physical SIM card into your laptop because it's already built-in. It is very useful when your device cannot connect to the network. How to check if my Windows 11 device is eSIM compatible? Click the Start button and go to Network & Internet > Cellular > Settings. If you don't see the "Cellular" option, your device doesn't have eSIM capabilities and you should check another option, such as using your mobile device to connect your laptop to a hotspot. In order to activate and

Setting up a wireless network is common, but choosing or changing the network type can be confusing, especially if you don't know the consequences. If you're looking for advice on how to change the network type from public to private or vice versa in Windows 11, read on for some helpful information. What are the different network profiles in Windows 11? Windows 11 comes with a number of network profiles, which are essentially sets of settings that can be used to configure various network connections. This is useful if you have multiple connections at home or office so you don't have to set it all up every time you connect to a new network. Private and public network profiles are two common types in Windows 11, but generally

Helm is an important component of Kubernetes that simplifies the deployment of Kubernetes applications by bundling configuration files into a package called HelmChart. This approach makes updating a single configuration file more convenient than modifying multiple files. With Helm, users can easily deploy Kubernetes applications, simplifying the entire deployment process and improving efficiency. In this guide, I'll cover different ways to implement Helm on Ubuntu. Please note: The commands in the following guide apply to Ubuntu 22.04 as well as all Ubuntu versions and Debian-based distributions. These commands are tested and should work correctly on your system. in U

Recently, many Win10 system users want to change the user profile, but they don’t know how to do it. This article will show you how to set the user profile in Win10 system! How to set up user profile in Win10 1. First, press the "Win+I" keys to open the settings interface, and click to enter the "System" settings. 2. Then, in the opened interface, click "About" on the left, then find and click "Advanced System Settings". 3. Then, in the pop-up window, switch to the "" option bar and click "User Configuration" below.

Why write configuration files? During the development process, we often use some fixed parameters or constants. For these more fixed and commonly used parts, they are often written into a fixed file to avoid repetition in different module codes and keep the core code clean. We can directly write this fixed file into a .py file, such as settings.py or config.py. The advantage of this is that we can directly import parts of it through import in the same project; but if we need to do it on other non-Python platforms When configuring file sharing, writing a single .py is not a good choice. At this time we should choose a common configuration file type

An effective method to solve the garbled problem of eclipse requires specific code examples. In recent years, with the rapid development of software development, eclipse, as one of the most popular integrated development environments, has provided convenience and efficiency to many developers. However, you may encounter garbled code problems when using eclipse, which brings trouble to project development and code reading. This article will introduce some effective methods to solve the problem of garbled characters in Eclipse and provide specific code examples. Modify eclipse file encoding settings: in eclip
