0

I am trying to setup the php yii-framework on a virtual server (ubuntu).

  • The yiiframework is placed in /var/www/yii-1.1.7/framework/.
  • The webroot is /var/www/vhosts/domainname/httpdocs/.
  • The command yiic.php webapp /var/www/vhosts/domainname/httpdocs/appname successfully creates the directory with the corresponding appname in the desired webroot folder.
  • The pages in the folder do however result in a 500 internal Server Error.

Since the framework folder obviously has the necessary rights to write the demanded files into the webroot (I double checked that all the files are created as expected) I suspect it must be some sort of issue that comes from the webroot not having the needed access to the overlying framework directory.

Does anybody have any idea how to change the corresponding config files so that this can work?

Bruiser
  • 11,767
  • 5
  • 34
  • 45
  • 2
    look for a reason in apache error log – Anton S Apr 17 '11 at 18:49
  • I wish I could reply with something of interest, but there is not one message with a somewhat close to current time value in the apache log. I did however notice that the directory and the files created in the webroot per yii command cannot be accessed and I cannot change the directory rights via ftp neither. – Bruiser Apr 17 '11 at 20:06
  • 1
    what about php error log , overall error log , mod_rewrite log – Anton S Apr 17 '11 at 20:28
  • thanks a lot for your hint. great stuff. php error logging was actually switched off so I first had to edit the php.ini file in order to get this right. current output on the site is this ->>> http://pastebin.com/BB0nHRqD – Bruiser Apr 18 '11 at 09:59

2 Answers2

1

In your index.php file located in your yii application's main folder there is a line that should look like this:

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

This is your index bootstrap file. All yii requests flow through this point. This file needs to know where the framework resources are. That's what the path above is about.

k to the z
  • 3,217
  • 2
  • 27
  • 41
  • thank you for the answer but the path in that file is set correct – Bruiser Apr 17 '11 at 21:32
  • 1
    I would check the permissions on the framework folder. chmod 777 the folder and see if that helps. Remember to lock the permissions back down though. – k to the z Apr 18 '11 at 04:17
1

As your error log shows "open_basedir restriction in effect." you can't really include anything outside from your basedir or outside from webroot in this server without changing the php configuration open_basedir variable

Anton S
  • 12,750
  • 2
  • 35
  • 37
  • I tried to get rid of the php error messages by adding the lines mentioned here: http://stackoverflow.com/questions/2781185/php-a-different-open-basedir-per-each-virtual-host to the overall httpd.conf and (since this is a system with plesk 10 installed) I also added a file vhost.conf to the /conf/ directory of the webroot, see here: http://www.toosweettobesour.com/2008/02/02/plesk-open_basedir-workaround/ - The php error messages however remain unchanged. Was this the wrong approach or is there maybe something else that could cause these errors? – Bruiser Apr 18 '11 at 15:41
  • Solved. Thanks a lot. For the sake of making this a question with some valuable information for others, here is what made things work: Adding the file vhost.conf to the /conf/ directory of the webroot and subsequently calling /usr/local/psa/admin/sbin/websrvmng -v -a did the job. FYI here is the content of my vhost.conf file: http://pastebin.com/P0hvsXN9 - Thanks a lot to anybody for helping me through this. Great stuff! – Bruiser Apr 18 '11 at 16:21