Home  >  Article  >  Backend Development  >  php7 installation guide (windows) about phpinidir configuration issues

php7 installation guide (windows) about phpinidir configuration issues

藏色散人
藏色散人forward
2019-04-13 15:06:576537browse


Where is php.ini? ?

The php.ini file does not exist when you first install php. Find php.ini-production in the php folder and modify it to the php.ini file.

PHP searches for PHP.ini in the following order

1, PHPIniDir (Apache 2 module only)

2, registry key value: HKEY_LOCAL_MACHINE—SOFTWARE—PHPIniFilePath

3. Environment variable: %PHPRC%

4. Windows directory (C:\windows or C:\winnt)

We can set php in the apache configuration file. The location of the ini file

LoadModule php7_module "D:\phpserver\php\php7apache2_4.dll"
PHPIniDir D:\phpserver\php
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3

We can set the location of the php.ini file through PHPiniDir D:\phpserver\php. After we complete the setting, restart apache and an error will be reported! The reason is that we did not specify the ext (extension file package) directory of php.

Solution

Find the php.ini file, search for extension_dir, and change its content to:

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
extension_dir = "D:\phpserver\php\ext"

Restart apache again to start successfully!

Related recommendations: "PHP7 Tutorial"


##

The above is the detailed content of php7 installation guide (windows) about phpinidir configuration issues. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:hcoder.net. If there is any infringement, please contact admin@php.cn delete