I am trying to run a symfony command via the command line. On writing the below command
bin/console doctrine:database:create
it outputs an error
'bin' is not recognized as an internal or external command,
operable program or batch file.
php is installed on my machine and configured in environment variables but I am getting that error. Please what could be wrong?
This is a Linux like command. Obviously you are coming from Windows system:
php bin\console doctrine:database:create
Pro tip: you can shortcut commands as long as the shortcut is unique:
php bin\console doc:dat:cr
Make sure you cd to the app's directory before running the command too.
Related
I create laravel project with PhpStorm. I'm using "Git Bash Here " as terminal.
C:\Users\kadir\www\basit-laravel>php artisan make:controller TestController
'php' is not recognized as an internal or external command,
operable program or batch file.
When I try to use the contents of terminal in PhpStorm, I get this error:
By the way I use vagrant and homestead.
You have two options.
Install your php locally (not recomended, because you will run in another problems with vagrant)
Access your vagrant instance (maybe vagrant ssh in you project folder) and run the php artisan commands
There is something like this as a git bash alternative:
https://cmder.net/
You must show the terminal called git bash or cmder in php storm
I uploaded my project to a server running Ubuntu. The project has a console command logrotation/index. I want to run it through the command line, and Ubuntu says "yii: command not found". I tried to run it in different ways.
How to run this console application from the command line and then (for the future) put it as a cronjob?
Inside project directory:
./yii logrotation/index
Or
php yii logrotation/index
The error message "yii: command not found" means that Ubuntu can't find the binary in $PATH directories. So you need to specify ./ to show that you are executing a file from the current directory.
I'm trying to start use selenium server with my Yii2 project.
I successfully installed selenium-server-standalone on win 10 with that command:
composer global require se/selenium-server-standalone
But when I try to start selenium-server-standalone I have error message::
sh is no internal or external
command, operable program or batch file.
There is java and selenium in my PATH, also I have a selenium-server-standalone.bat file in C:\Users\***\AppData\Roaming\Composer\vendor.
Please, tell me how can I solve this problem.
You have mentioned you are trying to run selenium server on Win10 machine and error you are facing is sh is no internal or external command, operable program or batch file.
Seems you are typing sh selenium-server-standalone.bat in your command. that is for Linux.
For windows machine, simply go to your path where batch file is located (C:\Users\***\AppData\Roaming\Composer\vendor) , type selenium-server-standalone.bat and hit enter. Selenium server will start.
Recently I started working with Symfony2. Unfortunately the php app/console commands doesn't work at both my MAMP server as Vagrant server (MAC OSX). I tried to make a bundle with the following command
php app/console generate:bundle --namespace=Vendor/NameBundle
and also tried to fix a problem with
php app/console assets:install web
And both commands returned the following in my terminal:
Could not open input file: app/console
Does someone know how to fix this problem? I AM working at my project directory like: mac/applications/mamp/htdocs/project but it is still not working. I also tried to reinstall a new symfony project but that was not a fix.
I guess my php isn't working at all in my terminal...
So the problem was the version number. Symfony version 3.0 is available now so if you're do not selecting a version number at your project install it will automaticly install version 3.0 instead of 2.7. The new command is:
$ php bin/console generate:bundle --namespace=Vendor/NameBundle
instead of
$ php app/console generate:bundle --namespace=Vendor/NameBundle
Add php to your Path Environment Variable so that you can execute php from the command line
(You may need to restart your computer after step 1) From the command line type: php -version to test whether php has successfully been added to your pathenvironment variable
Depending on the version of Symfony you have, you will need to execute either php app/console or php bin/console where console is a php file inside the app or bin directories in your project root. To check which command to use, look into your project directories, if bin/ directory is present then execute php bin/console as console.php is located in that directory.
From the command line, cd into your project root directory and run the appropriate command as mentioned above. To check whether you are in the correct directory, run the dir command, if all your Symfony project directories: app/, bin/, src/, vendors/ etc. are displayed, then the php app/console (bin/console) ... command should run successfully.
or just create a new 2.8.x symfony project using:
symfony new yourAppName 2.8
instead of:
symfony new yourAppName
(which would create a new 3.x symfony project)
in this way you will be able to use:
php app/console
I've installed git-ftp onto my CentOS Server so that I can do deployments from an activeCollab installation running the ac_gitolite module.
Everything installed fine and the app lives at
/usr/local/bin/git-ftp
When I log into the server via ssh I can run git-ftp commands without the full path, but when attempting to use PHP to run commands with exec ie:
exec ("git-ftp --version 2>&1", $output);
I receive the following error:
sh: git-ftp: command not found
Is there an environment path I need to specify somewhere specifically for PHP, or what am I doing wrong?
The two options discussed in "command not found - error in exec() command" are:
One easy solution would be to put the full path of the git-ftp executable.
The other is to add git-ftp to the php server user's PATH.