Skip to content

Conversation

@henderkes
Copy link
Contributor

No description provided.

Comment on lines +1 to +16
#include <SAPI.h>
#include <Zend/zend_alloc.h>
#include <Zend/zend_exceptions.h>
#include <Zend/zend_interfaces.h>
#include <Zend/zend_types.h>
#include <errno.h>
#include <ext/spl/spl_exceptions.h>
#include <ext/standard/head.h>
#include <inttypes.h>
#include <php.h>
#include <php_config.h>
#include <php_ini.h>
#include <php_main.h>
#include <php_output.h>
#include <php_variables.h>
#include <php_version.h>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are most definitely not all needed, but you can adjust that later @withinboredom

@henderkes
Copy link
Contributor Author

The debug trace (and the fact that it doesn't happen in my static build) leads me to believe that the segfault occurs due to linking against both libphp.a and libphp.so. Unfortunately I don't have a different solution for the _tsrm_ls_cache access in libsapi_cli.a when we still want to dynamically link against libphp.so.

@henderkes
Copy link
Contributor Author

@withinboredom do you have time to proceed with this by chance? I've thought of a new feature that would require this as a precursor. I'm really not familiar enough with php internals to understand the dependency on the tlsrm symbol yet.

@alexandre-daubois
Copy link
Member

I'm not sure to understand, is this PR reviewable on its own?

@henderkes
Copy link
Contributor Author

No. It's just a bunch of necessary changes to get #1757 going. This PR tries to merge into the refactor/cli branch, not into main.

@henderkes
Copy link
Contributor Author

To explain it a bit more: this keeps compatibility with php <= php 8.4 (current frankenphp php-cli functionality) while at the same time providing all the php-cli binary functionality with 8.5 (if @withinboredom 's branch is merged). Then frankenphp would provide a complete handler for php scripts and commands, which means that users wouldn't need to install other sapis anymore.

@alexandre-daubois
Copy link
Member

Ah yes, got it. Thanks! I missed the target branch

@henderkes henderkes merged commit d1bb029 into php:refactor/php-cli Oct 19, 2025
@henderkes henderkes deleted the cli_sapi branch October 19, 2025 07:24
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

Successfully merging this pull request may close these issues.

2 participants