PHP官网
步骤
- 将php/php.ini-development改为php.ini,并修改如下:
extension_dir = "e:/web/php8.1/ext"
extension=curl
extension=mbsring
extension=mysqli
extension=openssl
extension=pdo_mysql
# php8新增下面这个
extension=fileinfo
- 修改apache/conf/httpd.conf,修改如下:
# PHP8
LoadModule php_module "E:/web/php8.1/php8apache2_4.dll"
<FilesMatch "\.php$">
setHandler application/x-httpd-php
</FilesMatch>
PHPIniDir "E:/web/php8.1"
LoadFile "E:/web/php8.1/libssh2.dll"
# PHP7
# LoadModule php7_module "E:/web/php72/php7apache2_4.dll"
# <FilesMatch "\.php$">
# setHandler application/x-httpd-php
# </FilesMatch>
# PHPIniDir "E:/web/php72"
# LoadFile "E:/web/php72/libssh2.dll"
- 修改windows的环境变量,路径如下:
我的电脑-属性-高级系统设置-环境变量