There’s no response from the topic creator whether the problem has been solved or not…
Anyway, for the sake of Ubuntu users and wanted to try Yii as their framework, here’s what I’ve done:
Extract your downloaded Yii pack to a web-accessible folder, let’s say the folder’s name YiiFramework.
Open your command line, and go to your web server’s document root, say MyWebroot.
$ cd MyWebroot
To create your demo folder, type in your command line:
$ YiiFramework/framework/yiic webapp demo
It will ask a confirmation from you if you really want to create a web application under /MyWebroot/demo, so just type in there Yes and hit enter. It will create all the default files and folders for the framework’s web application skeleton .
bash and ./ wont work because yiic is not an ubuntu or even a linux command. As a matter of fact, I was able to run yiic in the command prompt of windows 7!
I extracted Yii right in my apache’s documentroot. If you placed it (extracted Yii files) inside a folder under your documentroot, you need to change the directory in step #3 to access yiic
There might be a need to change the yiic file’s permission for it to become executable (like chmod +x) if permission denied error appears when executing step #3.
If ever you encounter the error "/usr/bin/env: php: No such file or directory", just install php5-cli
when I tried to run from the command line php -v , it said php was not installed.
I discovered my version of Ubunut (karmic) did not have the php cli installed, webpage processing worked fine, but php5 from the command line interface did not work. so I had to sudo apt-get install php5-cli
that also failed, so I had to type sudo apt-get update to update all the apt locations, and then run the install of php5 cli
then I was able to run the command line magic to create the testdrive !
Nothing but errors here. It also seems everybody posting as a different solution which is never a good thing.
Error: The directory ‘var/www/Industry_Assignment’ is not valid. Please make sure the parent directory exists.
USAGE
yiic webapp <app-path>
DESCRIPTION
This command generates an Yii Web Application at the specified location.
PARAMETERS
app-path: required, the directory where the new application will be created.
If the directory does not exist, it will be created. After the application
is created, please make sure the directory can be accessed by Web users.
My command was: /var/www/YII/framework$ php yiic webapp var/www/Industry_Assignment
Update:
I have a LAMP environment on Ubuntu and a VirtualBox running XP with an XAMPP dev environment so I set up the environment variables on XP and YII setup runs like a charm
I think it is a matter of setting the environment variables for PHP and YII on Ubuntu to solve this issue.
What do you mean the path for PHP and path for Yii?
If you want to find out where php5-cli is installed, you can try:
which php
It will output something like /usr/bin/php.
I don’t know what you mean by path for Yii. Maybe path to yiic, which is the place you unpacked the YiiFramework archive. If you have your copy of YiiFramework in ~/yii/ then yiic will be in ~/yii/framework/yiic.
The yiic file is just a bash script that runs yiic.php using PHP. If you open it in a text editor, you can see: