libphp5.so: undefined symbol: unixd_config

by 조쉬 posted Mar 18, 2016
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄
 Test Environment

 

CentOS 5.x 32bit

 

Red : 강조

Blue : 명령어 & 메뉴이동

Green : 주석

Pink : 변수

Purple : 예시

Orange : 출력&편집&소스

 

* Incident

 

웹사이트가 열리는 중 이미지 파일이 깨지거나 일부 파일이 불러오지 못하는 이슈가 발생하였다.

apache error log를 확인해 보니 다음과 같이 로그가 지속적으로 발생하고 있었다.

[root@mooon]# less /usr/local/apache/logs/error_log

...

[Mon Feb 02 16:43:06.489904 2015] [core:notice] [pid 16120:tid 3086215936] AH00052: child pid 3204 exit signal Segmentation fault (11)

[Mon Feb 02 16:43:06.489957 2015] [core:notice] [pid 16120:tid 3086215936] AH00052: child pid 3832 exit signal Segmentation fault (11)

[Mon Feb 02 16:56:51.656635 2015] [core:notice] [pid 16120:tid 3086215936] AH00052: child pid 3860 exit signal Segmentation fault (11)

...


PHP 마이너 버전을 변경하여 재컴파일 후 configtest 하였지만 다음과 같이 에러가 발생하였다.

[root@mooon]# /usr/local/apache/bin/apachectl configtest

httpd: Syntax error on line 146 of /usr/local/apache/conf/httpd.conf: Cannot load modules/libphp5.so into server: /usr/local/apache/modules/libphp5.so: undefined symbol: unixd_config

 

 

* Resolution

관련 자료를 찾아보니 Apache 2.4 버전에서 PHP 5.2.x 버전과의 충돌 때문에 이슈가 발생할 수 있다고 하였다.

원인은 apache 버전이 2.4로 업데이트 되면서 일부 심볼의 명칭이 바뀌었다.


unixd_config > ap_unixd_config


사이트에 영향이 없다면 PHP 5.3.x 버전 이후를 사용하거나

php압축해제경로/sapi/apache2handler/php_functins.c 파일을 열어 수정 후 재컴파일을 하면 해결된다.

[root@mooon]# vi /root/pkg/php-5.2.17/sapi/apache2handler/php_functins.c

>line 386

#if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE)

        AP_DECLARE_DATA extern unixd_config_rec ap_unixd_config;

#endif

> line 417

#if !defined(WIN32) && !defined(WINNT) && !defined(NETWARE)

        snprintf(tmp, sizeof(tmp), "%s(%d)/%d", ap_unixd_config.user_name, ap_unixd_config.user_id, ap_unixd_config.group_id);

        php_info_print_table_row(2, "User/Group", tmp);

#endif

 

 

 * Reference