我已经手动下载了PHP v8.2.2
,没有Apache
我在M:\Programs\PHP v8.2.2\ext\
中看到了php_pdo_sqlite.dll
和php_sqlite3.dll
,但是当我在php.ini
中取消注解这些行时:
extension=pdo_sqlite
extension=sqlite3
或者当我手动添加这些行时:
extension=php_pdo_sqlite.dll
extension=php_sqlite3.dll
我在使用php -S localhost:8888
服务index.php
时收到以下警告:
[Thu Feb 2 00:31:14 2023] PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: C:\php\ext\pdo_sqlite (The specified module could not be found), C:\php\ext\php_pdo_sqlite.dll (The specified module could not be found)) in Unknown on line 0
<br />
<b>Warning</b>: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: C:\php\ext\pdo_sqlite (The specified module could not be found), C:\php\ext\php_pdo_sqlite.dll (The specified module could not be found)) in <b>Unknown</b> on line <b>0</b><br />
[Thu Feb 2 00:31:14 2023] PHP Warning: PHP Startup: Unable to load dynamic library 'sqlite3' (tried: C:\php\ext\sqlite3 (The specified module could not be found), C:\php\ext\php_sqlite3.dll (The specified module could not be found)) in Unknown on line 0
<br />
<b>Warning</b>: PHP Startup: Unable to load dynamic library 'sqlite3' (tried: C:\php\ext\sqlite3 (The specified module could not be found), C:\php\ext\php_sqlite3.dll (The specified module could not be found)) in <b>Unknown</b> on line <b>0</b><br />
[Thu Feb 2 00:31:14 2023] PHP 8.2.2 Development Server (http://localhost:8888) started
我知道,错误发生是因为php试图在C:\php\ext\
路径中找到dll
文件,但该目录不存在!PHP v8.2.2
已安装在M:\Progarms\PHP v8.2.2\
中,而不是C:\php\
中
如何更改此默认路径?
1条答案
按热度按时间blmhpbnm1#
为了让sqlite3 PHP库工作(但也可以是ssh或ldap),你必须将PHP主目录添加到PATH中,这样Apache就可以找到libsqlite3.dll或libsasl.dll(或者任何它需要的库,以便使php_.dll工作)。