B
B
BonBon Slick2017-07-28 14:00:03
bash
BonBon Slick, 2017-07-28 14:00:03

bashrc composer + php connection?

Previously, I had links to composer.phar and php.exe files in my ~/.bashrc file . In PhPStrom, this allowed executing PhP, Git, Composer commands from a single terminal. Now, alas, no.
Roughly from memory:

vim ~/.bashrc

export PATH="$PATH:~/.composer/vendor/bin""
link composer="адрес"
// в таком духе
alias composer_update="composer update"
alias command="php artisan cache clear"
....

However, after reinstalling Windows 10, I forgot about this file, so the settings got lost.
The standard connection via the PhPStrom PhP and Composer settings is broken xs why, it never worked. I connected and set the configs a year and a half ago, now I'm sitting for half a day, trying to find how I connected it all.
Now it gives errors:
[email protected]****W64 ~/Desktop/OpenServer/domains/mysite(master)
$ php -v
bash: php: command not found

Same for composer commands. Only Git works. Globally setting paths in PATH variables did not help and does not help, and it is unlikely to help on windows, where you need to install vagrant with mnu.
I think everything is connected correctly, however, it was this connection method, via bashrc, that allowed using everything in one console, instead of several.
Perhaps someone connected like this? Please tell me how, what to prescribe?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Screamy Di, 2017-07-30
@BonBonSlick

Hello!
Confused by this phrase. Maybe you still have Linux?
However, in case you have Windows, you need to set the path to the composer and php executable file in the PATH environment variable . Then you can use them in the PhpStorm console.
If you have Linux, then I recommend creating a new file, for example: ~/.bash_aliases and write alias for Php and Composer
there . For example:

alias php="/home/user/bin/path_to_php"
alias composer="php /home/user/bin/path_to_php/composer.phar"

Next, we will include the ~/.bash_aliases file in the system ~/.bashrc using the following code at the beginning of ~/.bashrc
if [ -f ~/.bash_aliases ]; then

. ~/.bash_aliases

fi

Now you need to update the aliases, either by logging into the system or by using the command in the terminal:
I hope I was able to answer your question.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question