Yiic problem in Ubuntu
#1
Posted 28 September 2010 - 10:56 PM
my problem is everytime i create a new application using this yiic command
bash yiic webapp demo
it gives me this error
yiic: line 2: ?php: No such file or directory
yiic: line 3: /bin: is a directory
yiic: line 4: base: command not found
yiic: line 5: base: command not found
yiic: line 6: base: command not found
yiic: line 7: base: command not found
yiic: line 8: syntax error near unexpected token `newline'
yiic: line 8: ` * @author Qiang Xue <qiang.xue@gmail.com>'
im a newbie in yiic and any help would be appreciated. Also I'm using Ubuntu 10.04, Mysql, Php 5 and Apache 2
#3
Posted 29 September 2010 - 05:58 AM
./yiic webapp demo
Yii Playground : Collaborative demo apps. You can join to improve it too!
My Team's Blog: In Indonesian.
#5
Posted 29 September 2010 - 11:46 PM
think you need to use this instead to install skeleton blog
first you need to get into your webroot by
cd /var/www <-- in my case
create a folder that you want your demo to be install in my case I create a folder named 'blog' under /var/www/yii/
then set permission to 777 by: sudo chmod 777
then type in the following command
php yii/framework/yiic.php webapp /var/www/yii/blog
if your php program has not been installed, the system will give you an install command then do it and come back to do the same.
then you can access your demo by http://localhost/yii/blog <--- in my case
#7
Posted 26 October 2010 - 10:57 PM
Anyway, for the sake of Ubuntu users and wanted to try Yii as their framework, here's what I've done:
1) Extract your downloaded Yii pack to a web-accessible folder, let's say the folder's name YiiFramework.
2) Open your command line, and go to your web server's document root, say MyWebroot.
$ cd MyWebroot
3) To create your demo folder, type in your command line:
$ YiiFramework/framework/yiic webapp demo
4) 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 .
5) Go to http://localhost/demo/index.php to verify if the web application has been created.
Notes:
* 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
sudo apt-get install php5-cli
#8
Posted 29 December 2010 - 08:20 AM
I had the same problem with Ubuntu 10.10 until I created the directory manually. Since my webroot is /var/www:
mkdir /var/www/someYiiProj
./yiic webapp someYiiProj
worked fine
#9
Posted 14 January 2011 - 01:55 PM
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 !
#10
Posted 17 March 2011 - 04:56 PM
SteveWa, on 14 January 2011 - 01:55 PM, said:
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 !
This worked for me. Thanks
#11
Posted 04 December 2011 - 01:32 AM
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.
This post has been edited by gareth: 04 December 2011 - 02:15 AM
#12
Posted 04 December 2011 - 03:56 AM
It's '/var' not 'var' ...
#13
Posted 04 December 2011 - 07:26 PM
thanks
#14
Posted 08 December 2011 - 09:55 AM
gareth, on 04 December 2011 - 07:26 PM, said:
thanks
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:
#!/usr/bin/env php <?php require_once(dirname(__FILE__).'/yiic.php');
So, running ./yiic or php yiic.php is exactly the same thing.
#15
Posted 10 December 2011 - 09:52 AM
PATH=$PATH:/var/www/cakephp1.3/cake/console:/var/lib/gems/1.8/gems/rails-3.0.10/bin:/var/www/yii/framework export PATH
After that, you can use yiic command line from the terminal
#16
Posted 10 December 2011 - 10:07 AM
You need to use ./yiic instead of just yiic if you intend to run the application specific yiic script.
Otherwise it will run the framework yiic script instead.
#17
Posted 01 August 2012 - 12:30 PM
Please, explain me why ./yiic works perfectly but yiic gives me
yiic: command not found
I added in the end of ~/.bashrc that lines:
PATH=$PATH:/home/zablik/server/frameworks/yii/framework
export PATH
but still yiic doesn't work. I use Ubuntu 12.04
Thanx.
#18
Posted 01 August 2012 - 07:52 PM
Have you tried to add this to /home/zablik/.profile ?
I have some thing similar setup on ubuntu 11.10 which works very well via yiic

#19
Posted 08 August 2012 - 09:25 AM
$ sudo ln -s /path/to/your/yiic /usr/local/bin

Help













