phalcon / cphalcon

High performance, full-stack PHP framework delivered as a C extension.
https://phalcon.io
BSD 3-Clause "New" or "Revised" License
10.79k stars 1.96k forks source link

[NFR]: PHP 8.3 support #16477

Closed Jeckerson closed 11 months ago

Jeckerson commented 11 months ago

Blocked by https://github.com/zephir-lang/zephir/issues/2407

niden commented 11 months ago

Resolved in https://github.com/phalcon/cphalcon/pull/16478

joseluisq commented 11 months ago

Does the latest phalcon 5.5.0 support PHP 8.3?

Because I got an error when I built it from the source using Docker.

$ uname -a
# Linux c0b179ebb845 6.4.16-linuxkit #1 SMP PREEMPT Thu Nov 16 10:49:20 UTC 2023 aarch64 Linux

$ git clone --depth=1 --branch=v5.5.0 https://github.com/phalcon/cphalcon.git /opt/phalcon
$ cd /opt/phalcon/build
$ sh ./install
$ cp -r phalcon/modules/phalcon.so "$(php -r 'echo ini_get("extension_dir");')"/
$ echo "extension=phalcon" > /usr/local/etc/php/conf.d/docker-php-ext-phalcon.ini

It builds successfully but fails If I test the phalcon.so module showing the error below.

Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20230831/phalcon.so: fast_add_function: symbol not found

$ php -r 'echo ini_get("extension_dir");'

# Warning: PHP Startup: Unable to load dynamic library 'phalcon' (tried: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/phalcon (Error loading shared library /usr/local/lib/php/extensions/no-debug-non-zts-20230831/phalcon: No such file or directory), /usr/local/lib/php/extensions/no-debug-non-zts-20230831/phalcon.so (Error relocating /usr/local/lib/php/extensions/no-debug-non-zts-20230831/phalcon.so: fast_add_function: symbol not found)) in Unknown on line 0
# /usr/local/lib/php/extensions/no-debug-non-zts-20230831/: No such file or directory

Maybe I'm doing something wrong?

FYI I noted that the fast_add_function was removed from PHP 8.3 https://github.com/php/php-src/commit/3b06618813fe0979850eaa1f4bed426edb5b3123 perhaps fails because of that?

Jeckerson commented 11 months ago

@joseluisq Try to install via PECL: pecl install phalcon. For some reason build/ directory contains generated code of previous Zephir version which still contain fast_add_function() function.

If you really want to compile from source, try to regenerate via cd build/ && php gen-build.php

joseluisq commented 11 months ago

@Jeckerson good to know. The last time that I tried pecl install phalcon on Docker + KVM I ran into a Virtual memory exhausted: Cannot allocate memory error. So I will give cd build/ && php gen-build.php a try and let's see. Thanks!