无法加载PHP8扩展(全部)

l0oc07j2  于 5个月前  发布在  PHP
关注(0)|答案(2)|浏览(67)

我构建了一个新的开发Windows,其中包括:
Windows 10专业版- Apache 2.4.54 - PHP 8.1.7
问题是PHP无法加载扩展(无论我激活哪一个)。php.ini中的配置

extension_dir = "ext"

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
extension=curl
extension=mbstring
extension=openssl

字符串
在apache日志中抛出以下消息:

PHP Warning:  PHP Startup: Unable to load dynamic library 'curl' (tried: ext\\curl (The specified module could not be found), ext\\php_curl.dll (The specified module could not be found)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring' (tried: ext\\mbstring (The specified module could not be found), ext\\php_mbstring.dll (The specified module could not be found)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'openssl' (tried: ext\\openssl (The specified module could not be found), ext\\php_openssl.dll (The specified module could not be found)) in Unknown on line 0


安装路径为:
c:\Webserver\Apache24
c:\Webserver\php
一开始我想到一个权限问题,所以我把“Webserver”的hole目录打开给“everyone”,具有“full access”权限,但这并不能解决问题。

zrfyljdw

zrfyljdw1#

看起来我找到问题了。在我将PHP文件夹的路径添加到Windows环境变量并重新启动Windows后,错误消息消失了。

jq6vz3qz

jq6vz3qz2#

非常感谢所有的评论。确实,extension_dir必须有完整的路径,否则,有时PHP引擎识别扩展,其他时候,它不能。

相关问题