Loaded Configuration File: (none) -> How to correct this?
Asked Answered
T

1

6

I`m using PHP on Windows since two weeks. Until now i don´t had any problems what so ever. But now i need to change something in my "php.ini" and i can´t do it because no file is loaded as a configuration file.

If I´m writing "php --ini" in my cmd i get the following answer.

    Configuration File (php.ini) Path: C:\WINDOWS
    Loaded Configuration File:         (none)
    Scan for additional .ini files in: (none)
    Additional .ini files parsed:      (none)

I have already read some other questions regarding this topic but all the answers didn´t work for me. I have a directory "c:/php" with a php.ini file. I tried to copy it to "c:/windows" and restarted apache but nothing changed at all.

I really hope someone can help me. Thanks.

Tearing answered 8/5, 2017 at 14:24 Comment(3)
Do you really need to use PHP on windows?Acetaldehyde
At least it would be beneficial.Tearing
How did you install PHP? Xampp? MAMP? Wamp? Makes a difference to where the PHP config file should be located.Eyelet
G
0

I faced this problem when using Windows 11, Apache/2.4.62 (Win64) Apache Lounge VS17 Server built: Jul 16 2024 12:23:10, and PHP Version 8.3.11.

The solution was simple - to add PHPIniDir line in the httpd.conf

PHPIniDir "c:/my_own_amp_build/php/php8311/"

Take care to put those double-inverted commas, forward slashes, including the last slash.

And make sure that there is a file named php.ini in the above directory.

The thing to know here is that if php.ini file cannot be located/loaded by Apache, it will anyways load PHP with some default configurations. I could not locate the .ini file where these default configurations were written. So I assume that these are hard-coded into the PHP build and not-editable by users.

Only if Apache can locate the php.ini file at the path mentioned in PHPIniDir, that php.ini file shall be loaded, otherwise php will start with hard-coded configuration and Loaded configuration file will always show as none.

Glyph answered 30/8 at 17:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.