【发布时间】:2011-05-31 12:20:15
【问题描述】:
我正在使用 Yii 的敏捷 Web 开发一书。在第 8 章中,它创建了一个 php 脚本来设置 RBAC(基于角色的访问控制),以便当我们访问 shell 时
/framework/yiic shell
它应该允许我们输入命令
rbac
根据我们创建的 PHP 脚本,该命令创建了三个角色,拥有不同权限的所有者、成员和读者。
我的问题是,当我使用 MAMP 执行命令时
yiic shell
它说
-bash: yiic: command not found
因此,我无法创建这些角色,然后我无法继续阅读本书,因为我不知道任何解决方法
有人可以帮忙吗?
更新
根据以下答案之一,我做了chmod +x yiic
现在,当我运行 /framework/yiic shell 时,它似乎进入了 shell,但与我的书中描述的不同
这本书告诉我我应该得到这个
% YiiRoot/framework/yiic shell Yii Interactive Tool v1.1 (based on Yii v1.1.2) Please type 'help' for help. Type 'exit' to quit. >>
Now type help to see a list of available commands:
>> help
At the prompt, you may enter a PHP statement or one of the following commands:
- controller
- crud
- form
- help
- model
- module
- rbac
Type 'help <command-name>' for details about a command.
但是,我得到了
USAGE
yiic shell [entry-script | config-file]
DESCRIPTION
This command allows you to interact with a Web application
on the command line. It also provides tools to automatically
generate new controllers, views and data models.
It is recommended that you execute this command under
the directory that contains the entry script file of
the Web application.
PARAMETERS
* entry-script | config-file: optional, the path to
the entry script file or the configuration file for
the Web application. If not given, it is assumed to be
the 'index.php' file under the current directory.
【问题讨论】:
-
我不太了解这类事情,但您可能需要将 yii 目录添加到 bash 配置文件中的 $PATH 中。
-
@sehe ,我输入了配置文件,它说“找不到命令”你知道我应该如何指定这些参数吗?