PHP 확장 설치하기

윈도우에서, PHP 확장을 적재하는 두가지 방법이 있습니다: PHP 안에 컴파일하거나, DLL을 적재. 미리 컴파일된 확장을 적재하는 것이 쉽고 편한 방법입니다.

확장을 적재하려면, 시스템에 해당하는 ".dll" 파일이 있어야 합니다. 모든 확장은 자동으로 주기적으로 PHP 그룹에서 컴파일합니다. (내려받기는 다음 섹션을 참고하십시오)

확장을 PHP 안에 컴파일하려면, 소스에서 빌드하기 문서를 확인하십시오.

독립 확장(DLL 파일)을 컴파일하려면, 소스에서 빌드하기 문서를 확인하십시오. DLL 파일이 PHP 배포판이나 PECL에 존재하지 않는다면, 그 확장을 사용하기 전에 컴파일해야 합니다.

add a note add a note

User Contributed Notes 4 notes

up
1
j dot o dot l dot a dot n at bk dot ru
10 months ago
In order for php to see extensions, it is necessary to specify the root folder when specifying the address to the directory with extensions in php.ini. For example extension_dir = "php/ext"
up
1
ferdnyc at gmail dot com
2 years ago
This is handwaved somewhat in the "Resolving problems" section, but mis-location of (non-extension) DLL files is often a problem when installing PHP extensions on Windows.

Many PHP extensions come with not only the extension DLL, but supplementary DLLs that are required by that extension. (For example, php_luasandbox.dll comes with lua5.1.dll, the lua interpreter it sandboxes.) Those other DLLs should go into the same directory as the php.exe binary, NOT the extension directory.

So, if php_luasandbox.dll is installed at C:\PHP8.1\ext\php_luasandbox.dll, the interpreter would be located at C:\PHP8.1\lua5.1.dll. That allows the PHP binary C:\PHP8.1\php.exe to find those additional DLLs when required.
up
0
bk at kaelberer-aio dot de
1 year ago
In addition to the helpful comments of ferdnyc and dario: A few weeks ago I've set up a new W11 using PHP 8.1. (as a module) with Apache. It was working fine.
Today i wanted to install the PECL-extension php-amqp. This extension comes with two additional files that are said to be placed in PHPs main directory. It worked fine running from the command prompt but with Apache the extension failed with "Unable to load dynamic library 'amqp'".
I tried 100 ways to notate paths in php.ini and http.conf: c:, C:, \, \\, /, ". I also installed a new PHP in the root to get rid of the space in the path. It did not help.
When reading dario's comment i stumbeled across him mentioning "path environment variable". I checked that in Window's settings and I realized, that i had added PHP's path to the USER'S path-settings, but not to the SYSTEM'S path. That is why it worked in the command prompt but not when starting Apache as a service. After adding it there it worked fine.
up
0
dario at 4assistance dot com
1 year ago
On windows, drop your extension's dependencies into a dir of your choice, but outside of your php install. Add that dir to a path environment variable used by your php. Add <extension_name>.dll to your php's extension_dir, and update your php.ini (unless you're simply testing with php's cli).
To Top