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

mikebronner's avatar

Install Wordpress from Git Repo?

So Forge has a dedicated Wordpress installer, which is OK if I want to set up a quick copy. However, what do I do if I want to install Wordpress from my Git repo? It seems to error out, expecting composer. json, even though I told it no to use composer or migrations.

/home/forge/.forge/provision-290529.sh: line 1: cd: /home/forge/[hostname here - obscured for privacy]: No such file or directory
fatal: Not a git repository (or any of the parent directories): .git
Composer could not find a composer.json file in /home/forge
To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section
Could not open input file: artisan

It seems to really want Laravel to be there. Any suggestions?

0 likes
13 replies
tjames's avatar

You're probably going to have to either ssh into the server and manually set it up, or create Recipe to do it. If you're doing it often, the latter makes more sense.

mikebronner's avatar

By commenting out the composer and migrate lines in the deploy script I have been able to whittle down the error to the following:

/home/forge/.forge/provision-290529.sh: line 1: cd: /home/forge/[hostname here - obscured for privacy]: No such file or directory
fatal: Not a git repository (or any of the parent directories): .git

It almost seems as if the local git repo is not being set up correctly when not using GitHub settings.

I am able to deploy it manually using the following steps:

  • ssh into forge.
  • create the hostname folder in /home/forge/.
  • do the initial git clone using SSH.
  • cd into the hostname folder, then run git pull origin master, just like the deploy script has it.

Oddly all that works fine manually, but doesn't work automatically. That is to say, the deployment process works -- the site, however, does not.

It required some further steps:

  • change nginx config to not use "public" directory

After that I was getting the following error on the web site:

No input file specified.

Checking the nginx error log shows the following:

2014/09/05 14:55:03 [error] 22009#0: *7 FastCGI sent in stderr: "Unable to open primary script: /home/forge/<HOSTNAME_HERE>/index.php (No such file or directory)" while reading response header from upstream, client: <IP_ADDRESS_HERE>, server: wordpress.genealabs.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "<HOSTNAME_HERE>"

Now, the index.php file clearly exists, and the permissions look right, so I'm not sure what the issue is.

2 likes
akael's avatar

I have an idea, why not:

create an empty laravel app deploy it with forge ssh in and delete the files pull in your git repo edit the nginx file to remove the public (or clone into a public folder)

OR:

deploy a wordpress site from wordpress.org ssh in and delete and pull your wordpress site

I know it shouldn't be this way, but at least that should be a work around.

You should also let Taylor know about the issue, I bet he would fix it up for you if you want to wait.

mikebronner's avatar

Thanks for the ideas @akael. I did submit a ticket to Taylor, of course. :) Trying to do as much as I can in the meanwhile. I might try the empty Laravel app route over the weekend.

alenabdula's avatar

However, what do I do if I want to install Wordpress from my Git repo?

@mikebronner, well you wouldn't want to install it from you repo. I guess you could but I don't see the point of keeping WordPress vendor files in your repository.

What I do is, install WordPress via Forge, then just ssh in and git pull my theme files from the themes folder.

1 like
mikebronner's avatar

Hi @alenabdula, this is my staging install of wordpress for developing themes and plugins. What would your recommended approach be in conjunction with Forge and a Git repository?

alenabdula's avatar

this is my staging install of wordpress for developing themes and plugins.

@mikebronner, doesn't matter, right? Staging server is some flavor of Linux that matches your production server. So just ssh in and do essentially the same git pull ....

@bstrahija, Roots is awesome. But I hate that it uses Bootstrap. There is a course on TutsPlus called WordPress Hackers Guide to the Galaxy, it introduces dependency management with Composer, templating with Twig, etc...

bstrahija's avatar

@alenabdula Yeah, it's not perfect, that's why I'm not using it ;) I've just put together a similar structure, use http://wpackagist.org for WP and the plugins + I also use some of the Illuminate components. The container is really helpful ;)

1 like
andyjh07's avatar

@alenabdula I know this question is old but what's the best way to set up automated pull when listening to the master branch when working with git controlled themes in Wordpress? I'm about to set my Forge up the same way you suggested above

1 like
andyjh07's avatar

@nathangross I haven't yet I'm afraid, I need to take another look into it. Let me know if you find anything :)

andyjh07's avatar

@nathangross I achieved this using the Bedrock Wordpress installation, it's up and running nice and easy :)

Please or to participate in this conversation.