Home > Backend Development > PHP7 > body text

php7 installation guide (windows) about phpinidir configuration issues

藏色散人
Release: 2023-02-17 12:14:02
forward
6547 people have browsed it


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
Copy after login

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"
Copy after login

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!

Related labels:
source:hcoder.net
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template