![]() |
Hi,
I am using php spark to bootstrap the tables/database seeding in my codeigniter 4 app, but spark is not recognizing the "ENVIRONMENT" environment variable set by docker-compose.yml. To clarify, my CI4 app is picking up the environment variables, just not spark. Here is the stack trace from the docker container when I run: php spark Code: Fatal error: Uncaught Error: Undefined constant "ENVIRONMENT" in /var/www/html/Tooths/system/Common.php:777 Not sure if relevant, but I also found the following output in the logs: Code: This "system/bootstrap.php" is no longer used. If you are seeing this error message,
As the error message says, complete the upgrade.
Upgrade the "spark" file. See https://codeigniter4.github.io/userguide...-and-spark
I upgraded to CI 4.5.1, but I'm still getting an error when the docker compose container runs
Code: tooths-backend-1 | Could not open input file: spark Code: CodeIgniter v4.5.1 Command Line Tool - Server Time: 2024-06-10 04:00:45 UTC+00:00 When I run "php spark migrate" I get the same output. No mention of tables migrated. The environment variables are defined in the docker compose script, and that includes my database credentials. so I can understand why php spark migrate is not working on the fresh container, but the error still stands - why can't I open input file 'spark'? In my Dockerfile I COPY spark to /var/www/html/spark, then RUN chown -R www-data:www-data /var/www/html , and then RUN chmod +x /var/www/html/spark Solved the issue by copying spark into my app directory, and changing the paths require FCPATH . 'app/Config/Paths.php' and require 'system/Boot.php' |
Welcome Guest, Not a member yet? Register Sign In |