我想在终端做“蛋糕烘烤”命令。所以,我在我的个人资料中添加了以下路径。
第1步:sudo nano ~/.profile
第2步:export PATH=/Applications/xampp/xamppfiles/bin/php-5.5.6;/Applications/xampp/xamppfiles/bin/mysql;/Applications/XAMPP/htdocs/sandbox/app/Console/cake;
我添加了这条路径并尝试在终端中“蛋糕烘烤”命令。但是,终端绝对没有用。当我打开新的终端窗口时,会产生以下结果。
Last login: Fri May 16 00:45:42 on ttys000
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1090
Server version: 5.6.14 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
我想在我的Mac上做“蛋糕烘烤”。请帮我。
感谢
答案 0 :(得分:1)
使用CakePHP cli所需的唯一步骤是:
$ cd path/to/App
$ Console/cake
Welcome to CakePHP v3.0.0-dev2 Console
---------------------------------------------------------------
App : App
Path: /path/to/App/
---------------------------------------------------------------
虽然可以将Console文件夹添加到路径中,但不是必需的,也不建议使用。
终端应该与此类似:
但是可执行文件将定义为路径,而不是路径中的。
export PATH=.../bin/mysql;.../app/Console/cake
^ ^
因此,当启动新的终端窗口时,会立即调用mysql可执行文件,启动交互式mysql会话,输出应该很明显:
...
mysql>
这就是为什么它不可能使用CakePHP的cli(或基本上任何东西),因为它不是sql命令:
mysql> cake
-> ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'cake' at line 1
mysql>
要摆脱这种情况,请输入"退出"然后希望返回到bash提示符,其中.profile
文件可以被适当地编辑。
mysql> exit
Bye
$
终端窗口中可能存在进一步混乱/混乱的输出,如果无法通过终端窗口编辑.profile
文件关闭所有终端窗口,则删除文件{{1}无论如何,然后当一个新的终端启动它应该再次正常工作。
要更正路径 - 确保它包含目录而不包含文件:
~/.profile