Featured image of post การแก้ปัญหา "Undefined constant 'Laravel\Octane\Commands\Concerns\SIGINT'" ใน Laravel Octane

การแก้ปัญหา "Undefined constant 'Laravel\Octane\Commands\Concerns\SIGINT'" ใน Laravel Octane

การแก้ปัญหา "Undefined constant 'Laravel\Octane\Commands\Concerns\SIGINT'" ใน Laravel Octane

ข้อความแสดงข้อผิดพลาดจากการรันคำสั่ง

php artisan octane:frankenphp --port=443 --https --workers=1 --max-requests=1
Undefined constant "Laravel\Octane\Commands\Concerns\SIGINT"

at vendor/laravel/octane/src/Commands/Concerns/InteractsWithServers.php:174
  170▕      * Returns the list of signals to subscribe.
  171▕      */
  172▕     public function getSubscribedSignals(): array
  173▕     {
➜ 174▕         return [SIGINT, SIGTERM, SIGHUP];
  175▕     }
  176▕
  177▕     /**
  178▕      * The method will be called when the application is signaled.

    +5 vendor frames

6   artisan:13
    Illuminate\Foundation\Application::handleCommand(Object(Symfony\Component\Console\Input\ArgvInput))

วิธีแก้ไข

ปัญหานี้เกิดจากการไม่ได้ติดตั้ง php pcntl extension ดังนั้น เพียงแค่ติดตั้ง ext-pcntl extension ก็จะสามารถแก้ไขปัญหานี้ได้

RUN install-php-extensions pcntl
RUN docker-php-ext-install pcntl

Reference

All rights reserved,未經允許不得隨意轉載
ถูกสร้างด้วย Hugo
ธีม Stack ออกแบบโดย Jimmy