변군이글루

[리눅스] PHP 7.X 버전에서 몽고DB 연동 본문

* 리눅스

[리눅스] PHP 7.X 버전에서 몽고DB 연동

변군 변군이글루 2021. 7. 16. 10:36
728x90
반응형

PHP 7.X 버전에서 몽고DB 연동(확장 프로그램 설치)

$ git clone https://github.com/mongodb/mongo-php-driver.git

$ cd mongo-php-driver/

$ git submodule update --init

$ /usr/local/php/bin/phpize

$ ./configure --with-php-config=/usr/local/php/bin/php-config

$ make all

$ make install
--output--
PATH="$PATH:/sbin" ldconfig -n /usr/local/src/mongo-php-driver/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/src/mongo-php-driver/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Installing shared extensions:     /usr/local/php/lib/php/extensions/debug-zts-20180731/

확장 프로그램 디렉토리 확인

/usr/local/php/bin/php -i

$ /usr/local/php/bin/php -i | grep extension_dir
extension_dir => /usr/lib64/php/modules => /usr/lib64/php/modules

모듈 복사

$ cp /usr/local/src/mongo-php-driver/modules/mongodb.so /usr/lib64/php/modules/.

모듈 확인

$ /usr/local/php/bin/php -m | grep mongodb
mongodb
728x90
반응형
0 Comments
댓글쓰기 폼