Skip to content
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

Unable to install on clean Ubuntu 22.04 docker #314

Open
donhardman opened this issue Mar 18, 2024 · 4 comments
Open

Unable to install on clean Ubuntu 22.04 docker #314

donhardman opened this issue Mar 18, 2024 · 4 comments

Comments

@donhardman
Copy link

donhardman commented Mar 18, 2024

I tried to install cargo-php in different envs and still failed.

The PHP version:

Usage: /usr/bin/php-config [OPTION]
Options:
  --prefix            [/usr]
  --includes          [-I/usr/include/php/20230831 -I/usr/include/php/20230831/main -I/usr/include/php/20230831/TSRM -I/usr/include/php/20230831/Zend -I/usr/include/php/20230831/ext -I/usr/include/php/20230831/ext/date/lib ]
  --ldflags           [-L/usr/lib/php/20230831 ]
  --libs              [-lcrypt   -lrt -lm  -lxml2 -lssl -lcrypto -lpcre2-8 -lz -lsodium -largon2 -lrt -ldl -lcrypt ]
  --extension-dir     [/usr/lib/php/20230831]
  --include-dir       [/usr/include/php/20230831]
  --man-dir           [/usr/share/man]
  --php-binary        [/usr/bin/php8.3]
  --php-sapis         [apache2handler cgi cli fpm ]
  --phpapi            [20230831]
  --ini-path          [/etc/php/8.3/cli]
  --ini-dir           [/etc/php/8.3/cli/conf.d]
  --configure-options [--includedir=/usr/include --mandir=/usr/share/man --infodir=/usr/share/info --disable-option-checking --disable-silent-rules --libdir=/usr/lib/x86_64-linux-gnu --libexecdir=/usr/lib/x86_64-linux-gnu --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr --enable-cli --disable-cgi --disable-phpdbg --with-config-file-path=/etc/php/8.3/cli --with-config-file-scan-dir=/etc/php/8.3/cli/conf.d --build=x86_64-linux-gnu --host=x86_64-linux-gnu --config-cache --cache-file=/tmp/buildd/nonexistent/config.cache --libdir=${prefix}/lib/php --libexecdir=${prefix}/lib/php --datadir=${prefix}/share/php/8.3 --program-suffix=8.3 --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man --disable-all --disable-debug --disable-rpath --disable-static --disable-dtrace --with-pic --with-layout=GNU --without-pear --enable-filter --with-openssl --with-password-argon2=/usr --with-external-pcre --enable-hash --with-mhash=/usr --with-libxml --enable-session --with-sodium --with-system-tzdata --with-zlib=/usr --with-zlib-dir=/usr --enable-pcntl --with-libedit=shared,/usr build_alias=x86_64-linux-gnu host_alias=x86_64-linux-gnu CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -O2 -Wall -pedantic -fsigned-char -fno-strict-aliasing -DOPENSSL_SUPPRESS_DEPRECATED -g]
  --version           [8.3.4]
  --vernum            [80304]

PHP 8.3 dev installed also

root@e11b839d51de:/# apt-get install php8.3-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
php8.3-dev is already the newest version (8.3.4-1+ubuntu22.04.1+deb.sury.org+1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.

Rust:

root@e11b839d51de:/# rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /root/.rustup

stable-x86_64-unknown-linux-gnu (default)
rustc 1.76.0 (07dca489a 2024-02-04)

Is the lib incompatible with PHP 8.3 to I'm doing something wrong?

Getting error:

Compiling skeptic v0.13.7
   Compiling ext-php-rs v0.12.0
error: linking with `cc` failed: exit status: 1
  |
  = note: LC_ALL="C" PATH="/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin:/root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" VSLANG="1033" "cc" "-m64" "/tmp/rustcG1JMW6/symbols.o" "/tmp/cargo-installwi2ITp/release/deps/cargo_php-11c41250088fc911.cargo_php.65c10131f3e3dfaf-cgu.0.rcgu.o" "/tmp/cargo-installwi2ITp/release/deps/cargo_php-11c41250088fc911.50z5gbqcniv8exn9.rcgu.o" "-Wl,--as-needed" "-L" "/tmp/cargo-installwi2ITp/release/deps" "-L" "/tmp/cargo-installwi2ITp/release/build/ext-php-rs-213852a66977c713/out" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/tmp/cargo-installwi2ITp/release/deps/libcargo_php-5773b251d7bd545c.rlib" "/tmp/cargo-installwi2ITp/release/deps/libdialoguer-f7332ef696506b32.rlib" "/tmp/cargo-installwi2ITp/release/deps/libshell_words-ec465b377a96c88d.rlib" "/tmp/cargo-installwi2ITp/release/deps/libtempfile-dd049fb5d68ce0e1.rlib" "/tmp/cargo-installwi2ITp/release/deps/libfastrand-dc94890265d70093.rlib" "/tmp/cargo-installwi2ITp/release/deps/librustix-5a7d92243c255bdd.rlib" "/tmp/cargo-installwi2ITp/release/deps/liblinux_raw_sys-18ce2bdc37be49e4.rlib" "/tmp/cargo-installwi2ITp/release/deps/libzeroize-7c195843359114f6.rlib" "/tmp/cargo-installwi2ITp/release/deps/libconsole-e0839a40f77af578.rlib" "/tmp/cargo-installwi2ITp/release/deps/libunicode_width-55bfc6efb7eb18d0.rlib" "/tmp/cargo-installwi2ITp/release/deps/liblazy_static-df89fd9b4b197d62.rlib" "/tmp/cargo-installwi2ITp/release/deps/libclap-cc4319dfb99a0780.rlib" "/tmp/cargo-installwi2ITp/release/deps/libclap_builder-8530ca530bfac5ea.rlib" "/tmp/cargo-installwi2ITp/release/deps/libstrsim-b11e20ec252427e7.rlib" "/tmp/cargo-installwi2ITp/release/deps/libanstream-227e386c5fa55298.rlib" "/tmp/cargo-installwi2ITp/release/deps/libanstyle_query-1bb3788cb20a2400.rlib" "/tmp/cargo-installwi2ITp/release/deps/libcolorchoice-2c890d5db250cbc2.rlib" "/tmp/cargo-installwi2ITp/release/deps/libanstyle_parse-7b3d384b5696a2a0.rlib" "/tmp/cargo-installwi2ITp/release/deps/libutf8parse-6ef9fb1153593502.rlib" "/tmp/cargo-installwi2ITp/release/deps/libclap_lex-bd6601e90003c752.rlib" "/tmp/cargo-installwi2ITp/release/deps/libanstyle-c711b523ed3e17c2.rlib" "/tmp/cargo-installwi2ITp/release/deps/libcargo_metadata-e0128185fe99d7d9.rlib" "/tmp/cargo-installwi2ITp/release/deps/libserde_json-f9736dcde70fa6ca.rlib" "/tmp/cargo-installwi2ITp/release/deps/libitoa-7cdd2fa6c50c1dc2.rlib" "/tmp/cargo-installwi2ITp/release/deps/libryu-de43c5cd96ac6c48.rlib" "/tmp/cargo-installwi2ITp/release/deps/libthiserror-a9006b665ee14445.rlib" "/tmp/cargo-installwi2ITp/release/deps/libcargo_platform-c450322f22a54ed8.rlib" "/tmp/cargo-installwi2ITp/release/deps/libsemver-267161324b14b371.rlib" "/tmp/cargo-installwi2ITp/release/deps/libcamino-e2045a23c42c7421.rlib" "/tmp/cargo-installwi2ITp/release/deps/libserde-0279b52bc8fad6c0.rlib" "/tmp/cargo-installwi2ITp/release/deps/liblibloading-e201181af317917d.rlib" "/tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib" "/tmp/cargo-installwi2ITp/release/deps/libparking_lot-1bb8bd371b63f669.rlib" "/tmp/cargo-installwi2ITp/release/deps/libparking_lot_core-c4402e616f44b52c.rlib" "/tmp/cargo-installwi2ITp/release/deps/liblibc-47aeb182d191f913.rlib" "/tmp/cargo-installwi2ITp/release/deps/libcfg_if-95c308b6654d0c6e.rlib" "/tmp/cargo-installwi2ITp/release/deps/libsmallvec-784f5d1cfc0342a8.rlib" "/tmp/cargo-installwi2ITp/release/deps/liblock_api-2d604e0b568dcf55.rlib" "/tmp/cargo-installwi2ITp/release/deps/libscopeguard-579390e7304c5461.rlib" "/tmp/cargo-installwi2ITp/release/deps/libonce_cell-e4efe7c6ab7237ab.rlib" "/tmp/cargo-installwi2ITp/release/deps/libbitflags-00c347b32320904a.rlib" "/tmp/cargo-installwi2ITp/release/deps/libanyhow-d6d4f573e416e237.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-66d8041607d2929b.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-a57e2388c0aea9b1.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-dcd9be90ae2cb505.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-516789932d161b4e.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-1ff34b0cf871cb60.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-0c110dd0650d6cb7.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-a6e97aae2681ad8f.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-b93dac2525ec4d1e.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-ce1d65fb391ae98b.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-8933a2fb54d88492.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-306712ebb1ee1a3f.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-349c574f342b0d30.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-65c422a3ad95273d.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-7e6330a6c0cb9441.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-39c59240bfdfab27.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-e9d126c51bb8b2bb.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-5af394d9b1f07bdc.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-693a8f23970c5917.rlib" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-13fc9d1ed9c7a2bc.rlib" "-Wl,-Bdynamic" "-ldl" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/tmp/cargo-installwi2ITp/release/deps/cargo_php-11c41250088fc911" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-rdynamic"
  = note: /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(2e40c9e35e9506f4-wrapper.o): in function `ext_php_rs_process_globals':
          wrapper.c:(.text.ext_php_rs_process_globals+0x7): undefined reference to `core_globals'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(2e40c9e35e9506f4-wrapper.o): in function `ext_php_rs_sapi_globals':
          wrapper.c:(.text.ext_php_rs_sapi_globals+0x7): undefined reference to `sapi_globals'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(2e40c9e35e9506f4-wrapper.o): in function `ext_php_rs_file_globals':
          wrapper.c:(.text.ext_php_rs_file_globals+0x7): undefined reference to `file_globals'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(2e40c9e35e9506f4-wrapper.o): in function `ext_php_rs_sapi_module':
          wrapper.c:(.text.ext_php_rs_sapi_module+0x7): undefined reference to `sapi_module'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(2e40c9e35e9506f4-wrapper.o): in function `ext_php_rs_zend_bailout':
          wrapper.c:(.text.unlikely.ext_php_rs_zend_bailout+0x12): undefined reference to `_zend_bailout'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.09.rcgu.o): in function `ext_php_rs::exception::PhpException::throw':
          ext_php_rs.dcae0519b540bdb-cgu.09:(.text._ZN10ext_php_rs9exception12PhpException5throw17h2da6099ff8102e94E+0x20): undefined reference to `zend_throw_exception_object'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.09.rcgu.o): in function `ext_php_rs::exception::throw_object':
          ext_php_rs.dcae0519b540bdb-cgu.09:(.text._ZN10ext_php_rs9exception12throw_object17h7a95182ff360011fE+0x14): undefined reference to `zend_throw_exception_object'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.14.rcgu.o): in function `ext_php_rs::zend::php_sapi_name':
          ext_php_rs.dcae0519b540bdb-cgu.14:(.text._ZN10ext_php_rs4zend13php_sapi_name17hdac1eca67d311267E+0x11): undefined reference to `sapi_module'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.01.rcgu.o): in function `ext_php_rs::types::object::<impl ext_php_rs::ffi::_zend_object>::instance_of':
          ext_php_rs.dcae0519b540bdb-cgu.01:(.text._ZN10ext_php_rs5types6object47_$LT$impl$u20$ext_php_rs..ffi.._zend_object$GT$11instance_of17h651f7892e58bd673E+0x10): undefined reference to `instanceof_function_slow'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.01.rcgu.o): in function `ext_php_rs::types::object::<impl ext_php_rs::ffi::_zend_object>::is_traversable':
          ext_php_rs.dcae0519b540bdb-cgu.01:(.text._ZN10ext_php_rs5types6object47_$LT$impl$u20$ext_php_rs..ffi.._zend_object$GT$14is_traversable17h627292c494c2423eE+0x21): undefined reference to `instanceof_function_slow'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.01.rcgu.o): in function `ext_php_rs::types::zval::<impl ext_php_rs::ffi::_zval_struct>::traversable':
          ext_php_rs.dcae0519b540bdb-cgu.01:(.text._ZN10ext_php_rs5types4zval47_$LT$impl$u20$ext_php_rs..ffi.._zval_struct$GT$11traversable17h991c65d2e44e90a8E+0x64): undefined reference to `instanceof_function_slow'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.01.rcgu.o): in function `ext_php_rs::types::zval::<impl ext_php_rs::ffi::_zval_struct>::iterable':
          ext_php_rs.dcae0519b540bdb-cgu.01:(.text._ZN10ext_php_rs5types4zval47_$LT$impl$u20$ext_php_rs..ffi.._zval_struct$GT$8iterable17hac4d0db69fb75544E+0x6): undefined reference to `zend_is_iterable'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.01.rcgu.o): in function `ext_php_rs::types::zval::<impl ext_php_rs::ffi::_zval_struct>::is_traversable':
          ext_php_rs.dcae0519b540bdb-cgu.01:(.text._ZN10ext_php_rs5types4zval47_$LT$impl$u20$ext_php_rs..ffi.._zval_struct$GT$14is_traversable17h3a0aa9ce5a8486beE+0x61): undefined reference to `instanceof_function_slow'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.01.rcgu.o): in function `ext_php_rs::types::zval::<impl ext_php_rs::ffi::_zval_struct>::is_iterable':
          ext_php_rs.dcae0519b540bdb-cgu.01:(.text._ZN10ext_php_rs5types4zval47_$LT$impl$u20$ext_php_rs..ffi.._zval_struct$GT$11is_iterable17h59c9847b7f93f0f2E+0x2): undefined reference to `zend_is_iterable'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.01.rcgu.o): in function `ext_php_rs::types::zval::<impl core::fmt::Debug for ext_php_rs::ffi::_zval_struct>::fmt':
          ext_php_rs.dcae0519b540bdb-cgu.01:(.text._ZN10ext_php_rs5types4zval76_$LT$impl$u20$core..fmt..Debug$u20$for$u20$ext_php_rs..ffi.._zval_struct$GT$3fmt17h10c2f3051f9ef8a6E+0x254): undefined reference to `zend_is_iterable'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.01.rcgu.o): in function `ext_php_rs::zend::class::<impl ext_php_rs::ffi::_zend_class_entry>::instance_of':
          ext_php_rs.dcae0519b540bdb-cgu.01:(.text._ZN10ext_php_rs4zend5class52_$LT$impl$u20$ext_php_rs..ffi.._zend_class_entry$GT$11instance_of17h7142106f006ece10E+0x7): undefined reference to `instanceof_function_slow'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.01.rcgu.o): in function `ext_php_rs::zend::globals::<impl ext_php_rs::ffi::_php_core_globals>::http_server_vars':
          ext_php_rs.dcae0519b540bdb-cgu.01:(.text._ZN10ext_php_rs4zend7globals52_$LT$impl$u20$ext_php_rs..ffi.._php_core_globals$GT$16http_server_vars17hffbd5ea7024e1582E+0x5f): undefined reference to `zend_is_auto_global'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.01.rcgu.o): in function `ext_php_rs::zend::streams::<impl ext_php_rs::ffi::_php_stream_wrapper>::get':
          ext_php_rs.dcae0519b540bdb-cgu.01:(.text._ZN10ext_php_rs4zend7streams54_$LT$impl$u20$ext_php_rs..ffi.._php_stream_wrapper$GT$3get17h1445ef78d67051cfE+0x6): undefined reference to `php_stream_locate_url_wrapper'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.01.rcgu.o): in function `ext_php_rs::zend::streams::<impl ext_php_rs::ffi::_php_stream_wrapper>::register':
          ext_php_rs.dcae0519b540bdb-cgu.01:(.text._ZN10ext_php_rs4zend7streams54_$LT$impl$u20$ext_php_rs..ffi.._php_stream_wrapper$GT$8register17h7b67d02f3b9758b9E+0x87): undefined reference to `php_register_url_stream_wrapper'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.01.rcgu.o): in function `ext_php_rs::zend::streams::<impl ext_php_rs::ffi::_php_stream_wrapper>::register_volatile':
          ext_php_rs.dcae0519b540bdb-cgu.01:(.text._ZN10ext_php_rs4zend7streams54_$LT$impl$u20$ext_php_rs..ffi.._php_stream_wrapper$GT$17register_volatile17h740ddd305390705aE+0x66): undefined reference to `php_register_url_stream_wrapper_volatile'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.01.rcgu.o): in function `ext_php_rs::zend::streams::<impl ext_php_rs::ffi::_php_stream_wrapper>::unregister':
          ext_php_rs.dcae0519b540bdb-cgu.01:(.text._ZN10ext_php_rs4zend7streams54_$LT$impl$u20$ext_php_rs..ffi.._php_stream_wrapper$GT$10unregister17h6d9990c1c8cc77b9E+0x34): undefined reference to `php_unregister_url_stream_wrapper'
          /usr/bin/ld: /tmp/cargo-installwi2ITp/release/deps/libext_php_rs-72a5d740061aee5a.rlib(ext_php_rs-72a5d740061aee5a.ext_php_rs.dcae0519b540bdb-cgu.01.rcgu.o): in function `ext_php_rs::zend::streams::<impl ext_php_rs::ffi::_php_stream_wrapper>::unregister_volatile':
          ext_php_rs.dcae0519b540bdb-cgu.01:(.text._ZN10ext_php_rs4zend7streams54_$LT$impl$u20$ext_php_rs..ffi.._php_stream_wrapper$GT$19unregister_volatile17h7ec9a449f014b6ceE+0x22): undefined reference to `php_unregister_url_stream_wrapper_volatile'
          collect2: error: ld returned 1 exit status

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

error: could not compile `cargo-php` (bin "cargo-php") due to 1 previous error
error: failed to compile `cargo-php v0.1.9`, intermediate artifacts can be found at `/tmp/cargo-installwi2ITp`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

I have tried on OSX and also unable to install it

= note: Undefined symbols for architecture arm64:
            "__zend_bailout", referenced from:
                _ext_php_rs_zend_bailout in libext_php_rs-ed46f6ce6c5d7804.rlib(2e40c9e35e9506f4-wrapper.o)
            "_core_globals", referenced from:
                _ext_php_rs_process_globals in libext_php_rs-ed46f6ce6c5d7804.rlib(2e40c9e35e9506f4-wrapper.o)
               (maybe you meant: ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi.._php_core_globals$GT$::http_get_vars::hf3629e10b44f6cb5, ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi.._php_core_globals$GT$::http_server_vars::h10bfda666bd3178e , ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi.._php_core_globals$GT$::http_post_vars::he773faa0437af630 , ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi.._php_core_globals$GT$::get_mut::h55cb621cb16acee5 , ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi.._php_core_globals$GT$::http_request_vars::hde097aa4cbae12f9 , ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi.._php_core_globals$GT$::get::hb09b4751339a951b , ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi.._php_core_globals$GT$::http_cookie_vars::h5ef22c4b282b2e81 , ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi.._php_core_globals$GT$::http_files_vars::hcc0cc72c730c701d , ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi.._php_core_globals$GT$::http_env_vars::ha6feee933b6198d7 )
            "_file_globals", referenced from:
                _ext_php_rs_file_globals in libext_php_rs-ed46f6ce6c5d7804.rlib(2e40c9e35e9506f4-wrapper.o)
               (maybe you meant: ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi..php_file_globals$GT$::get::h31d4288dcff10406, ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi..php_file_globals$GT$::get_mut::h5a31894ef2ec39a8 , _ext_php_rs_file_globals )
            "_instanceof_function_slow", referenced from:
                ext_php_rs::types::object::_$LT$impl$u20$ext_php_rs..ffi.._zend_object$GT$::instance_of::h2e39fe9160870c66 in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.01.rcgu.o)
                ext_php_rs::types::object::_$LT$impl$u20$ext_php_rs..ffi.._zend_object$GT$::is_traversable::h9fe32c8f95c77cd5 in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.01.rcgu.o)
                ext_php_rs::types::zval::_$LT$impl$u20$ext_php_rs..ffi.._zval_struct$GT$::traversable::h9aff3a89fe01616e in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.01.rcgu.o)
                ext_php_rs::types::zval::_$LT$impl$u20$ext_php_rs..ffi.._zval_struct$GT$::is_traversable::h549989605432aaff in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.01.rcgu.o)
                ext_php_rs::zend::class::_$LT$impl$u20$ext_php_rs..ffi.._zend_class_entry$GT$::instance_of::h72a470d4af046832 in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.01.rcgu.o)
            "_php_register_url_stream_wrapper", referenced from:
                ext_php_rs::zend::streams::_$LT$impl$u20$ext_php_rs..ffi.._php_stream_wrapper$GT$::register::hec64019604f42ef3 in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.01.rcgu.o)
            "_php_register_url_stream_wrapper_volatile", referenced from:
                ext_php_rs::zend::streams::_$LT$impl$u20$ext_php_rs..ffi.._php_stream_wrapper$GT$::register_volatile::h122c4ed3a5a97e9b in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.01.rcgu.o)
            "_php_stream_locate_url_wrapper", referenced from:
                ext_php_rs::zend::streams::_$LT$impl$u20$ext_php_rs..ffi.._php_stream_wrapper$GT$::get::hbddd122231fc3d3e in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.01.rcgu.o)
            "_php_unregister_url_stream_wrapper", referenced from:
                ext_php_rs::zend::streams::_$LT$impl$u20$ext_php_rs..ffi.._php_stream_wrapper$GT$::unregister::h9e70987f671139ea in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.01.rcgu.o)
            "_php_unregister_url_stream_wrapper_volatile", referenced from:
                ext_php_rs::zend::streams::_$LT$impl$u20$ext_php_rs..ffi.._php_stream_wrapper$GT$::unregister_volatile::hf570e261f64666de in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.01.rcgu.o)
            "_sapi_globals", referenced from:
                _ext_php_rs_sapi_globals in libext_php_rs-ed46f6ce6c5d7804.rlib(2e40c9e35e9506f4-wrapper.o)
               (maybe you meant: ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi.._sapi_globals_struct$GT$::get_mut::h8bd75cda0288e4fd, ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi.._sapi_globals_struct$GT$::get::h215028ef7f1fa857 , _ext_php_rs_sapi_globals )
            "_sapi_module", referenced from:
                ext_php_rs::zend::php_sapi_name::hb9ba45cdd1eb0600 in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.08.rcgu.o)
                _ext_php_rs_sapi_module in libext_php_rs-ed46f6ce6c5d7804.rlib(2e40c9e35e9506f4-wrapper.o)
               (maybe you meant: ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi.._sapi_module_struct$GT$::get_mut::h52d43a777ef303b8, ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi.._sapi_module_struct$GT$::get::h0a1b3dbfeb20e37a , _ext_php_rs_sapi_module )
            "_zend_is_auto_global", referenced from:
                ext_php_rs::zend::globals::_$LT$impl$u20$ext_php_rs..ffi.._php_core_globals$GT$::http_server_vars::h10bfda666bd3178e in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.01.rcgu.o)
            "_zend_is_iterable", referenced from:
                ext_php_rs::types::zval::_$LT$impl$u20$ext_php_rs..ffi.._zval_struct$GT$::iterable::h96d40bd35be65168 in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.01.rcgu.o)
                ext_php_rs::types::zval::_$LT$impl$u20$ext_php_rs..ffi.._zval_struct$GT$::is_iterable::h60db4ce707360c79 in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.01.rcgu.o)
                ext_php_rs::types::zval::_$LT$impl$u20$core..fmt..Debug$u20$for$u20$ext_php_rs..ffi.._zval_struct$GT$::fmt::h4aa91153363ddd5d in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.01.rcgu.o)
            "_zend_throw_exception_object", referenced from:
                ext_php_rs::exception::PhpException::throw::h2a6a7aed334fe5e9 in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.14.rcgu.o)
                ext_php_rs::exception::throw_object::h7ad51bd46393efcf in libext_php_rs-ed46f6ce6c5d7804.rlib(ext_php_rs-ed46f6ce6c5d7804.ext_php_rs.43f3f3d8836ebbcb-cgu.14.rcgu.o)
          ld: symbol(s) not found for architecture arm64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: could not compile `cargo-php` (bin "cargo-php") due to 1 previous error
error: failed to compile `cargo-php v0.1.9`, intermediate artifacts can be found at `/var/folders/0g/byj_gt315z99ztxk6n5gdzqr0000gn/T/cargo-installE1U1Tq`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path
@Xenira
Copy link

Xenira commented May 15, 2024

Had the same problem. Installing from source worked for me, but my fork might have been outdated. Will investigate soon ™️

@bcgreenwood-rs
Copy link

I've also been having this problem since ~Feb, in my case with PHP 8.2.15. Have been using primarily Centos7 in Docker, but also tried on OSX 13.X and 14.X. Same outputs as OP both times.

@clearair
Copy link

clearair commented Aug 3, 2024

I encountered the following error on macOS:

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I was able to resolve the issue by adding the following code to my build.rs file:

fn main() {
    #[cfg(target_os = "macos")]
    {
       println!("cargo:rustc-link-arg=-undefined");
       println!("cargo:rustc-link-arg=dynamic_lookup");
    }
}

@jdrouet
Copy link

jdrouet commented Sep 16, 2024

I'm having the same issue with the following dockerfile

FROM rust:bookworm

RUN apt-get update \
    && apt-get install -y libclang-dev php-dev

RUN cargo install cargo-php

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

No branches or pull requests

5 participants