Каждый раз, когда я запускаю artisan или связанную с ней команду, она возвращает ошибку:
Код: Выделить всё
Call to undefined method ReflectionFunction::isAnonymous()
at project/vendor/laravel/framework/src/Illuminate/Container/Container.php:708
704▕ */
705▕ protected function getClassForCallable($callback)
706▕ {
707▕ if (is_callable($callback) &&
➜ 708▕ ! ($reflector = new ReflectionFunction($callback(...)))->isAnonymous()) {
709▕ return $reflector->getClosureScopeClass()->name ?? false;
710▕ }
711▕
712▕ return false;
+3 vendor frames
4 project/artisan:51
Illuminate\Foundation\Console\Kernel::terminate(Object(Symfony\Component\Console\Input\ArgvInput))
Обновить
Это запускается с использованием контейнера утилиты Docker с командой:
Код: Выделить всё
docker compose run --rm artisan migrate
Ниже приведен мой файл для создания докера:
Код: Выделить всё
services:
# Nginx Service
server:
image: nginx:stable-alpine
ports:
- 8000:80
volumes:
- ./applications/engine.sppaygh.com:/var/www/html/engine.sppaygh.com
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- php
- mysql
- redis
# PHP Service
php:
build:
context: ./dockerfiles
dockerfile: php.dockerfile
volumes:
- ./applications/engine.sppaygh.com:/var/www/html/engine.sppaygh.com:delegated
depends_on:
- transaction-queue-worker
- transaction-batch-queue-worker
- sms-queue-worker
- email-queue-worker
# MySQL Service
mysql:
image: mysql:8
env_file:
- ./env/mysql.env
# For development. DB should not be open to the public on production.
ports:
- "3306:3306"
volumes:
- ./databases/mysql:/var/lib/mysql
# Redis Service
redis:
image: redis:6
volumes:
- ./databases/redis:/data
# Composer Service
composer:
build:
context: ./dockerfiles
dockerfile: composer.dockerfile
volumes:
- ./applications/engine.sppaygh.com:/var/www/html/engine.sppaygh.com
# Artisan Service
artisan:
build:
context: ./dockerfiles
dockerfile: php.dockerfile
volumes:
- ./applications/engine.sppaygh.com:/var/www/html/engine.sppaygh.com
entrypoint: [ "php", "/var/www/html/engine.sppaygh.com/artisan" ]
# Transaction Queue Worker Service
transaction-queue-worker:
build:
context: ./dockerfiles
dockerfile: php.dockerfile
tty: true
volumes:
- ./applications/engine.sppaygh.com:/var/www/html/engine.sppaygh.com
entrypoint: [ "php", "/var/www/html/engine.sppaygh.com/artisan" ]
command: queue:work --queue=transactionsQueue --sleep=3 --max-time=3600
restart: always
# Transaction Batch Queue Worker Service
transaction-batch-queue-worker:
build:
context: ./dockerfiles
dockerfile: php.dockerfile
tty: true
volumes:
- ./applications/engine.sppaygh.com:/var/www/html/engine.sppaygh.com
entrypoint: [ "php", "/var/www/html/engine.sppaygh.com/artisan" ]
command: queue:work --queue=transactionBatchQueue --sleep=3 --max-time=3600
restart: always
# SMS Queue Worker Service
sms-queue-worker:
build:
context: ./dockerfiles
dockerfile: php.dockerfile
tty: true
volumes:
- ./applications/engine.sppaygh.com:/var/www/html/engine.sppaygh.com
entrypoint: [ "php", "/var/www/html/engine.sppaygh.com/artisan" ]
command: queue:work --queue=smsQueue --sleep=3 --max-time=3600
restart: always
# Email Queue Worker Service
email-queue-worker:
build:
context: ./dockerfiles
dockerfile: php.dockerfile
tty: true
volumes:
- ./applications/engine.sppaygh.com:/var/www/html/engine.sppaygh.com
entrypoint: [ "php", "/var/www/html/engine.sppaygh.com/artisan" ]
command: queue:work --queue=emails --sleep=3 --max-time=3600
restart: always
Код: Выделить всё
FROM php:8.2-fpm-alpine
WORKDIR /var/www/html
RUN docker-php-ext-install pdo pdo_mysql
Код: Выделить всё
docker compose run --rm php --version
Код: Выделить всё
PHP 8.2.21 (fpm-fcgi) (built: Jul 23 2024 03:09:29)
Copyright (c) The PHP Group
Zend Engine v4.2.21, Copyright (c) Zend Technologies
Подробнее здесь: https://stackoverflow.com/questions/788 ... 11-php-8-2
Мобильная версия