简体   繁体   中英

php.ini file nowhere to be found?

I am aware that there are a lot of questions regarding this already, but I've looked through each of them and have found nothing.

I am running php 7.0.6, and Apache2.4. I downloaded PHP from windows.php.net/download (I got the second one down, the x86 threadsafe one). After download I extracted it straight to the C:\\ drive under C:\\php .

I am trying to install the Magento e-commerce platform but am required to install a few PHP extensions before I can proceed (namely curl, xsl, intl, mbstring, openssl and gd)

I had a read around and found that to enable them I have to remove the semicolon before them in the php.ini file, so I have navigated to C:\\php and looked for it, but can only find php.ini-development and php.ini-production , which having looked at another thread, neither is what I want.

I also read that it is sometimes just a file called php, but cannot find that either in the C:\\php folder

I then performed a phpinfo(); command in a php file and ran it, getting this result:

Configuration File (php.ini) Path        C:\Windows
Loaded Configuration File                (none)
Scan this dir for additional .ini files  (none)
Additional .ini files parsed             (none)

I have then looked in the C:\\Windows folder to no avail, and I don't know how I am supposed to find the php.ini file so I can remove the semicolon and load the php extensions.

Any help would be appreciated.

Where PHP is installed C:\\php there is a php.ini-development and php.ini-production . You can copy or rename one of these to php.ini . These are templates and have all of the default settings that are needed. The main difference is that the development one will have error reporting turned on and the production one will not:

It should be loaded from either the PHP directory C:\\php or C:\\windows . I use the PHP directory as PHP I believe, will always look in the directory from which PHP is run:

copy c:\php\php.ini-development c:\php\php.ini

Or:

copy c:\php\php.ini-development c:\windows\php.ini

My system:

Configuration File (php.ini) Path       C:\Windows
Loaded Configuration File               C:\app\php\php.ini

If you are running Windows 10 with Bash shell, you can run

php -i | grep '\.ini'

That will show all configuration files loaded. People who work on Windows more often can likely identify the native way to do the equivalent operation natively.

Make sure when you're copying or renaming the php.ini file that it changes the file extension from .ini-developement (or .ini-production, depending on which one you use) to just .ini. If you can't see the extensions on the files you can change that by clicking >view and selecting the file name extensions check box on the far right.

Alternatively, you can look at the file type column where it should say configuration file if the file extension has changed to .ini.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM