인프런 커뮤니티 질문&답변

김철준님의 프로필 이미지
김철준

작성한 질문수

PHP 7+ 프로그래밍

02 - 기초 문법 (Basic syntax)

php 에러발생..

작성

·

3.3K

0

Cannot load Xdebug - it was already loaded
PHP Warning:  PHP Startup: Unable to load dynamic library 'curl' (tried: /opt/homebrew/lib/php/pecl/20210902/curl (dlopen(/opt/homebrew/lib/php/pecl/20210902/curl, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/curl' (no such file), '/usr/local/lib/curl' (no such file), '/usr/lib/curl' (no such file)), /opt/homebrew/lib/php/pecl/20210902/curl.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/curl.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/curl.so' (no such file), '/usr/local/lib/curl.so' (no such file), '/usr/lib/curl.so' (no such file))) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: /opt/homebrew/lib/php/pecl/20210902/curl (dlopen(/opt/homebrew/lib/php/pecl/20210902/curl, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/curl' (no such file), '/usr/local/lib/curl' (no such file), '/usr/lib/curl' (no such file)), /opt/homebrew/lib/php/pecl/20210902/curl.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/curl.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/curl.so' (no such file), '/usr/local/lib/curl.so' (no such file), '/usr/lib/curl.so' (no such file))) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'fileinfo' (tried: /opt/homebrew/lib/php/pecl/20210902/fileinfo (dlopen(/opt/homebrew/lib/php/pecl/20210902/fileinfo, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/fileinfo' (no such file), '/usr/local/lib/fileinfo' (no such file), '/usr/lib/fileinfo' (no such file)), /opt/homebrew/lib/php/pecl/20210902/fileinfo.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/fileinfo.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/fileinfo.so' (no such file), '/usr/local/lib/fileinfo.so' (no such file), '/usr/lib/fileinfo.so' (no such file))) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'fileinfo' (tried: /opt/homebrew/lib/php/pecl/20210902/fileinfo (dlopen(/opt/homebrew/lib/php/pecl/20210902/fileinfo, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/fileinfo' (no such file), '/usr/local/lib/fileinfo' (no such file), '/usr/lib/fileinfo' (no such file)), /opt/homebrew/lib/php/pecl/20210902/fileinfo.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/fileinfo.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/fileinfo.so' (no such file), '/usr/local/lib/fileinfo.so' (no such file), '/usr/lib/fileinfo.so' (no such file))) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mbstring' (tried: /opt/homebrew/lib/php/pecl/20210902/mbstring (dlopen(/opt/homebrew/lib/php/pecl/20210902/mbstring, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/mbstring' (no such file), '/usr/local/lib/mbstring' (no such file), '/usr/lib/mbstring' (no such file)), /opt/homebrew/lib/php/pecl/20210902/mbstring.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/mbstring.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/mbstring.so' (no such file), '/usr/local/lib/mbstring.so' (no such file), '/usr/lib/mbstring.so' (no such file))) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'mbstring' (tried: /opt/homebrew/lib/php/pecl/20210902/mbstring (dlopen(/opt/homebrew/lib/php/pecl/20210902/mbstring, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/mbstring' (no such file), '/usr/local/lib/mbstring' (no such file), '/usr/lib/mbstring' (no such file)), /opt/homebrew/lib/php/pecl/20210902/mbstring.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/mbstring.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/mbstring.so' (no such file), '/usr/local/lib/mbstring.so' (no such file), '/usr/lib/mbstring.so' (no such file))) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli' (tried: /opt/homebrew/lib/php/pecl/20210902/mysqli (dlopen(/opt/homebrew/lib/php/pecl/20210902/mysqli, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/mysqli' (no such file), '/usr/local/lib/mysqli' (no such file), '/usr/lib/mysqli' (no such file)), /opt/homebrew/lib/php/pecl/20210902/mysqli.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/mysqli.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/mysqli.so' (no such file), '/usr/local/lib/mysqli.so' (no such file), '/usr/lib/mysqli.so' (no such file))) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'mysqli' (tried: /opt/homebrew/lib/php/pecl/20210902/mysqli (dlopen(/opt/homebrew/lib/php/pecl/20210902/mysqli, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/mysqli' (no such file), '/usr/local/lib/mysqli' (no such file), '/usr/lib/mysqli' (no such file)), /opt/homebrew/lib/php/pecl/20210902/mysqli.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/mysqli.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/mysqli.so' (no such file), '/usr/local/lib/mysqli.so' (no such file), '/usr/lib/mysqli.so' (no such file))) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'openssl' (tried: /opt/homebrew/lib/php/pecl/20210902/openssl (dlopen(/opt/homebrew/lib/php/pecl/20210902/openssl, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/openssl' (no such file), '/usr/local/lib/openssl' (no such file), '/usr/lib/openssl' (no such file)), /opt/homebrew/lib/php/pecl/20210902/openssl.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/openssl.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/openssl.so' (no such file), '/usr/local/lib/openssl.so' (no such file), '/usr/lib/openssl.so' (no such file))) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'openssl' (tried: /opt/homebrew/lib/php/pecl/20210902/openssl (dlopen(/opt/homebrew/lib/php/pecl/20210902/openssl, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/openssl' (no such file), '/usr/local/lib/openssl' (no such file), '/usr/lib/openssl' (no such file)), /opt/homebrew/lib/php/pecl/20210902/openssl.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/openssl.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/openssl.so' (no such file), '/usr/local/lib/openssl.so' (no such file), '/usr/lib/openssl.so' (no such file))) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /opt/homebrew/lib/php/pecl/20210902/pdo_mysql (dlopen(/opt/homebrew/lib/php/pecl/20210902/pdo_mysql, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/pdo_mysql' (no such file), '/usr/local/lib/pdo_mysql' (no such file), '/usr/lib/pdo_mysql' (no such file)), /opt/homebrew/lib/php/pecl/20210902/pdo_mysql.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/pdo_mysql.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/pdo_mysql.so' (no such file), '/usr/local/lib/pdo_mysql.so' (no such file), '/usr/lib/pdo_mysql.so' (no such file))) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'pdo_mysql' (tried: /opt/homebrew/lib/php/pecl/20210902/pdo_mysql (dlopen(/opt/homebrew/lib/php/pecl/20210902/pdo_mysql, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/pdo_mysql' (no such file), '/usr/local/lib/pdo_mysql' (no such file), '/usr/lib/pdo_mysql' (no such file)), /opt/homebrew/lib/php/pecl/20210902/pdo_mysql.so (dlopen(/opt/homebrew/lib/php/pecl/20210902/pdo_mysql.so, 0x0009): tried: '/opt/homebrew/lib/php/pecl/20210902/pdo_mysql.so' (no such file), '/usr/local/lib/pdo_mysql.so' (no such file), '/usr/lib/pdo_mysql.so' (no such file))) in Unknown on line 0
Xdebug: [Config] The setting 'xdebug.remote_enable' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_enable (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_host' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_host (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)
Xdebug: [Config] The setting 'xdebug.remote_port' has been renamed, see the upgrading guide at https://xdebug.org/docs/upgrade_guide#changed-xdebug.remote_port (See: https://xdebug.org/docs/errors#CFG-C-CHANGED)

 

 

php -version 등 php 명령어를 치기만 하면 이런 오류가 같이 나오네요 왜 그런걸까요?

답변 3

0

김철준님의 프로필 이미지
김철준
질문자

도저히 찾기가 어려워서 그냥 우선 php.ini에서는 다시 주석처리하고..

<?php
echo var_dump(extension_loaded('curl'));

 

를 했는데 true를 출력합니다. 맥에선 할 필요가 없는걸까요??

 

정상우님의 프로필 이미지
정상우
지식공유자

extensions_loaded() 가 true 로 나왔으면 php --version 입력시에 curl 에 대한 extension 에서는 안 나와야 할 텐데 .. 나오고 계신거 아닌가용?

김철준님의 프로필 이미지
김철준
질문자

php.ini 에서는 우선 다시 ;로 주석하니까 php --version 할 때 오류 출력은 사라졌고 extensions_loaded()는 true로 나오고 있습니다! 실제로 작동하는지는 강의를 들으면서 확인해야 할까요 간단하게 확인할 방법이 없을까요

정상우님의 프로필 이미지
정상우
지식공유자

흠... 버전이 깔끔하게 출력되는 것이 아니면 분명 문제가 있는 건데 ...  extension_loded() 는 true 가 나오는 것도 웃기고.. 아무래도 제가 맥은 사용해본적이 없다보니 ... 이 부분은 해결해드리기가 어려울 것 같아요 ㅠㅠ 한 가지 방법이 있다면, 기존에 설치된 PHP 를 모두 삭제하시고, Install MAMP, Download MAMP (bitnami.com) 와 같은 도구를 사용해보시는 건 어떨까요? 일단 강의 진행에는 큰 무리는 없을 것으로 생각합니다.

0

김철준님의 프로필 이미지
김철준
질문자

맥 사용자이고 설정이 기본값으로 extension_dir = "/opt/homebrew/lib/php/pecl/20190902" 로 들어가있는데요. 해당 폴더에 들어가보니 비어있습니다 ㅠ 기본적으로 깔려야할 익스텐션들이 안 깔린 것 같은데요.. php를 재설치해봐도 같습니다 왜그럴까요..?

정상우님의 프로필 이미지
정상우
지식공유자

맥의 경우 필요한 확장들을 하나씩 설치해주어야 할 가능성도 있습니다. 저도 맥에서는 설치를 안 해본지라 정확하게는 답변드리기는 어려울 것 같지만, 맥에서 PHP 확장 설치하는 방법에 대해서는 아마 웹상에 많이 돌아다닐 것으로 생각됩니다. "How to install php extensions on Mac" 으로 검색해보시거나 한글로 검색하면 자료가 나올 것으로 생각됩니다.

0

정상우님의 프로필 이미지
정상우
지식공유자

안녕하세요. 확장을 로드하지 못해서 생긴 오류로 보입니다. php.ini 에서 동적 확장을 주석해제 했음에도 불구하고 로드하지 못했다면, 확장이 설치된 폴더가 제대로 지정되었는지 살펴볼 필요가 있습니다. php.ini 에서 extension_dir 이 올바르게 설정되어 있는지 점검해주세요.

; Directory in which the loadable extensions (modules) reside.
; https://php.net/extension-dir
;extension_dir = "./"
; On windows:
extension_dir = "ext"

 

또는 아래의 질의응답을 참고하실 수 있습니다 :)

Call to undefined function mysqli_connect() 에러 - 인프런 | 질문 & 답변 (inflearn.com)

김철준님의 프로필 이미지
김철준

작성한 질문수

질문하기