code

PHP 경고 : PHP 시작 : 동적 라이브러리를로드 할 수 없습니다.

codestyles 2020. 9. 22. 08:13
반응형

PHP 경고 : PHP 시작 : 동적 라이브러리를로드 할 수 없습니다.


PHP 스크립트를 실행하고이 오류가 발생합니다.

PHP 경고 : PHP 시작 : 동적 라이브러리 '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/ixed.5.2.lin'-/ usr / local / lib / php / extensions를로드 할 수 없습니다. /no-debug-non-zts-20090626/ixed.5.2.lin : 공유 객체 파일을 열 수 없음 : 0 행의 Unknown에 해당 파일 또는 디렉토리가 없습니다.

그게 무슨 뜻입니까?


이는 해당 확장을로드하려는 php 구성 파일 (php.ini 또는 그 근처에있는 다른 파일) 중 하나에 extension=...또는 zend_extension=...이 있음을 의미 합니다.ixed.5.2.lin

불행히도 해당 파일 또는 경로가 존재하지 않거나 권한이 올바르지 않습니다.

  1. .iniPHP에 의해로드 된 파일 에서 검색을 시도하십시오 (어떤 파일이 있는지 phpinfo()표시 할 수 있음). 그중 하나가 해당 확장을로드해야합니다.
  2. 파일 경로를 수정하거나 해당 행을 주석 처리하십시오.

Linux를 사용하는 경우 셸에 다음을 입력하여로드 된 모든 구성 파일을 찾을 수 있습니다.

php -r "print phpinfo();" | grep ".ini"

업데이트 : 의견에서 언급했듯이 이것은 훨씬 더 정확할 수 있습니다.

php -i | grep ini

오류를 없애고 싶고 확장자가 필요하지 않은 경우 반드시 php.ini. 그러나 실제로 문제를 해결하려면 여기에 몇 가지 추가 정보가 있습니다.

정확한 모듈에 따라 다양한 원인이 있지만 일반적인 지침도 있습니다.

  1. 열기 phpinfo()와 대한보기 extension_dir세 이하 Core섹션을 참조하십시오. 여기에 모듈이 있어야합니다.

예를 들어, /usr/lib/php/modulesUnix / Linux의 경우.

  1. 파일이 실제로 존재하는 경우 권한이 적절한 지 확인하십시오.
  2. 파일이 없으면 아래 리소스를 사용하여 설치하십시오.

* nix (PEAR)에
설치 Windows에 확장 설치


XAMPP를 사용하는 phpStom

TL; DR 파일이 존재하는지 확인하는 것 외에 php.ini 파일의 일부 레코드에 드라이브 문자를 추가해야 할 수 있습니다.

갑자기 xampp 및 xdebug로 PHP를 디버깅하기 위해 phpStorm 7을 사용하는 데 문제가 발생하기 시작했습니다. intellij interperter를 xampps php로 설정하려고 할 때 질문에있는 것과 같은 많은 경고가 표시됩니다. 예를 들면 다음과 같습니다.

동적 라이브러리 '/xampp/php/ext/php_bz2.dll'을로드 할 수 없습니다.

어떤 이유로 php.ini 파일의 extension_dir 및 browscap 레코드에 드라이브 문자를 추가해야했습니다.

extension_dir = "\xampp\php\ext"
browscap = "\xampp\php\extras\browscap.ini"

extension_dir = "e:\xampp\php\ext"
browscap = "e:\xampp\php\extras\browscap.ini"

php -r "echo php_ini_loaded_file();"

CLI에 현재 ini로드 된 파일이 표시되고 확장자를 검색합니다. 경로가 올바르지 않습니다.


PHP 라이브러리에 "기타"디렉토리 열기 권한이없는 경우에도이 오류가 발생할 수 있습니다. 내 특별한 경우에는 php -l텍스트 편집기에서 스크립트를 구문 검사하는 데 사용할 때 이것을 발견했습니다 . 즉, 내 계정이 "volomike"라고했기 때문에 해당 계정에는 php명령이 의존 하는 라이브러리를 실행할 권한이 없었 습니다.

예를 들어 Ubuntu 14.04에서는 경로에 PHP5가 자동으로 설치되었습니다 /usr/lib/php5/20121212+lfs. 그러나 일부 공유 객체를 빌드 할 때 C ++로 작업하고 있었기 때문에 디렉토리 권한을 엉망으로 만들고 루트가 아닌 계정에 .NET Framework를 볼 수있는 디렉토리 실행 (디렉토리 열기) 권한이 없도록 작업을 망쳤습니다 /usr/lib/php5/20121212+lfs. 따라서 다음 명령을 입력하여 문제를 해결했습니다.

sudo chmod o+x /usr/lib/php5/20121212+lfs.

Now when I do php -l example.php as a non-root user, it never gives me this "Unabled to load dynamic library" problem anymore.


Loading .dll in Linux

I've encountered this warning message while I was trying to install a php-extension via the php.ini file;

until I figured out that you cannot load .dll extensions in Linux,

but you have to comment the extensions that you want to import ;extension= ... .dll and install it correctly via sudo apt-get install php-...

note: ... is the extension name you want to enable.


I had the same problem on XAMPP for Windows when I try to install composer. I did php -v and php throwing error :

Unable to load dynamic library '/xampp/php/ext/php_bz2.dll'

It took me a while until I realized that I need to setup my XAMPP. So I run setup_xampp.bat and php return to works like a charm.


After Windows 10 XAMPP now I installed LAMPP (XAMPP) on Ubuntu. Windows XAMPP had a lot less to configure compare to MAC (iOS) but now with Linux Ubuntu I had a few more since there are more going in Linux (a good thing).

I confused and activated mysqli.dll (and mysql.dll: erase "#" in /etc/php/7.2/cli/php.ini

I started to get the PHP Warning: PHP Startup: Unable to load dynamic library message related to dll. I commented out mysql(and i).dll in the same file but the message didn't go away up until I commented out " " in /opt/lampp/etc/php.ini.

Looks like XAMPP reads php.ini file from /etc/php/7.2/cli and makes modification in php.ini of /opt/lampp/etc. (;extension=php_pdo_mysql.dll after ";" restarted Apache and no more any message.


I encountered a similar error. The mistake I made was to use the "controller" name as "Pages" instead of "pages" in my url.


I had this error on a number of modules when I had been running different versions of PHP side by side on my server. To sort this out, I needed to install the packages it couldn't find for that specific PHP version. So, for example, if I saw:-

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/20160303/xml.so'

I would install the library for the PHP version specifically:-

sudo apt-get install php7.1-xml

And then restart Apache. Fixed it for me. You can check your version like this:-

php -v

In Windows, it could be a wrong path in "System environment variables". "Path" to the php.exe directory must be the good one.

참고URL : https://stackoverflow.com/questions/5282264/php-warning-php-startup-unable-to-load-dynamic-library

반응형