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

ianeds200's avatar

New forge installation

Note: I had to change the .env file to reflect the new database...

Hello, I just installed a new server at Digital Ocean using forge. I deployed my code to the server via bitbucket, no errors. However, when I go to my domain, the site doesn't load, I get a "Whoops, looks like something went wrong" error. The console says "Failed to load resource: the server responded with a status of 500 (Internal Server Error)"

I added the proper password for the database in /config/database.php (I had an error when deploying to the server before I did that).

I can ssh into my server and mysql into the database. The type is: Server version: 10.1.14-MariaDB-1~xenial

I realize I need to migrate the database, but when I run php artisan migrate, it says: [PDOException] SQLSTATE[HY000] [2002] Connection refused

Could anyone please help me with this?

0 likes
2 replies
dascorp's avatar

Assuming you set everything good in your .env I think your mysql is not installed correctly

I have very same problem but on AWS deployment I think the script refers to superseded packages and mysql is not installed at all

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mariadb-server : Depends: mariadb-server-10.1 (= 10.1.14+maria-1~xenial) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
sed: can't read /etc/mysql/my.cnf: No such file or directory
forge.sh: line 410: mysql: command not found
forge.sh: line 411: mysql: command not found
mysql: unrecognized service
forge.sh: line 414: mysql: command not found
forge.sh: line 415: mysql: command not found
forge.sh: line 416: mysql: command not found
forge.sh: line 417: mysql: command not found
forge.sh: line 421: /etc/mysql/my.cnf: No such file or directory
forge.sh: line 422: /etc/mysql/my.cnf: No such file or directory
forge.sh: line 423: /etc/mysql/my.cnf: No such file or directory
forge.sh: line 427: mysql: command not found

In my case pgsql works fine but if using mysql you will get same or simillar error

Hopefully @TaylorOtwell may have suggestion? I just add that was is still using 14.04 and maybe script was updated to 16 run currently on DO

ianeds200's avatar

Thanks for the reply. After updating the .env file with the proper database credentials, it worked. I had originally done the install on my local machine with homestead. I moved the files to the new forge server with bitbucket, so the application on the forge server was still using those settings.

After changing to the proper forge database name and and password in the .env file, it worked.

Please or to participate in this conversation.