Skip to content

Commit 16da244

Browse files
committed
Improve error message for misconfigured opcache builds
This can be seen when the `./configure` step fails to detect `HAVE_SHM_*`, e.g. due to missing a necessary dependency to compile the test scripts. (Run `./configure`, run `yum install libtool-ltdl-devel` for missing dependencies, then run `make`) Give a clearer error message than `unknown` Searching for `opcache "Fatal Error Unable to allocate shared memory segment of" "unknown: No such file or directory"` reveals issues such as termux/termux-packages#2234
1 parent cebe750 commit 16da244

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/opcache/zend_shared_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void zend_shared_alloc_create_lock(char *lockfile_path)
9898

9999
static void no_memory_bailout(size_t allocate_size, char *error)
100100
{
101-
zend_accel_error(ACCEL_LOG_FATAL, "Unable to allocate shared memory segment of %zu bytes: %s: %s (%d)", allocate_size, error?error:"unknown", strerror(errno), errno );
101+
zend_accel_error(ACCEL_LOG_FATAL, "Unable to allocate shared memory segment of %zu bytes: %s: %s (%d)", allocate_size, error?error:(handler_table->name?"unknown":"opcache was compiled without shared memory handler implementations"), strerror(errno), errno );
102102
}
103103

104104
static void copy_shared_segments(void *to, void *from, int count, int size)

0 commit comments

Comments
 (0)