-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenable-sqlite-simple.bat
More file actions
37 lines (29 loc) · 1.56 KB
/
enable-sqlite-simple.bat
File metadata and controls
37 lines (29 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
@echo off
echo ========================================
echo 启用 PHP SQLite 扩展
echo ========================================
set PHP_INI_PATH=F:\Program Files\php-8.4.6-Win32-vs17-x64\php.ini
if not exist "%PHP_INI_PATH%" (
echo ❌ php.ini 文件不存在: %PHP_INI_PATH%
pause
exit /b 1
)
echo ✅ 找到 php.ini 文件: %PHP_INI_PATH%
echo 正在启用 SQLite 扩展...
REM 启用 SQLite 扩展
powershell -Command "(Get-Content '%PHP_INI_PATH%') -replace ';extension=php_sqlite3.dll', 'extension=php_sqlite3.dll' | Set-Content '%PHP_INI_PATH%'"
powershell -Command "(Get-Content '%PHP_INI_PATH%') -replace ';extension=php_pdo_sqlite.dll', 'extension=php_pdo_sqlite.dll' | Set-Content '%PHP_INI_PATH%'"
powershell -Command "(Get-Content '%PHP_INI_PATH%') -replace ';extension=php_openssl.dll', 'extension=php_openssl.dll' | Set-Content '%PHP_INI_PATH%'"
powershell -Command "(Get-Content '%PHP_INI_PATH%') -replace ';extension=php_curl.dll', 'extension=php_curl.dll' | Set-Content '%PHP_INI_PATH%'"
powershell -Command "(Get-Content '%PHP_INI_PATH%') -replace ';extension=php_fileinfo.dll', 'extension=php_fileinfo.dll' | Set-Content '%PHP_INI_PATH%'"
powershell -Command "(Get-Content '%PHP_INI_PATH%') -replace ';extension=php_mbstring.dll', 'extension=php_mbstring.dll' | Set-Content '%PHP_INI_PATH%'"
echo ✅ 扩展启用完成
echo.
echo 验证扩展状态...
php -m | findstr -i "sqlite"
php -m | findstr -i "pdo_sqlite"
echo.
echo ========================================
echo SQLite 扩展配置完成!
echo ========================================
pause