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

miloKat's avatar

Github Repo Install Issue

After a day of digging through forums and google I'm still not getting past the issue I'm having.

I can't install composer dependencies without this error, and when I install without dependencies I get the same Artisan error when trying to deploy.

  • Installing graham-campbell/manager (v2.3.0) Loading from cache

  • Installing vinkla/hashids (2.2.1) Loading from cache

Generating autoload files

php artisan clear-compiled

[PDOException]
SQLSTATE[HY000] [2002] No such file or directory

Script php artisan clear-compiled handling the post-install-cmd event returned with an error

[RuntimeException]
Error Output:

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] []...

I have the correct SSH keys, and everything is connected according to Forge dashboard.

I've seen a lot of articles referring to the composer.lock file, but none of those resolutions helped or even altered my case.

Everything has lead me to guessing it's a php socket issue. I'm using a MAMP setup rather than homestead.

I have created a database and ran migrations for my project just fine.

Pretty new to all this, so even a lot of the remedies are confusing me at this point.

Thank you!

0 likes
16 replies
miloKat's avatar

Well kind of got past this, now I get a connection timed out.

Generating autoload files

php artisan clear-compiled

[PDOException]
SQLSTATE[HY000] [2002] Connection timed out

Script php artisan clear-compiled handling the post-install-cmd event returned with an error

[RuntimeException]
Error Output:

bashy's avatar

What's your settings for database? Are you sure the DB_HOST is connectable?

Try it from command line

mysql -u dbuser -h dbhost -p
miloKat's avatar

My db is connectable. I should have been more descriptive.

I'm getting the errors when I try to bring the Github Repo onto the Forge server.

I'm able to ssh into the Forge Server, and I can fully access my db locally.

From all the articles I've come across, people (you as well) have said this could be and .env issue, maybe a composer.lock file issue. None of those remedies have worked for me.

This is my first try at all this, so I'm very new. It seems as though my Git repo isn't accessing my Forge DB. If I don't install composer dependancies, I get the same error.

SSH keys seem to be in the right spot, I believe I'm using the right ip addresses in the right spots, github and local server are talking just fine. Something just isn't connecting, mentally and literally.

bashy's avatar

You have your environment variables setup in Forge properly? I don't understand what you mean by git repo not connecting to it.

miloKat's avatar

On the Forge website, when I try to add the GitHub user/repository I'm getting these errors.

And I mean the Github repository isn't connecting to what ever Forge needs to connect with, so I get the errors.

I really wish I could be more descriptive.

bashy's avatar

Okay I've never used Forge but I know/can understand how it works. Maybe it's the environment variables. What's the entry for DB_HOST?

miloKat's avatar

Alrighty, it looks like this.

this is in my .env file:

DB_HOST=192.168.10.10 DB_DATABASE=mydb DB_USERNAME=homestead DB_PASSWORD=secret

miloKat's avatar

However, changing those to the Forge server IP, username, and password still doesn't resolve the issue.

miloKat's avatar

Yeah, I absolutely don't have the .env in the git repo. I've only set .env variables with Forge.

Which is also confusing to me. Through all of the tutorial videos I watched, no one has ever set the env file on Forge before copying over the repository. They simply copy paste and it goes. Then after that the environment files get set on Forge.

Even in the video you sent me, he has already installed the repository.

bashy's avatar

Thing is, you said the values are

DB_HOST=192.168.10.10
DB_DATABASE=mydb
DB_USERNAME=homestead
DB_PASSWORD=secret

That's wrong for Forge.

miloKat's avatar

Yeah I understand that. I guess where my confusion is where the .env need to be placed. I have a local file that doesn't upload to Git. I then have another that is on the Forge website itself.

Do I need to change both of them? It doesn't make sense why I wouldn't need to change the local file that I don't update.

If that is the case, the .env file on forge has always been

DB_HOST= MyForgeServer IP DB_DATABASE=MyDB DB_USERNAME=forge DB_PASSWORD=PasswordForgeEmailedMe

bashy's avatar

No just the remote one. Although it wouldn't be an actual file though? It's done through php-fpm pool vars not .env?

miloKat's avatar

Hmm.. well on Forge you can choose to edit the environment file, however I may be missing something when it comes to php-fpm pool vars....

bashy's avatar

Well that's how I thought it worked, maybe it's different :)

I'm not really sure what it's doing... sorry.

miloKat's avatar

After some more work I was wondering if you had anymore insight.

I can connect to Github by "ssh @ myserverip" and I can clone my repository in that way. However when bringing in the repo through forge, now Envoyer, I still get the same connection timeout error.

With envoyer, I'm able to specifically create and then access my .env file on the production server, so I believe those are correct. Envoyer seems to have narrowed it down to installing Composer Dependencies.

However, this is where I'm stuck.

Tried several different composer updates and installs with --no-dev and without. Also, deleted the composer.lock file and and ran the composer updates as well.

But the confusing thing to me. is the error report doesn't really have any error eluding to it being a dependency issue. Everything loads then and the bottom, just a simple PDOException Connection timed out.

Which means a connection to the db? or no? Just not a lot to go off and everything on google just leads me to the .env file. I'm afraid I'm just not making a connection somewhere.

Please or to participate in this conversation.