You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I already have a properly functioning FFI configuration with connected libraries.
My question is whether a complete restart of the Apache process (full stop and then start) is always necessary when the library (.so) needs to be updated.
Once, to update the library, I overwrote the file at the path specified by FFI_LIB with an updated file and tried apachectl graceful. I confirmed that all Apache worker processes restarted, but the result showed that it was still referencing the old library rather than the updated one.
After some experimentation, I found that when I changed the FFI_LIB path in the header (.h) file configured in ffi.preload and then tried apachectl graceful, it successfully referenced the new library.
However, when I examined pmap -p <APACHE PID>, I observed the following two mappings:
The Apache process was running normally, and the library functions were working properly, but I'm still unsure if this result is normal. If I were to update 100 times, would I end up with about 100 such mappings?
When using ffi.preload and needing to update the connected library, which of the following approaches is correctly understood?
Use symbolic links for changes. (At least from what I've observed, this doesn't guarantee consistent behavior.)
e.g.,
Always change the FFI_LIB path in the ffi.preload header file.
e.g.,
#define FFI_LIB "/home/abc/xyz.so.0.2"
Always use apachectl stop followed by start for updates.
e.g.,
$ sudo apachectl stop && sudo apachectl start
Approach #3 works without issues, but completely stopping and starting the master process is burdensome in a live server on-premises environment.
It would be great if there's a general method that can be used with apachectl graceful.
Below is a simplified version of my php.ini and ffi.preload header file for testing:
Description
apache(prefork) 2.4.62
php 8.2.28
I already have a properly functioning FFI configuration with connected libraries.
My question is whether a complete restart of the Apache process (full stop and then start) is always necessary when the library (.so) needs to be updated.
Once, to update the library, I overwrote the file at the path specified by
FFI_LIB
with an updated file and triedapachectl graceful
. I confirmed that all Apache worker processes restarted, but the result showed that it was still referencing the old library rather than the updated one.After some experimentation, I found that when I changed the
FFI_LIB
path in the header (.h) file configured in ffi.preload and then triedapachectl graceful
, it successfully referenced the new library.However, when I examined
pmap -p <APACHE PID>
, I observed the following two mappings:The Apache process was running normally, and the library functions were working properly, but I'm still unsure if this result is normal. If I were to update 100 times, would I end up with about 100 such mappings?
When using
ffi.preload
and needing to update the connected library, which of the following approaches is correctly understood?Use symbolic links for changes. (At least from what I've observed, this doesn't guarantee consistent behavior.)
e.g.,
Always change the FFI_LIB path in the ffi.preload header file.
e.g.,
Always use
apachectl stop
followed bystart
for updates.e.g.,
Approach #3 works without issues, but completely stopping and starting the master process is burdensome in a live server on-premises environment.
It would be great if there's a general method that can be used with
apachectl graceful
.Below is a simplified version of my
php.ini
andffi.preload
header file for testing:The text was updated successfully, but these errors were encountered: