1

This might be a little to server focused, but I hope someone can help.

I have a PHP CodeIgniter application that I am trying to set up to have the configuration files (like application/config/database.php) set on the server (or local computer) so they are not in github (so database password isn't tracked) and it makes everything easier.

So I have it working perfectly on local host, basically it goes back to:

/path_before_httpdocs/config/development/config.php

but on the server I have the folder structure set up, but I get this error:

Warning: require(): open_basedir restriction in effect. 
File(/var/www/vhosts/mysite.com/subdomains/staging/config/staging/config.php) is not within the allowed path(s):
(/var/www/vhosts/mysite.com/subdomains/staging/httpdocs/:/tmp/:/var/www/vhosts/mysite.com/subdomains/staging/httpsdocs/:/tmp/) 
in /home/mysite/staging/deploy/releases/20130312155222/httpdocs/application/config/config.php on line 12

so first thing I did was go to php.ini file and see what it was. It wasn't set, so I set it to the php.ini then restarted httpd. So now if I run phpinfo() i see this:

Directive    |        Local Value                                                                                                           |        Master Value
open_basedir | /var/www/vhosts/mysite.com/subdomains/staging/httpdocs/:/tmp/:/var/www/vhosts/mysite.com/subdomains/staging/httpsdocs/:/tmp/ | /var/www/vhosts/mysite.com/subdomains/staging/config/staging/:/tmp/

I still get the error. So next thing I did was try

ini_set('open_basedir', '/var/www/vhosts/mysite.com/subdomains/staging/config/staging/:/tmp/');

this also did not work. So next thing was i just echoed ini_get('open_basedir') and this returned

/var/www/vhosts/mysite.com/subdomains/staging/httpdocs/:/tmp/:/var/www/vhosts/mysite.com/subdomains/staging/httpsdocs/:/tmp/

so it looks like it ignore my php.ini

I tried to follow this article (I am hosted on a DV 4 on mediatemple). Mediatemple support said they could not help me. Does anyone here have any ideas? I can also provide more information if needed.

Phil
  • 410
  • 3
  • 12
  • Are you **definitely** editing the .ini file returned by `phpinfo()`? And are you restarting your web server each time? – juco Mar 12 '13 at 18:23
  • I am because phpinfo is changing as I make edits and yes i am restart httpd each time – Phil Mar 12 '13 at 18:29
  • if there is no risk exposing my phpinfo i can send you the link so you can see the error – Phil Mar 12 '13 at 18:32

1 Answers1

0

I finally came with an answer. In Plesk I was able to set php settings and define open_basedir.

Phil
  • 410
  • 3
  • 12