Framework folder permissions

Hello to all.

I’ve posted this as a reply on a previous topic but I guess no one saw it there. I’m really sorry if this isn’t allowed.

I want to install the framework folder in a relative path to all of my domains on the server.

What folder permissions and ownership I need, to make it work?

My server structure is /var/www/vhosts/"domain names"/httpdocs

and I want the framework folder in this path /var/www/vhosts/framework.

Although I can create a new app on the domain path , it will not work due throwing an 500 internal server error.

Tried to change the framework folder and files permissions to 777 but it didn’t work either. The path to yii.php is correct in index.php.

Thanks in advance.

Hi!

I’m used to set 0755 to folders and 0644 to files in the server.

Have you tried to access the “requirements” test inside Yii’s folder?

Regards!

Well at first I uploaded the yii framework folder inside httpdocs so i can access it by a web browser.

The "requirements" test was correct, outputting the infos as the tutorial indicates.

But now I want to move the framework folder outside httpdocs folder, so it will no be web accessible.

But although the path in my app index file to yii.php is correct it’s not working, throwing the 500 interval server error.

First of all after moving framework out of the webroot directory, you must check if the variables in index.php, index-test.php, protected/config/*.php, protected/tests/bootstrap.php files point to the correct framework path. Then you must make assets and runtime folder accessible by web server (for example chmod 777).

Thanks for the reply Jampire.

I’m creating a new application with the framework folder outside webroot, but I’m getting 500 internal server error.

Permissions are 777 and folder is apache group accessible.

I have the same problem working with a vps in Centos 5 (using parallels), if I move the framework outside the webroot, and I change permissions as required, and paths inside index.php I get the 500 internal error

Have you solve the problem?

Thanks

I’ve been doing this myself so I thought I would add my standard procedure for setting this up.

  1. Determine the include paths for PHP

I typically do this by creating a phpinfo.php that I load on the server.


<?php

echo phpinfo();

?>

Browsing to phpinfo.php, I search for include_path. Mine lists the following


.:/usr/share/php:/usr/share/pear

  1. From there I extract Yii into the php include path.

In my case this was /usr/share/php.

I extract with the full release name (ie. yii-1.1.10.r3566, then create a symbolic link so that I can upgrade to future versions by changing the link without any changes to my Yii apps.

ln -s yii-1.1.10.r3566 yii

I perform these as root (sudo in Ubuntu) and the resulting permissions I get are


lrwxrwxrwx 1 root root   16 Apr 12 00:34 yii -> yii-1.1.10.r3566

drwxr-xr-x 5 root root 4096 Feb 13 02:01 yii-1.1.10.r3566



  1. Finally, I set the appropriate paths with my Yii app (index.php, index-test.php, protected/config/*.php, protected/tests/bootstrap.php) using the absolute path.

Here is a sample from index.php


$yii='/usr/share/php/yii/framework/yii.php';