我正在使用Yii编写《敏捷Web开发》一书。在第8章中,它创建了一个php脚本来设置RBAC(基于角色的访问控制),这样当我们在访问shell时
/framework/yiic shell
它应该允许我们输入命令
rbac
根据我们创建的PHP脚本,该命令创建了三个具有不同权限的角色,Owner、Member和Reader。
我的问题是,在使用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.
尝试完整路径:
/framework/yiic shell
如果要在不提供完整路径的情况下使用yiic
,则必须将/framework/
添加到$PATH
环境变量中。
您可能需要指定路径:
/framework/yiic
或者将目录包含在您的PATH 中
PATH="$PATH:/framework"
export PATH