Skip to content

build php #18785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hexiuzhe2015 opened this issue Jun 6, 2025 · 7 comments
Closed

build php #18785

hexiuzhe2015 opened this issue Jun 6, 2025 · 7 comments

Comments

@hexiuzhe2015
Copy link

hexiuzhe2015 commented Jun 6, 2025

Description

php8.4.7 zts
Compile pdo_mysql make and make install are no problem but
php -v php warning: php startup: invalid library (maybe not a php library) 'pdo_mysql' is unknown on line 0

@nielsdos
Copy link
Member

nielsdos commented Jun 9, 2025

We'll need a little bit more information I'm afraid.

Did you first run ./buildconf before running the ./configure command?
Can you share the ./configure command line that you used along with config.log?
Are you sure you're loading the pdo_mysql library from the right location?

@hexiuzhe2015
Copy link
Author

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.71. Invocation command line was

$ ./configure --with-pdo-mysql=mysqlnd

---------

Platform.

---------

hostname = imwox
uname -m = x86_64
uname -r = 6.1.0-34-amd64
uname -s = Linux
uname -v = #1 SMP PREEMPT_DYNAMIC Debian 6.1.135-1 (2025-04-25)

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = x86_64
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/local/bin/
PATH: /usr/bin/
PATH: /bin/
PATH: /usr/local/games/
PATH: /usr/games/
PATH: /home/zheye/.config/composer/vendor/bin/

-----------

Core tests.

-----------

configure:2491: looking for aux files: config.guess config.sub
configure:2504: trying ./build/
configure:2533: ./build/config.guess found
configure:2533: ./build/config.sub found
configure:2650: checking for grep that handles long lines and -e
configure:2714: result: /usr/bin/grep
configure:2719: checking for egrep
configure:2787: result: /usr/bin/grep -E
configure:2792: checking for a sed that does not truncate output
configure:2862: result: /usr/bin/sed
configure:2939: checking build system type
configure:2954: result: x86_64-pc-linux-gnu
configure:2974: checking host system type
configure:2988: result: x86_64-pc-linux-gnu
configure:3008: checking target system type
configure:3022: result: x86_64-pc-linux-gnu
configure:3074: checking for gawk
configure:3110: result: no
configure:3074: checking for nawk
configure:3096: found /usr/bin/nawk
configure:3107: result: nawk
configure:3129: checking if nawk is broken
configure:3139: result: no
configure:3213: checking for pkg-config
configure:3236: found /usr/bin/pkg-config
configure:3248: result: /usr/bin/pkg-config
configure:3273: checking pkg-config is at least version 0.9.0
configure:3276: result: yes
configure:3352: checking for cc
configure:3373: found /usr/bin/cc
configure:3384: result: cc
configure:3415: checking for C compiler version
configure:3424: cc --version >&5
cc (Debian 12.2.0-14) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3435: $? = 0
configure:3424: cc -v >&5
Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 12.2.0-14' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-12-bTRWOB/gcc-12-12.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-12-bTRWOB/gcc-12-12.2.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.0 (Debian 12.2.0-14)
... rest of stderr output deleted ...
configure:3435: $? = 0
configure:3424: cc -V >&5
cc: error: unrecognized command-line option '-V'
cc: fatal error: no input files
compilation terminated.
configure:3435: $? = 1
configure:3424: cc -qversion >&5
cc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
cc: fatal error: no input files
compilation terminated.
configure:3435: $? = 1
configure:3424: cc -version >&5
cc: error: unrecognized command-line option '-version'
cc: fatal error: no input files
compilation terminated.
configure:3435: $? = 1
configure:3455: checking whether the C compiler works
configure:3477: cc conftest.c >&5
configure:3481: $? = 0
configure:3531: result: yes
configure:3534: checking for C compiler default output file name
configure:3536: result: a.out
configure:3542: checking for suffix of executables
configure:3549: cc -o conftest conftest.c >&5
configure:3553: $? = 0
configure:3576: result:
configure:3598: checking whether we are cross compiling
configure:3606: cc -o conftest conftest.c >&5
configure:3610: $? = 0
configure:3617: ./conftest
configure:3621: $? = 0
configure:3636: result: no
configure:3641: checking for suffix of object files
configure:3664: cc -c conftest.c >&5
configure:3668: $? = 0
configure:3690: result: o
configure:3694: checking whether the compiler supports GNU C
configure:3714: cc -c conftest.c >&5
configure:3714: $? = 0
configure:3724: result: yes
configure:3735: checking whether cc accepts -g
configure:3756: cc -c -g conftest.c >&5
configure:3756: $? = 0
configure:3800: result: yes
configure:3820: checking for cc option to enable C11 features
configure:3835: cc -c -g -O2 conftest.c >&5
configure:3835: $? = 0
configure:3853: result: none needed
configure:3969: checking how to run the C preprocessor
configure:3995: cc -E conftest.c
configure:3995: $? = 0
configure:4010: cc -E conftest.c
conftest.c:9:10: fatal error: ac_nonexistent.h: No such file or directory
9 | #include <ac_nonexistent.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
configure:4010: $? = 1
configure: failed program was:
| /* confdefs.h /
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /
end confdefs.h. /
| #include <ac_nonexistent.h>
configure:4037: result: cc -E
configure:4051: cc -E conftest.c
configure:4051: $? = 0
configure:4066: cc -E conftest.c
conftest.c:9:10: fatal error: ac_nonexistent.h: No such file or directory
9 | #include <ac_nonexistent.h>
| ^~~~~~~~~~~~~~~~~~
compilation terminated.
configure:4066: $? = 1
configure: failed program was:
| /
confdefs.h /
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /
end confdefs.h. /
| #include <ac_nonexistent.h>
configure:4099: checking for icc
configure:4109: result: no
configure:4123: checking for suncc
configure:4133: result: no
configure:4151: checking for system library directory
configure:4167: result: lib
configure:4174: checking if compiler supports -Wl,-rpath,
configure:4194: cc -o conftest -g -O2 conftest.c -Wl,-rpath,/usr/lib >&5
configure:4194: $? = 0
configure:4205: result: yes
configure:4324: checking for PHP prefix
configure:4326: result: /usr/local
configure:4328: checking for PHP includes
configure:4330: result: -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
configure:4332: checking for PHP extension directory
configure:4334: result: /usr/local/lib/php/extensions/no-debug-zts-20240924
configure:4336: checking for PHP installed headers prefix
configure:4338: result: /usr/local/include/php
configure:4341: checking if debugging is enabled
configure:4364: result: no
configure:4367: checking if PHP is built with thread safety (ZTS)
configure:4390: result: yes
configure:4466: result:
configure:4468: result: �[1mConfiguring extension�[m
configure:4475: checking for MySQL support for PDO
configure:4516: result: yes, shared
configure:4523: checking for MySQL Unix socket location
configure:4536: result:
configure:4757: checking for PDO includes
configure:4771: result: /usr/local/include/php/ext
configure:5102: result:
configure:5104: result: �[1mConfiguring libtool�[m
configure:5189: checking for a sed that does not truncate output
configure:5244: result: /usr/bin/sed
configure:5259: checking for ld used by cc
configure:5327: result: /usr/bin/ld
configure:5334: checking if the linker (/usr/bin/ld) is GNU ld
configure:5350: result: yes
configure:5355: checking for /usr/bin/ld option to reload object files
configure:5363: result: -r
configure:5381: checking for BSD-compatible nm
configure:5431: result: /usr/bin/nm -B
configure:5435: checking whether ln -s works
configure:5439: result: yes
configure:5446: checking how to recognize dependent libraries
configure:5633: result: pass_all
configure:5718: cc -c -g -O2 conftest.c >&5
configure:5721: $? = 0
configure:5856: checking for stdio.h
configure:5856: cc -c -g -O2 conftest.c >&5
configure:5856: $? = 0
configure:5856: result: yes
configure:5856: checking for stdlib.h
configure:5856: cc -c -g -O2 conftest.c >&5
configure:5856: $? = 0
configure:5856: result: yes
configure:5856: checking for string.h
configure:5856: cc -c -g -O2 conftest.c >&5
configure:5856: $? = 0
configure:5856: result: yes
configure:5856: checking for inttypes.h
configure:5856: cc -c -g -O2 conftest.c >&5
configure:5856: $? = 0
configure:5856: result: yes
configure:5856: checking for stdint.h
configure:5856: cc -c -g -O2 conftest.c >&5
configure:5856: $? = 0
configure:5856: result: yes
configure:5856: checking for strings.h
configure:5856: cc -c -g -O2 conftest.c >&5
configure:5856: $? = 0
configure:5856: result: yes
configure:5856: checking for sys/stat.h
configure:5856: cc -c -g -O2 conftest.c >&5
configure:5856: $? = 0
configure:5856: result: yes
configure:5856: checking for sys/types.h
configure:5856: cc -c -g -O2 conftest.c >&5
configure:5856: $? = 0
configure:5856: result: yes
configure:5856: checking for unistd.h
configure:5856: cc -c -g -O2 conftest.c >&5
configure:5856: $? = 0
configure:5856: result: yes
configure:5881: checking for dlfcn.h
configure:5881: cc -c -g -O2 conftest.c >&5
configure:5881: $? = 0
configure:5881: result: yes
configure:5900: checking the maximum length of command line arguments
configure:6013: result: 1572864
configure:6025: checking command to parse /usr/bin/nm -B output from cc object
configure:6131: cc -c -g -O2 conftest.c >&5
configure:6134: $? = 0
configure:6138: /usr/bin/nm -B conftest.o | sed -n -e 's/^.
[ ]([ABCDGIRSTW][ABCDGIRSTW])[ ][ ]([_A-Za-z][_A-Za-z0-9]*)$/\1 \2 \2/p' > conftest.nm
configure:6141: $? = 0
configure:6193: cc -o conftest -g -O2 conftest.c conftstm.o >&5
configure:6196: $? = 0
configure:6234: result: ok
configure:6238: checking for objdir
configure:6254: result: .libs
configure:6351: checking for ar
configure:6372: found /usr/bin/ar
configure:6383: result: ar
configure:6453: checking for ranlib
configure:6474: found /usr/bin/ranlib
configure:6485: result: ranlib
configure:6555: checking for strip
configure:6576: found /usr/bin/strip
configure:6587: result: strip
configure:7181: checking if cc supports -fno-rtti -fno-exceptions
configure:7200: cc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5
cc1: warning: command-line option '-fno-rtti' is valid for C++/D/ObjC++ but not for C
configure:7204: $? = 0
configure:7217: result: no
configure:7232: checking for cc option to produce PIC
configure:7472: result: -fPIC
configure:7480: checking if cc PIC flag -fPIC works
configure:7499: cc -c -g -O2 -fPIC -DPIC conftest.c >&5
configure:7503: $? = 0
configure:7516: result: yes
configure:7544: checking if cc static flag -static works
configure:7573: result: yes
configure:7583: checking if cc supports -c -o file.o
configure:7605: cc -c -g -O2 -o out/conftest2.o conftest.c >&5
configure:7609: $? = 0
configure:7631: result: yes
configure:7657: checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries
configure:8585: result: yes
configure:8606: checking whether -lc should be explicitly linked in
configure:8611: cc -c -g -O2 conftest.c >&5
configure:8614: $? = 0
configure:8629: cc -shared conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2>&1 | grep -lc >/dev/null 2>&1
configure:8632: $? = 0
configure:8644: result: no
configure:8652: checking dynamic linker characteristics
configure:9261: result: GNU/Linux ld.so
configure:9287: checking how to hardcode library paths into programs
configure:9312: result: immediate
configure:9326: checking whether stripping libraries is possible
configure:9331: result: yes
configure:9846: checking if libtool supports shared libraries
configure:9848: result: yes
configure:9851: checking whether to build shared libraries
configure:9872: result: yes
configure:9875: checking whether to build static libraries
configure:9879: result: no
configure:9973: result:
creating libtool
configure:13607: result:
configure:13609: result: �[1mGenerating files�[m
configure:13726: creating build directories
configure:13731: creating Makefile
configure:13747: patching config.h.in
configure:13758: creating ./config.status

----------------------

Running config.status.

----------------------

This file was extended by config.status, which was
generated by GNU Autoconf 2.71. Invocation command line was

CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status

on imwox

config.status:671: creating config.h

----------------

Cache variables.

----------------

ac_cv_build=x86_64-pc-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_PKG_CONFIG_LIBDIR_set=
ac_cv_env_PKG_CONFIG_LIBDIR_value=
ac_cv_env_PKG_CONFIG_PATH_set=
ac_cv_env_PKG_CONFIG_PATH_value=
ac_cv_env_PKG_CONFIG_set=
ac_cv_env_PKG_CONFIG_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_header_dlfcn_h=yes
ac_cv_header_inttypes_h=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdio_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_host=x86_64-pc-linux-gnu
ac_cv_objext=o
ac_cv_path_EGREP='/usr/bin/grep -E'
ac_cv_path_GREP=/usr/bin/grep
ac_cv_path_SED=/usr/bin/sed
ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config
ac_cv_prog_AWK=nawk
ac_cv_prog_CPP='cc -E'
ac_cv_prog_ac_ct_AR=ar
ac_cv_prog_ac_ct_CC=cc
ac_cv_prog_ac_ct_RANLIB=ranlib
ac_cv_prog_ac_ct_STRIP=strip
ac_cv_prog_cc_c11=
ac_cv_prog_cc_g=yes
ac_cv_prog_cc_stdc=
ac_cv_target=x86_64-pc-linux-gnu
lt_cv_deplibs_check_method=pass_all
lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
lt_cv_ld_reload_flag=-r
lt_cv_objdir=.libs
lt_cv_path_LD=/usr/bin/ld
lt_cv_path_NM='/usr/bin/nm -B'
lt_cv_path_SED=/usr/bin/sed
lt_cv_prog_compiler_c_o=yes
lt_cv_prog_compiler_pic_works=yes
lt_cv_prog_compiler_rtti_exceptions=no
lt_cv_prog_compiler_static_works=yes
lt_cv_prog_gnu_ld=yes
lt_cv_sys_global_symbol_pipe='sed -n -e '''s/^.[ ]([ABCDGIRSTW][ABCDGIRSTW])[ ][ ]([_A-Za-z][_A-Za-z0-9])$/\1 \2 \2/p''''
lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '''s/^: ([^ ]) $/ {"\1", (lt_ptr) 0},/p''' -e '''s/^[BCDEGRST] ([^ ]) ([^ ])$/ {"\2", (lt_ptr) &\2},/p''''
lt_cv_sys_global_symbol_to_cdecl='sed -n -e '''s/^. .
(.)$/extern int \1;/p''''
lt_cv_sys_lib_dlsearch_path_spec='/lib /usr/lib /usr/lib/x86_64-linux-gnu/libfakeroot /usr/local/lib /usr/local/lib/x86_64-linux-gnu /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu '
lt_cv_sys_lib_search_path_spec='/usr/lib/gcc/x86_64-linux-gnu/12 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib'
lt_cv_sys_max_cmd_len=1572864
lt_lt_cv_prog_compiler_c_o='"yes"'
lt_lt_cv_sys_global_symbol_pipe='"sed -n -e '''s/^.
[ ]\([ABCDGIRSTW][ABCDGIRSTW]\)[ ][ ]\([_A-Za-z][_A-Za-z0-9]\)$/\1 \2 \2/p'''"'
lt_lt_cv_sys_global_symbol_to_c_name_address='"sed -n -e '''s/^: \([^ ]
\) $/ {\"\1\", (lt_ptr) 0},/p''' -e '''s/^[BCDEGRST] \([^ ]\) \([^ ]\)$/ {"\2", (lt_ptr) \&\2},/p'''"'
lt_lt_cv_sys_global_symbol_to_cdecl='"sed -n -e '''s/^. .* \(.*\)$/extern int \1;/p'''"'
pdo_cv_inc_path=/usr/local/include/php/ext
php_cv_cc_rpath=yes

-----------------

Output variables.

-----------------

AR='ar'
AWK='nawk'
BUILD_CC='cc'
CC='cc'
CFLAGS='-g -O2'
CONFIGURE_COMMAND=' '''./configure''' '''--with-pdo-mysql=mysqlnd''''
CONFIGURE_OPTIONS=' '''--with-pdo-mysql=mysqlnd''''
CPP='cc -E'
CPPFLAGS=' -DHAVE_CONFIG_H'
DEFS='-DHAVE_CONFIG_H'
DSYMUTIL=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='/usr/bin/grep -E'
EXEEXT=''
GREP='/usr/bin/grep'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
LN_S='ln -s'
LTLIBOBJS=''
NMEDIT=''
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PKG_CONFIG='/usr/bin/pkg-config'
PKG_CONFIG_LIBDIR=''
PKG_CONFIG_PATH=''
RANLIB='ranlib'
SED='/usr/bin/sed'
SHELL='/bin/bash'
SHLIB_DL_SUFFIX_NAME='so'
SHLIB_SUFFIX_NAME='so'
STRIP='strip'
ac_ct_CC='cc'
bindir='${exec_prefix}/bin'
build='x86_64-pc-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='$(prefix)'
host='x86_64-pc-linux-gnu'
host_alias='x86_64-pc-linux-gnu'
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='pc'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr/local'
program_transform_name='s,x,x,'
psdir='${docdir}'
runstatedir='${localstatedir}/run'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target='x86_64-pc-linux-gnu'
target_alias=''
target_cpu='x86_64'
target_os='linux-gnu'
target_vendor='pc'

-----------

confdefs.h.

-----------

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define PHP_MYSQL_UNIX_SOCK_ADDR ""
#define PDO_USE_MYSQLND 1
#define COMPILE_DL_PDO_MYSQL 1
#define HAVE_STDIO_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_STRINGS_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define STDC_HEADERS 1
#define HAVE_DLFCN_H 1

configure: exit 0

@nielsdos
Copy link
Member

nielsdos commented Jun 9, 2025

Everything looks right for your compilation.
This leaves the following question:
Are you sure you're loading the pdo_mysql library from the right location? If PHP (may be even a different version) is already installed on your system then it's possible it's trying to load the version from your distro rather than the one you built.

@hexiuzhe2015
Copy link
Author

Installing shared extensions: /usr/local/lib/php/extensions/no-debug-zts-20240924/

root@imwox:/usr/local/lib/php/extensions/no-debug-zts-20240924# ls
mbstring.so opcache.so pcntl.so protobuf.so swoole.so
mysqlnd.so openssl.so pdo_mysql.so redis.so

PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'pdo_mysql' in Unknown on line 0

Warning: PHP Startup: Invalid library (maybe not a PHP library) 'pdo_mysql' in Unknown on line 0
PHP 8.4.7-dev (cli) (built: May 13 2025 12:11:51) (ZTS)
Copyright (c) The PHP Group
Zend Engine v4.4.7-dev, Copyright (c) Zend Technologies

@nielsdos
Copy link
Member

I don't quite understand why this happens.
Can you please run nm <location of pdo_mysql.so> and share the output?

@hexiuzhe2015
Copy link
Author

nm /usr/local/lib/php/extensions/no-debug-zts-20240924/pdo_mysql.so
U add_assoc_long_ex
U add_assoc_string_ex
U add_assoc_zval_ex
U add_next_index_long
U add_next_index_string
00000000000072c0 r arginfo_class_Pdo_Mysql_getWarningCount
0000000000009ba0 d class_Pdo_Mysql_methods
000000000000a2c8 b completed.0
w __cxa_finalize@GLIBC_2.2.5
00000000000024a0 t deregister_tm_clones
U display_ini_entries
0000000000002510 t __do_global_dtors_aux
0000000000009b18 d __do_global_dtors_aux_fini_array_entry
000000000000a200 d __dso_handle
0000000000009da8 d _DYNAMIC
U _ecalloc
U _efree
U _emalloc
U _emalloc_48
U _erealloc
U _estrdup
U executor_globals_offset
000000000000668c t _fini
0000000000002550 t frame_dummy
0000000000009b10 d __frame_dummy_init_array_entry
00000000000082f4 r FRAME_END
U free@GLIBC_2.2.5
0000000000009fe8 d GLOBAL_OFFSET_TABLE
w gmon_start
0000000000007914 r __GNU_EH_FRAME_HDR
0000000000009ca0 d ini_entries
0000000000002000 t _init
U instanceof_function_slow
w _ITM_deregisterTMCloneTable
w _ITM_registerTMCloneTable
U memcpy@GLIBC_2.14
0000000000003e30 t mysql_handle_begin
0000000000003430 t mysql_handle_closer
0000000000003cc0 t mysql_handle_commit
0000000000003d20 t mysql_handle_doer
0000000000003ea0 t mysql_handle_preparer
0000000000003530 t mysql_handle_quoter
0000000000003c70 t mysql_handle_rollback
0000000000009d20 d mysql_methods
U mysqlnd_connection_connect
U mysqlnd_connection_init
U mysqlnd_get_client_info
U mysqlnd_reverse_api_register_api
0000000000009c40 d mysql_stmt_methods
U OnUpdateStringUnempty
U pdo_dbh_ce
U pdo_dbh_new
U pdo_get_bool_param
U pdo_get_long_param
000000000000a2d8 b pdo_mysql_ce
00000000000033a0 t pdo_mysql_check_liveness
00000000000025f0 t pdo_mysql_convert_zv_to_mysqlnd
0000000000002482 t pdo_mysql_convert_zv_to_mysqlnd.cold
0000000000009b20 d pdo_mysql_deps
0000000000009c00 d pdo_mysql_driver
0000000000003760 t _pdo_mysql_error
00000000000034b0 t pdo_mysql_fetch_error_func
0000000000005660 t pdo_mysql_fill_stmt_from_result
00000000000053f0 t pdo_mysql_free_result
0000000000003a00 t pdo_mysql_get_attribute
000000000000a2d0 b pdo_mysql_globals_id
0000000000004160 t pdo_mysql_handle_factory
0000000000003400 t pdo_mysql_in_transaction
0000000000003500 t pdo_mysql_last_insert_id
000000000000a220 d pdo_mysql_module_entry
00000000000033d0 t pdo_mysql_request_shutdown
0000000000009b80 d pdo_mysql_reverse_api
00000000000061e0 t pdo_mysql_scanner
0000000000005180 t pdo_mysql_set_attribute
0000000000005560 t pdo_mysql_stmt_after_execute_prepared
00000000000057d0 t pdo_mysql_stmt_col_meta
00000000000054a0 t pdo_mysql_stmt_cursor_closer
0000000000005e90 t pdo_mysql_stmt_describe
00000000000060c0 t pdo_mysql_stmt_dtor
0000000000005b80 t pdo_mysql_stmt_execute
0000000000005f80 t pdo_mysql_stmt_fetch
0000000000005380 t pdo_mysql_stmt_get_col
0000000000005720 t pdo_mysql_stmt_next_rowset
0000000000005c70 t pdo_mysql_stmt_param_hook
U pdo_parse_params
U pdo_raise_impl_error
U pdo_throw_exception
U php_check_open_basedir
U php_error_docref
U php_file_le_pstream
U php_file_le_stream
U php_info_print_table_end
U php_info_print_table_row
U php_info_print_table_start
U php_pdo_get_dbh_ce
U php_pdo_parse_data_source
U php_pdo_register_driver
U php_pdo_register_driver_specific_ce
U php_pdo_stmt_set_column_count
U php_pdo_unregister_driver
U _php_stream_copy_to_mem
U rc_dtor_func
0000000000002650 t register_class_Pdo_Mysql
00000000000024d0 t register_tm_clones
U _safe_emalloc
U std_object_handlers
U strcmp@GLIBC_2.2.5
U strcpy@GLIBC_2.2.5
U strlen@GLIBC_2.2.5
U strtol@GLIBC_2.2.5
000000000000a2c8 d TMC_END
U _tsrm_ls_cache
U __zend_calloc
U zend_declare_class_constant_long
U zend_declare_typed_class_constant
U zend_empty_string
U zend_fetch_resource2_ex
U zend_hash_index_find
U _zend_new_array_0
U zend_register_ini_entries_ex
U zend_register_internal_class_with_flags
U __zend_strdup
U zend_string_init_interned
U zend_strpprintf
U zend_throw_error
U zend_u64_to_str
U zend_unregister_ini_entries_ex
U zend_wrong_parameters_none_error
0000000000002570 t zim_Pdo_Mysql_getWarningCount
0000000000002410 t zim_Pdo_Mysql_getWarningCount.cold
0000000000002560 t zm_globals_ctor_pdo_mysql
0000000000002436 t zm_info_pdo_mysql
00000000000025c0 t zm_shutdown_pdo_mysql
0000000000003150 t zm_startup_pdo_mysql
U zval_get_long_func
U zval_ptr_dtor
U zval_try_get_string_func

@nielsdos
Copy link
Member

nielsdos commented Jun 11, 2025

You used the following configure line: ./configure --with-pdo-mysql=mysqlnd. This means that pdo_mysql will be compiled and linked statically inside the PHP executable. This means that the extension is always loaded and that it doesn't create a pdo_mysql.so file. The pdo_mysql.so file that you showed is not the one you just built.
To solve the issue, either configure pdo_mysql as shared to build a .so file; OR keep it static but remove the extension=pdo_mysql line from your php.ini.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants