Install Yii on XAMPP on Linux


(Hexaust) #1

I cannot create an application on linux

when i run

% cd WebRoot/testdrive

% php YiiRoot/framework/yiic.php webapp WebRoot/testdrive

i get the following error

php command not found, although on my localhost i see the xampp installation.

Does anyone run Yiic on XAMPP in Linux?


(Ricardo Grana) #2

you have to add the php.exe path in your PATH environment variable.

I dont use Linux, so I dont remember the exact command to do that


(Fokeme) #3

Hi people I’m new to the forum, I have the same problem as hex, I can’t start a new application using the Yiic tool.

I’m using Xampp on linux ubuntu, any idea ?


(Fokeme) #4

I just found a solution to my problem by installing PHP5 on my server

sudo apt-get install php5-cli

I don’t know how to use the command line with Xampp or where is the path to php.

by installing php5-cli it tells me the path, I just created a new application this way

/usr/bin/php5 webroot/yiiroot/framework/yiic.php webapp webroot/testdrive

hope it helps !


(Simon) #5

Hex, you probably worked it out by now but for benefit newbies who have similar problems

page 6 and 7 of this guide on this thread explains what you need to do.

actual pdf


(Vjfs18) #6

"webroot" is the folder where your application is going to be installed and "Yiiroot" is the folder you unzipped the Yii framewoork

If you are using lampp the webroot is: /opt/lampp/htdocs/testdrive -> you must create a folder, it would be named testdrive or whatever you want it.

In my case i unzipped the yii framework in the folder /opt/lampp/htdocs/yiif and my webapp will be in /opt/lampp/htdocs/yii

First, open the terminal

then write:

cd /opt/lampp/htdocs

next write:

/opt/lampp/htdocs/yiif/framework/yiic webapp yii

That worked for me.


(Lanesastubbs) #7

I’m having the same issue. I’m running xampp and need some help getting the yiic command line tool to generate the app. Here’s the error messages I’m getting.

lanesa@lanesa-mocha:~$ cd /opt/lampp/htdocs

lanesa@lanesa-mocha:/opt/lampp/htdocs$ yii/framework/yiic webapp htdocs/testdrive

/usr/bin/env: php: No such file or directory


(Leventis123) #8

This might be old but someone could get some help

chmod -R 0755 /opt/lampp/htdocs

From theindexer.wordpress.com

For mint and later versions of ubuntu it might be a better idea to add it under


/etc/bash.bashrc 

That way when you:


php framework/yiic.php webapp projectName

php will be recognised.

You can then go ahead and change the permission of that folder to be writeable by your user.


chgrp -R userName projectName/

chown -R 0775 projectName/

If you need more information on how to install lampp for linux follow the instructions under:

www.apachefriends.org

I hope it was helpful.


(Kiru42) #9

Really useful, thanks.


(Leventis123) #10

I am glad it is helpful.

If you just get the error page

‘Unable to resolve the request"site".’ in /opt/lampp/htdocs/framework/web/CWebApplication.php:281

Make sure your permissions are set correctly, and your class filenames match the class name (case sensitive)

I migrated from windows to linux, both running xampp.

My mistake was to have all the files permissions set correctly, but the copied folders didn’t.


(Lanesastubbs) #11

Thank you so much!!!!!!!!!!!! I ended up having to install a VM in VirtualBox and setting up LAMP to use it but now I’m going to set it up on my default system. Thanks!!!!!!!!!!!


(W Pirker) #12

I also use Linux as default. Most bigger Linux distros use own Apache server packages. For example under Fedora one could use this guide: forums.fedoraforum DOT org/showthread.php?t=94257 (interesting steps: HTTPD (PHP enabled) and MySQL)

To set the right permissions to the /var/www/html folder I create a group apache (file /etc/group), then set the permissions with the commands "chgrp -R apache ./" and "chmod -R g+rw ./" below the right folder (under Fedora: /var/www/html and if necessary also below the yii folder).

If it shows any timezone related issues, it’s necessary to set a timezone in php.ini


(Mckain Default) #13

I use Linux and I do not use Xammp or whatever (no offenses), you should use APACHE and PHP running right away! in your Linux box! It’s better in that way!


(Achmadluckysetiaji) #14

i just wondering some nice path to install yii-1.1.13 with xampp on ubuntu 12.XX. You must try install it from xampp directory, if default directory like this:

~$ /opt/lampp/ (its my directory)…

this is how i’m install it;


~$ sudo /opt/lampp/bin/php /opt/lampp/htdocs/yii/framework/yiic webapp /opt/lampp/htdocs/yourproject  

where:


~$ sudo /opt/lampp/bin/php

is php executable inside xampp, and


/opt/lampp/htdocs/yii/framework/yiic

my directory of yii (use "sudo mv" to change folder yii from source),


webapp

is yiic command to make new project… and last thing


/opt/lampp/htdocs/yourprojec

is directory of xampp htdocs with name of myproject "yourproject"

maybe help for all of you, and sory if my language was bad…


(Awriel) #15

Maybe can be alternavite too :




# cd /opt/lampp/bin/

# ./php /opt/lampp/htdocs/yii/framework/yicc webapp /opt/lampp/htdocs/myweb




Machine : Linux Mint Petra

Server : XAMPP for Linux 1.8.3.1


(Kazemimorteza68) #16

only a error -->yicc ==>yiic




cd /opt/lampp/bin/

 ./php /opt/lampp/htdocs/yii/framework/yiic webapp /opt/lampp/htdocs/myweb