davedevelopment / phpmig

Simple migrations system for php
Other
569 stars 92 forks source link

phpmig: command not found #131

Open WKoppenol opened 6 years ago

WKoppenol commented 6 years ago

I'm pretty sure this is some basic thing I'm missing, but I've been trying to get this project to work since I'd like to start using it for my project. I'm relatively new to composer and its workings, so bear with me.

I'm aware why this issue arises, but I'm trying to figure out how it should have worked in the first place. I'm running composer locally on Windows in a Cygwin terminal. I run an Ubuntu server which I sync my code to (and let it run composer itself).

Followed the instructions, end up with this:

image

Note that I've blacked out my project name. Not that it's too important but I want to keep my project private. When I go to the root of my project and do phpmig init it gives me the error, if I move to the dir where phpmig resides it works from there. But I don't want it to work from there, it now also creates the migrations dir there. I want that dir to be in the root.

Thanks in advance for some help here. Also, my Ubuntu server acts precisely the same when I follow the "getting started" steps so it's not just something on Windows.

davedevelopment commented 6 years ago

Hi there,

The best way to run it is from the root of your directory:

$ vendor/bin/phpmig

I have my $PATH environment variable set up to include vendor/bin so I can simply call phpmig, but you need to make sure you do this safely.

You are 100% right though, the README should be updated to reflect how it is most commonly run.

WKoppenol commented 6 years ago

Hey,

Thanks for the reply. In that case my initial hunch was correct and adding /vendor/bin to the PATH works. Once I get the time I'll make a pull request to update the README so it's clarified. Thanks again!