|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-06-28 09:51 UTC] brent at spatie dot be
Description:
------------
I'm trying to preload Laravel. I've compiled php-7.4.0alpha2 using the following configure command:
```
./configure \
OPENSSL_CFLAGS=-I/usr/local/opt/openssl/include \
OPENSSL_LIBS="-L/usr/local/opt/openssl -lssl -lcrypto" \
'--prefix=/Users/brent/dev/php/build/php-74-alpha2' \
'--with-config-file-path=/Users/brent/dev/php/build/php-74-alpha2/etc' \
'--with-config-file-scan-dir=/Users/brent/dev/php/build/php-74-alpha2/etc/conf.d' \
'--enable-bcmath' \
'--enable-calendar' \
'--enable-dba' \
'--enable-exif' \
'--enable-fpm' \
'--enable-mysqlnd' \
'--enable-pcntl' \
'--with-curl=/usr/local/opt/curl-openssl' \
'--with-iconv=/Library/Developer/CommandLineTools/usr' \
'--with-layout=GNU' \
'--with-mysql-sock=/tmp/mysql.sock' \
'--with-mysqli=mysqlnd' \
'--with-openssl=shared' \
'--with-openssl-dir=/usr/local/opt/openssl' \
'--with-password-argon2=/usr/local/opt/argon2' \
'--with-pdo-mysql=mysqlnd' \
'--with-pdo-sqlite=/usr/local/opt/sqlite' \
'--with-sodium=/usr/local/opt/libsodium' \
'--with-sqlite3=/usr/local/opt/sqlite' \
```
The code to try it out can be found here: https://github.com/brendt/laravel-preload
This is the preload script: https://github.com/brendt/laravel-preload/blob/master/preload.php
After all files were preloaded, php-fpm crashes with the following error:
```
[1] 61893 segmentation fault ./php-fpm --nodaemonize
```
Patchesdid_you_try_adding_facades_prefix (last revision 2019-07-02 11:57 UTC by facades at laravel dot com)deleting_laravel_solves_all_problems (last revision 2019-06-28 09:57 UTC by taylorotwell at laravel dot com) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 08:00:01 2025 UTC |
@nikic@php.net any chance you could share the code you used to preload the laravel vendor directory successfully? I've tried with brent's code (both compile and require versions)and php 7.4.0-2 (arch package) with laravel 6 and it's still seg faulting. Interestingly, I think the compile version loaded more files before it crashed. I've tried creating a simpler/more manual preload file, but loading dependencies and debugging is proving difficult for me. Maybe this is naive, but it would be really nice if the php.ini config for preloading allowed the option to set an array of directories and php would preload all php files in those directories and any class dependencies, as an alternative to the preload script method. thanks in advance. p.s. here is the stack trace of the seg fault in case it is useful: systemd[1]: php-fpm.service: Main process exited, code=dumped, status=11/SEGV systemd[1]: php-fpm.service: Failed with result 'core-dump'. audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj==unconfined msg='unit=php-fpm comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? > systemd-coredump[187609]: Process 187591 (php-fpm) of user 0 dumped core. Stack trace of thread 187591: #0 0x0000645214e54ca0 _dl_close_worker (ld-linux-x86-64.so.2) #1 0x0000645214e55be2 _dl_close (ld-linux-x86-64.so.2) #2 0x00006452144c9d79 _dl_catch_exception (libc.so.6) #3 0x00006452144c9e13 _dl_catch_error (libc.so.6) #4 0x0000645214c29ab9 n/a (libdl.so.2) #5 0x0000645214c29468 dlclose (libdl.so.2) #6 0x00000163a11a1d5d n/a (php-fpm) #7 0x00000163a119b8dd n/a (php-fpm) #8 0x00000163a11ad4ca zend_hash_graceful_reverse_destroy (php-fpm) #9 0x00000163a119c7f6 n/a (php-fpm) #10 0x00000163a113cb4d php_module_shutdown (php-fpm) #11 0x00000163a122f17a n/a (php-fpm) #12 0x00000163a12277ad n/a (php-fpm) #13 0x00000163a122fe56 n/a (php-fpm) #14 0x00000163a1230afb n/a (php-fpm) #15 0x00000163a12272b5 n/a (php-fpm) #16 0x00000163a122c67b n/a (php-fpm) #17 0x00000163a1226b68 n/a (php-fpm) #18 0x00000163a0f53825 n/a (php-fpm) #19 0x00006452143b7153 __libc_start_main (libc.so.6) #20 0x00000163a0f5531e _start (php-fpm)