Plcae Of Framework

in my dedicated server i have so many project with different account

now i want to use 1 frame work for all of them, where i should upload it and how can i assign Path?

now,what i did? i uploaded for each account 1 framework folder behind public_html folder.

you can upload it anywhere in your server but it’s better to don’t upload it to a web accessible directory like your webroot

and you can assign framework path in Entry Script (index.php)

sorry, but you didn’t get me!!!

read it carefully please

I think Reza’s answer is correct. See also this wiki for more informations.

  • Server[list]
  • yii (shouldn’t be accessible via web) => can/should be a symlink[list]
  • framework[list]
  • yii.php

[/list][*]user 1

  • public_html (e.g. DocumentRoot of user 1) => Yii App 1[list]
  • index.php with path to framework: ../../yii/framework/yii.php
  • protected

[/list][*]user 2

  • public_html (e.g. DocumentRoot of user 2) => Yii App 2[list]
  • index.php with path to framework: ../../yii/framework/yii.php
  • protected

[/list][*]…[/list][/list]If your system (server) looks different please describe…

thank you for your explain , but where i should upload framework?

now i am uploading for each user in behind his public_html.

i made PS and attach it for you, this is my server root’s capture

You can upload the framework anywhere, as long as it’s accessible to the user accounts.

index.php in root of app, and yiic.php in protected needs to be changed:


// change the following paths if necessary

$yii=dirname(__FILE__).'/../yii/framework/yii.php';



Of course, put the absolute path to Yii on your server.

No need to symlink anything.

Check out http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard in order to find a suitable directory for your framework.

I’ve stored the framework in /usr/local/share/

thank you Coksnuss ,

i stored the framework in /usr/local/share/ as you said,

now in index.php in root of app what should i say?

thanks for you responds

Take a look at index.php:


// change the following paths if necessary

$yii=dirname(__FILE__).'/../yii/framework/yii.php';

What exactly is it that you don’t understand?

jacmoe , imagine you have 1 dedicated server and you have 100 project for different client , and all of them you use Yii framework,

now what you will do? for each account for each client you want to upload Framework ???

of course this is not a best way and standard way,

it should be one way to place framework somewhere and all those 100 project for different clients refer to that Framework where is placed.

i hope that you got it…

That totally depends on how the server is set up.

For example, if the clients have their stuff in /home/username/stuff, then put Yii in /var/www/yii or any other directory on the server where the webserver has read rights.

Then users use the absolute path to where Yii is placed, like:


// change the following paths if necessary

$yii = '/var/www/yii/framework/yii.php';

thanks a lot jacmoe,

great, i should put absolute path

again , thank you for your help,