Jump to content
Larry Ullman's Book Forums

Starting Yii In Terminal

Recommended Posts

Hi Larry,

I bought your book PHP and MYSQL for dynamic websites and have found it very easy to follow. I am completely new to PHP so that was important. I am actually a graphic designer but my company is working on a huge project that is built on the yii framework so they want us ALL to learn it. I am having a problem right from the get go with the terminal command. Nothing I type in seems to work. I am having trouble even understanding why I need to use terminal. I am not sure if this helps but I have installed MAMP on my Macbook Pro.


I ran this after I installed yii and it passed: http://localhost:8888/yii/requirements/


My yii is installed here: /Applications/MAMP/htdocs/yii


Please someone tell what I need to type into terminal to continue with yii. I won't be able to learn it I don't think if I can't get past this first step.

Link to post
Share on other sites

Just follow the installation guide on yiiframework.com, instructions are there for setting up a yii app with Mac terminal. I have made yii app's both with windows and Mac using those guides so you should be fine. If you are confused with terminal run the name in google to get terminal functions list from wikipedia.com.

Link to post
Share on other sites

Hmm still no luck...

this is what it says on the yii site:


% cd WebRoot on my computer I think that is...

% cd Library/WebServer/Documents but it says '-bash: fg: %: no such job' when I hit enter


% php YiiRoot/framework/yiic.php webapp testdrive on my computer I think this is...

% php Applications/MAMP/htdocs/yii/framework/yiic.php webapptestdrive but it says '-bash: fg: %: no such job' when I hit enter

I have tried this in so many variations now that I think I am going to go insane. Nothing works.

Link to post
Share on other sites

Here is the line i used to generate the app from terminal on my mac book:


Edward-Carnby-MacBook:htdocs Edward$ php yii/framework/yiic.php webapp sitename


sitename is the the name of your app.


What i done is i copied the yii framework folder in to the applications/mamp/htdocs folder, i renamed the yii folder yii, as before it contained info of the version number.


Then i changed the file path to htdocs in terminal then run the yii command in the line above to generate the app.


If you are questioning your sanity, that means your are still sane, Anders Behring Breivik is a good example of someone who is not.

Link to post
Share on other sites

Milo, I believe in the example you provided, the % character is being used to represent the prompt in Terminal. In Edwards example, his prompt is Edward$. In Windows, the > character is normally used as the prompt (e.g., C:\>).


You need to type what comes after the % character.

Link to post
Share on other sites

Thanks for your replies everyone. I did manage to get it working. I have decided to step back from the Yii side for a little while as I work my way through Larry's PHP book first. I will be back at it soon and am sure I will have a million questions for you when I do :-)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...