Uncaught Error: Class "Shlinkio\Shlink\Core\Config\EnvVars" not found #1918
Replies: 2 comments 1 reply
-
This is a very strange error to happen. If this was an actual general problem, many people would be complaining. Nonetheless, I have just downloaded the PHP 8.1 dist file for Shlink 3.6.4 to make sure the autoloader was correct, and it is. I then spin up a docker container with PHP 8.1.25, downloaded the dist file there, and run it. Everything worked as expected. I have tried both running the command with a relative path, from Shlink's root folder, and also using an absolute path. Both worked. Things I think could be happening:
Unrelated issues I see:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for taking the time to reply. I'm not sure how it got fixed but I followed the following steps:
The installation ran successfully, and I got my first API Key automatically created, making me think the API is now working fine. I'm now having what looks like a PHP processing error but I will open a different discussion thread So, it looks like the problem was behind the keyboard: me. Thank you so much! |
Beta Was this translation helpful? Give feedback.
-
Shlink version
3.6.4
PHP version
8.1.25
How do you serve Shlink
Self-hosted nginx
Database engine
MySQL
Database version
8.0.35
Summary
I've followed all the installation instructions, but I'm struggling to manually create the first API key.
The command being executed is:
sudo /var/www/html/shlink/bin/cli api-key:generate
The error message I'm getting is:
PHP Fatal error: Uncaught Error: Class "Shlinkio\Shlink\Core\Config\EnvVars" not found in /var/www/html/shlink/config/container.php:26
Stack trace:
#0 /var/www/html/shlink/config/cli-app.php(10): include()
#1 /var/www/html/shlink/config/cli-app.php(12): {closure}()
#2 /var/www/html/shlink/bin/cli(9): require('...')
#3 {main}
thrown in /var/www/html/shlink/config/container.php on line 26
I've installed Shlink with the provided dist file for PHP 8.1 and i'm using the following global Environment Variables defned in \etc\environment.
DB_DRIVER="mysql"
DB_HOST="192.168.1.2"
DB_PORT="3306"
DB_NAME="shlink"
DB_USER="shlink_rw"
DB_PASSWORD="MyStrongPassword"
TIMEZONE="America/Toronto"
DEFAULT_DOMAIN="short.url"
IS_HTTPS_ENABLED=true
BASE_PATH="/var/www/html/shlink"
GEOLITE_LICENSE_KEY="MyGeoliteLicense"
I'm far from being a knowledgeable linux user, so, I might be making any silly mistake but I'm not able to figure out what it could be.
I'm using the environments variables approach because I'm facing different issues when attempting to install shlink-installer but that's for a different discussion.
Thanks,
Regards
Beta Was this translation helpful? Give feedback.
All reactions