게임강의
기타게임 분류

mysql 설치시 에러 해겳아법

컨텐츠 정보

본문

mariadb-10.2.14 / PHP 7.0.16 설치시 아래와 같이 mysqli 에러 발생
make: *** [ext/mysqli/mysqli_prop.lo] Error 1
make: *** [ext/mysqli/mysqli_api.lo] Error 1
In file included from /root/src/php-7.0.16/ext/mysqli/php_mysqli_structs.h:63,
from /root/src/php-7.0.16/ext/mysqli/mysqli_fe.c:32:
/opt/mysql/include/mysql/my_global.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h>
In file included from /root/src/php-7.0.16/ext/mysqli/php_mysqli_structs.h:79,
from /root/src/php-7.0.16/ext/mysqli/mysqli_fe.c:32:
/opt/mysql/include/mysql/my_sys.h:3:2: warning: #warning This file should not be included by clients, include only <mysql.h>
In file included from /root/src/php-7.0.16/ext/mysqli/mysqli_fe.c:32:
/root/src/php-7.0.16/ext/mysqli/php_mysqli_structs.h:82:21: error: my_list.h: No such file or directory
/root/src/php-7.0.16/ext/mysqli/php_mysqli_structs.h:83:22: error: m_string.h: No such file or directory
/root/src/php-7.0.16/ext/mysqli/php_mysqli_structs.h:86:21: error: m_ctype.h: No such file or directory

보통 이런경우 구글에다가 검색해보면

phpbug 사이트에 나오는 경우가 종종 있다.

https://bugs.php.net/patch-display.php?bug_id=75612&patch=mysql-mariadb-10.3.patch&revision=latest

나온대로 소스 수정해서 설치하면 됨


ex)해결책은 아래와 같이 소스 수정하라고 나와있음 그중에서diff -up php-7.2.4/ext/mysqli/mysqli_api.c.omv~ php-7.2.4/ext/mysqli/mysqli_api.c
ㄴ여기 보면 수정해야할 소스 경로 나오죠 ? vi로 php-7.2.4/ext/mysqli/mysqli_api.c 들어가서
--- php-7.2.4/ext/mysqli/mysqli_api.c.omv~ 2018-04-06 21:50:05.183703414 +0200
+++ php-7.2.4/ext/mysqli/mysqli_api.c 2018-04-06 21:50:16.436829372 +0200
@@ -616,7 +616,7 @@ PHP_FUNCTION(mysqli_change_user)
ㄴ616 라인에 보면
  size_t  user_len, password_len, dbname_len;
  zend_ulong  rc;
 #if !defined(MYSQLI_USE_MYSQLND) && defined(HAVE_MYSQLI_SET_CHARSET)
- const  CHARSET_INFO * old_charset;
+ const  MY_CHARSET_INFO * old_charset;
ㄴ위의 내용이 있습니다. 저기서 - 부분은 삭제(혹은 주석) 하고 + 부분은 추가, 즉 CAHRSET_INFO 를 MY_CHARSET_INFO 로변경
 #endif
 
  if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osss!", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) {
diff -up php-7.2.4/ext/mysqli/mysqli.c.omv~ php-7.2.4/ext/mysqli/mysqli.c
ㄴ위에서 한것처럼 똑같이 vi 로 php-7.2.4/ext/mysqli/mysqli.c 열고

--- php-7.2.4/ext/mysqli/mysqli.c.omv~ 2018-04-06 21:49:41.782434506 +0200
+++ php-7.2.4/ext/mysqli/mysqli.c 2018-04-06 21:49:52.708561249 +0200
@@ -26,6 +26,7 @@
ㄴ26번 라인보면
 #include <signal.h>
 
+#include <server/mysql_version.h>
ㄴ여기는 따로 삭제할필요없이 위 내용만 추가하면 되겠죠 ?


이런식으로 어느 파일을 열어서 어느 라인에 추가 삭제 혹은 수정한다음 컴파일 하면 됩니다.
 #include "php.h"
 #include "php_ini.h"
 #include "ext/standard/info.h"
diff -up php-7.2.4/ext/mysqli/mysqli_nonapi.c.omv~ php-7.2.4/ext/mysqli/mysqli_nonapi.c
--- php-7.2.4/ext/mysqli/mysqli_nonapi.c.omv~ 2018-04-06 21:51:43.217399945 +0200
+++ php-7.2.4/ext/mysqli/mysqli_nonapi.c 2018-04-06 21:58:52.799445824 +0200
@@ -263,7 +263,7 @@ void mysqli_common_connect(INTERNAL_FUNC
  php_mysqli_set_error(mysql_errno(mysql->mysql), (char *) mysql_error(mysql->mysql));
 
 #if !defined(MYSQLI_USE_MYSQLND)
- mysql->mysql->reconnect = MyG(reconnect);
+/* mysql->mysql->reconnect = MyG(reconnect); */
 #endif
 
  mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&MyG(allow_local_infile));
diff -up php-7.2.4/ext/mysqli/mysqli_prop.c.omv~ php-7.2.4/ext/mysqli/mysqli_prop.c
--- php-7.2.4/ext/mysqli/mysqli_prop.c.omv~ 2018-04-06 21:50:25.687842714 +0200
+++ php-7.2.4/ext/mysqli/mysqli_prop.c 2018-04-06 21:50:35.116768902 +0200
@@ -23,6 +23,7 @@
 
 #include <signal.h>
 
+#include <server/mysql_version.h>
 #include "php.h"
 #include "php_ini.h"
 #include "ext/standard/info.h"
diff -up php-7.2.4/ext/mysqli/php_mysqli_structs.h.omv~ php-7.2.4/ext/mysqli/php_mysqli_structs.h
--- php-7.2.4/ext/mysqli/php_mysqli_structs.h.omv~ 2018-04-06 21:49:12.161080045 +0200
+++ php-7.2.4/ext/mysqli/php_mysqli_structs.h 2018-04-06 21:58:44.599503172 +0200
@@ -79,11 +79,7 @@
 #include <my_sys.h>
 #include <mysql.h>
 #include <errmsg.h>
-#include <my_list.h>
-#include <m_string.h>
 #include <mysqld_error.h>
-#include <my_list.h>
-#include <m_ctype.h>
 #include "mysqli_libmysql.h"
 #endif /* MYSQLI_USE_MYSQLND */
 
@@ -326,7 +322,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mysqli)
  char  *default_user;
  char  *default_socket;
  char  *default_pw;
- zend_long  reconnect;
+/* zend_long  reconnect; */
  zend_long  allow_local_infile;
  zend_long  strict;
  zend_long  error_no;






참고로 위 에러는 centos 7 에 php 7.2 - mariadb 10.3 설치시 php 컴파일할 ㄸ ㅐ에러 난다.

이거 작성할때는 위와같이 소스파일 수정하면 잘 됐었는데 오늘(2019-05-28) 해보니까 또 다른 에러가 난다.

In file included from /root/src/php-7.2.18/Zend/zend.h:29:0,

                from /root/src/php-7.2.18/main/php.h:35,

                from /root/src/php-7.2.18/ext/mysqli/mysqli_driver.c:25:

/root/src/php-7.2.18/ext/mysqli/mysqli_driver.c: In function ‘driver_reconnect_read’:

/root/src/php-7.2.18/Zend/zend_API.h:183:76: error: ‘zend_mysqli_globals’ has no member named ‘reconnect’

 #define ZEND_MODULE_GLOBALS_ACCESSOR(module_name, v) (module_name##_globals.v)

                                                                            ^

/root/src/php-7.2.18/Zend/zend_types.h:671:5: note: in definition of macro ‘ZVAL_BOOL’

    (b) ? IS_TRUE : IS_FALSE; \

    ^

/root/src/php-7.2.18/ext/mysqli/php_mysqli_structs.h:337:16: note: in expansion of macro ‘ZEND_MODULE_GLOBALS_ACCESSOR’

 #define MyG(v) ZEND_MODULE_GLOBALS_ACCESSOR(mysqli, v)

                ^

/root/src/php-7.2.18/ext/mysqli/mysqli_driver.c:35:20: note: in expansion of macro ‘MyG’

  ZVAL_BOOL(retval, MyG(value)); \

                    ^

/root/src/php-7.2.18/ext/mysqli/mysqli_driver.c:120:1: note: in expansion of macro ‘MAP_PROPERTY_MYG_BOOL_READ’

 MAP_PROPERTY_MYG_BOOL_READ(driver_reconnect_read, reconnect)

 ^

In file included from /root/src/php-7.2.18/main/php.h:39:0,

                from /root/src/php-7.2.18/ext/mysqli/mysqli_driver.c:25:

/root/src/php-7.2.18/ext/mysqli/mysqli_driver.c: In function ‘driver_reconnect_write’:

/root/src/php-7.2.18/Zend/zend_API.h:183:76: error: ‘zend_mysqli_globals’ has no member named ‘reconnect’

 #define ZEND_MODULE_GLOBALS_ACCESSOR(module_name, v) (module_name##_globals.v)

                                                                            ^

/root/src/php-7.2.18/ext/mysqli/php_mysqli_structs.h:337:16: note: in expansion of macro ‘ZEND_MODULE_GLOBALS_ACCESSOR’

 #define MyG(v) ZEND_MODULE_GLOBALS_ACCESSOR(mysqli, v)

                ^

/root/src/php-7.2.18/ext/mysqli/mysqli_driver.c:42:2: note: in expansion of macro ‘MyG’

  MyG(value) = Z_LVAL_P(value) > 0; \

  ^

/root/src/php-7.2.18/ext/mysqli/mysqli_driver.c:121:1: note: in expansion of macro ‘MAP_PROPERTY_MYG_BOOL_WRITE’

 MAP_PROPERTY_MYG_BOOL_WRITE(driver_reconnect_write, reconnect)

 ^

make: *** [ext/mysqli/mysqli_driver.lo] Error 1

관련자료

댓글 0
등록된 댓글이 없습니다.
전체 2 / 1 페이지
번호
제목
이름

강의실

🏆 포인트 랭킹 TOP 10
순위 닉네임 포인트
1 no_profile 타키야겐지쪽지보내기 자기소개 아이디로 검색 전체게시물 91,144
2 no_profile 동가리쪽지보내기 자기소개 아이디로 검색 전체게시물 52,598
3 no_profile 라프텔쪽지보내기 자기소개 아이디로 검색 전체게시물 51,320
4 서번트쪽지보내기 자기소개 아이디로 검색 전체게시물 35,011
5 no_profile 보거스쪽지보내기 자기소개 아이디로 검색 전체게시물 30,812
6 no_profile 검은고양이쪽지보내기 자기소개 아이디로 검색 전체게시물 29,873
7 no_profile 닥터스쪽지보내기 자기소개 아이디로 검색 전체게시물 29,010
8 no_profile Revolution쪽지보내기 자기소개 아이디로 검색 전체게시물 28,199
9 no_profile 불멸의행복쪽지보내기 자기소개 아이디로 검색 전체게시물 28,098
10 no_profile 호롤롤로쪽지보내기 자기소개 아이디로 검색 전체게시물 16,580
알림 0