views:

218

answers:

2

Hi, (Doctrine-Ubuntu) I run $ doctrine-cli.php command and get doctrine-cli.php: command not found. P

+2  A: 

What's the exactly command you're executing? It should be something like this:

php doctrine-cli.php COMMAND

Also php should be available under PATH system variable but in Ubuntu (if you installed PHP by package installer) that's done by default.

Crozin
Why should I add php before doctrine-cli.php COMMAND?only in windows I should add php.exe before.
Yosef
Thank you its working! like you write php doctrine-cli.php COMMAND
Yosef
+1  A: 

Do this in the command line if you just want to execute it:

chmod +x doctrine-cli.php

and optionally

cp doctrine-cli.php doctrine

this way you can do

./doctrine-cli.php [arguments]

and if you did the optional step you can do

./doctrine [arguments]

and if you don't want the ./ do this

export PATH=$PATH:/full/path/to/doctrine/folder

so now you can execute the doctrine command from any folder

What this does is adds the 'execute' permission to the file. If you have a proper shebang on the top of the file everything should execute fine (I imagine it does) and optionally adds the doctrine folder to your PATH so you can execute it from anywhere

Chris T
Thank you very much Chris!
Yosef