macos 如何在 mac os x lion 上设置/安装 zend 框架?.bash_profile 在哪里设置 zf.sh 的别名?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8113861/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 08:36:24  来源:igfitidea点击:

How to setup/install zend framework on mac os x lion? Where is .bash_profile to set alias for zf.sh?

phpmacoszend-frameworkosx-lion

提问by Saurabh

Note: Move this question to other site if you think its not suite here

注意:如果您认为此问题不适合此处,请将其移至其他站点

Guys I am trying to install/setup zend framework on my mac book pro. I am running MAMP Pro 2.0.3 on mac os x lion 10.7.2

伙计们,我正在尝试在我的 mac book pro 上安装/设置 zend 框架。我在 mac os x lion 10.7.2 上运行 MAMP Pro 2.0.3

I got zend framework installation instruction form http://akrabat.com/. The author says that I should add alias to zf.sh script in my ~/.bash_profile. But there is no such file in my home directory to I create a new file by "touch .bash_profile", but this is also not working.

我得到了 zend 框架安装说明表http://akrabat.com/。作者说我应该在 ~/.bash_profile 中为 zf.sh 脚本添加别名。但是我的主目录中没有这样的文件,我可以通过“touch .bash_profile”创建一个新文件,但这也不起作用。

Also I downloaded zend studio trial and tried to create a project from there but when I run it in browser its only showing blank page...

我还下载了 zend studio 试用版并尝试从那里创建一个项目,但是当我在浏览器中运行它时,它只显示空白页面......

Any idea whats going wrong? Can anybody tell me what can I do to successfully create project from zend studio or zend tool?

知道出了什么问题吗?谁能告诉我如何从 zend studio 或 zend 工具成功创建项目?

Is there any step by step guide available for mac os x lion ? any help will be much appreciated!!

是否有适用于 mac os x lion 的分步指南?任何帮助都感激不尽!!

Update 1 -OMG! how can I skip this... when I am creating project form zend studio its not putting zend library in "library" folder... thats why I am getting blank page... I just copied the zend folder in library and project form zend studio got working...

更新 1 -天哪!我怎么能跳过这个......当我创建项目表单zend studio时它没有将zend库放在“library”文件夹中......这就是为什么我得到空白页面......我只是在库和项目表单中复制了zend文件夹Zend工作室开始工作......

still working to resolve the first issue (setting zf.sh) :(

仍在努力解决第一个问题(设置 zf.sh):(

采纳答案by Saurabh

As .bash_profile was not there I created my own! by -

由于 .bash_profile 不在那里,我创建了自己的!经过 -

sudo nano ~./bash_profile

sudo nano ~./bash_profile

and created a alias in it for zf.sh file -

并在其中为 zf.sh 文件创建了一个别名 -

alias zf=/usr/local/ZendFrameworkCli/bin/zf.sh

alias zf=/usr/local/ZendFrameworkCli/bin/zf.sh

and boom!!

和繁荣!

I tested this by running this command -

我通过运行此命令对此进行了测试 -

zf show version

zf show version

and it worked perfectly...

它工作得很好......

Many thanks to @tawfekov and @halfer

非常感谢@tawfekov 和@halfer

回答by user2211458

Please find the the below which works fine for your problem

请找到以下适合您的问题的方法

alias zf=/usr/local/ZendFrameworkCli/bin/zf.sh

别名 zf=/usr/local/ZendFrameworkCli/bin/zf.sh

but you have to enter this each time you open a new terminal.

但是每次打开新终端时都必须输入此内容。

Steps to create permanent aliases on MAC OS X:.

在 MAC OS X: 上创建永久别名的步骤。

Step 1 : Open terminal and issue this command open ~/.bash_profile

第 1 步:打开终端并发出此命令 open ~/.bash_profile

Step 2: alias zf=/usr/local/ZendFrameworkCli/bin/zf.sh

第二步:别名zf=/usr/local/ZendFrameworkCli/bin/zf.sh

Step 3: save the bash_profile and exit the terminal

第 3 步:保存 bash_profile 并退出终端

Step 4: Use the zend tool using zf command in the terminal

第 4 步:在终端中使用 zf 命令使用 zend 工具

回答by Mikejames

Just a quick one why install the zend framework just download it open the terminal and type the location you have installed the zend framework ie

只是一个快速的为什么要安装 zend 框架只需下载它打开终端并输入您安装 zend 框架的位置,即

zendframework/bin/zf.sh create project quickstart

No need to add this to your profile.

无需将此添加到您的个人资料中。

回答by halfer

Try ls -a ~to see what you have in your home directory - there is probably a .profile file in there.

尝试ls -a ~查看您的主目录中的内容 - 那里可能有一个 .profile 文件。

回答by tawfekov

to be honest I had poor experience in mac osx , but i am ubuntu user

老实说,我在 mac osx 上的经验很差,但我是 ubuntu 用户

1-I would suppose you had zend framework installed in : /home/saurabh/ZendFramework/so the zf.sh would be in /home/saurabh/ZendFramework/bin/zf.sh

1-我想你已经安装了 zend 框架:/home/saurabh/ZendFramework/所以 zf.sh 将在/home/saurabh/ZendFramework/bin/zf.sh

let's try to symblink it to bin directory by executing this command ln -s /home/saurabh/ZendFramework/bin/zf.sh /home/saurabh/bin/zf

让我们尝试通过执行此命令将其符号链接到 bin 目录 ln -s /home/saurabh/ZendFramework/bin/zf.sh /home/saurabh/bin/zf

if this command ran with no error you should be able to run this command zffrom any where in your mac and you should see the zf command line menu

如果此命令运行没有错误,您应该能够zf从 Mac 的任何位置运行此命令,并且您应该会看到 zf 命令行菜单

2- zend framework doc http://framework.zend.com/manual/en/zend.tool.framework.clitool.html

2-zend 框架文档http://framework.zend.com/manual/en/zend.tool.framework.clitool.html

3-another useful resource : http://www.zendcasts.com/

3-另一个有用的资源:http: //www.zendcasts.com/