Open rust17 opened 8 months ago
While FrankenPHP will run with non-thread-safe builds of php, I suspect it will act in surprising ways. I assume that is what you mean by "multiple versions of php installed"?
FrankenPHP uses threads instead of a process model and should be built against a thread-safe version of php or it might result in memory corruption and/or sharing data between threads that shouldn't be shared (like session data).
While FrankenPHP will run with non-thread-safe builds of php, I suspect it will act in surprising ways. I assume that is what you mean by "multiple versions of php installed"?
FrankenPHP uses threads instead of a process model and should be built against a thread-safe version of php or it might result in memory corruption and/or sharing data between threads that shouldn't be shared (like session data).
I believe the issue might be connected to the method I used to install PHP. I installed multiple versions of php, each with a specified prefix. For instance, PHP 8.3 was installed with the prefix --prefix=/usr/local/php8.3
, and PHP 8.1 with --prefix=/usr/local/php8.1
. According to the php-src sapi documentation, the command php-config --libs
doesn't return lphp
, so the linker uncertain about which library to link to:
$ php-config --libs
outputs:
-lresolv -lrt -lutil -lrt -lm -ldl -lpthread -lxml2 -lssl -lcrypto -lsqlite3 -lz -lcurl -lxml2 -lz -lpng16 -lz -lwebp -ljpeg -lfreetype -lonig -lsqlite3 -lxml2 -lxml2 -lxml2 -lxml2 -lzip -lz -lssl -lcrypto
This might be the root cause of the problem.
php-config
is also unprefixed, so it points to the last version of php you installed (IIRC). I'm not near a computer today to verify that, but I've run into a similar issue at some point.
Sorry, forget about the context earlier. I use source ./profile
to set the php version, the php-config
corresponds to the same version as the php itself. By the way, this is not urgent, no need for a rush response.
Describe you feature request
Is your feature request related to a problem? Please describe. When I have multiple versions of PHP installed (php7.4, php8.1, php8.3), I execute the run command:
It prompts:
Describe the solution you'd like This error indicates that the
ld
encountered a problem when trying to link the libphp library. After I changed it to this, the program can run:Should this be written into
compile.md
?