Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nicks's avatar
Level 3

Forge deployment problems

I am currently trying out Laravel Forge. To date, I have failed to complete a successful deployment.

To try to achieve success, I have created a new laravel project. No changes have been made to the shell project. Version is Laravel v8.17.0 (PHP v7.3.11).

The project was uploaded into a new repo on Bitbucket.

A server was created by Forge on AWS with PHP 7.3, a new VPC and a database. The default site was connected to the Bitbucket repo, with project type General PHP / Laravel. Create Database was checked when creating the site. The deployment script has been left in its default state

I have tried with both Install Composer Dependencies checked and left unchecked.

When I try to deploy with Install Composer Dependencies checked, I am getting:

Fri Dec 4 08:34:15 UTC 2020
From bitbucket.org:hallwizard/forgetest
 * branch            master     -> FETCH_HEAD
Already up to date.
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: fruitcake/laravel-cors
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
72 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Restarting FPM...

   Illuminate\Database\QueryException 

  SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from information_schema.tables where table_schema = forgetest and table_name = migrations and table_type = 'BASE TABLE')

  at vendor/laravel/framework/src/Illuminate/Database/Connection.php:678
    674▕         // If an exception occurs when attempting to run a query, we'll format the error
    675▕         // message to include the bindings with SQL, which will make this exception a
    676▕         // lot more helpful to the developer instead of just the database's errors.
    677▕         catch (Exception $e) {
  ➜ 678▕             throw new QueryException(
    679▕                 $query, $this->prepareBindings($bindings), $e
    680▕             );
    681▕         }
    682▕

      +33 vendor frames 
  34  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

When I try to deploy with Install Composer Dependencies unchecked, the deployment succeeds, but when I visit the site I get:

Warning: require(/home/forge/default/public/../vendor/autoload.php): failed to open stream: No such file or directory in /home/forge/default/public/index.php on line 34

Fatal error: require(): Failed opening required '/home/forge/default/public/../vendor/autoload.php' (include_path='.:/usr/share/php') in /home/forge/default/public/index.php on line 34

Any help would be greatly appreciated as I am getting very frustrated trying to get even the most basic site deployed.

Thanks Nick

0 likes
2 replies
Nakov's avatar
Nakov
Best Answer
Level 73

@nicks you seem to have this lines in the deployment script:

if [ -f artisan ]; then
    $FORGE_PHP artisan migrate --force
fi

but your .env file is not updated correctly to the correct database. Have you created a database on your server and connected to it ?

In the Environment tab you will have to have this filled:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=DB_NAME
DB_USERNAME=YOUR_FORGE_DB_USERNAME
DB_PASSWORD=YOUR_FORGE_DB_PASSWORD
nicks's avatar
Level 3

Thank you. Such a basic mistake to make! All working :-)

Please or to participate in this conversation.