ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

PHP Errors when following best practices - Move system above webroot

May 03, 2012 12:49am

Subscribe [4]
  • #1 / May 03, 2012 12:49am

    JPDesignDev

    20 posts

    Per the best practices documentation, I have decided to move my system folder above web root. There is a problem, though. I have contacted my hosting provider, and they state that this is not something they can provide support for. Please tell someone at Ellis Labs can help.

    Please note that this setup works flawlessly on MAMP, so it must be environment specific. My hosting provider is MediaTemple, and it is a dedicated virtual, which I know is common amongst EE devs. (no wishy washy hosting here to blame unfortunately)

    Here is what is displayed when visiting develop.example.com.

    Your system folder path does not appear to be set correctly. Please open the following file and correct this: index.php

    Here is my system_path directive in index.php

    $system_path = '../system';

    Here are the PHP errors I am receiving

    [Wed May 02 21:19:08 2012] [error] [client xx.xx.xx.xx] PHP Warning:  realpath(): open_basedir restriction in effect. File(/var/www/vhosts/example.com/develop.example.com/system) is not within the allowed path(s): (/var/www/vhosts/example.com/develop.example.com/public_html/:/tmp/) in /var/www/vhosts/example.com/develop.example.com/public_html/index.php on line 125
    [Wed May 02 21:19:08 2012] [error] [client xx.xx.xx.xx] PHP Warning:  is_dir(): open_basedir restriction in effect. File(../system/) is not within the allowed path(s): (/var/www/vhosts/example.com/develop.example.com/public_html/:/tmp/) in /var/www/vhosts/example.com/develop.example.com/public_html/index.php on line 134

     

    I have no clue where to start with this one. Does anyone have any ideas?

  • #2 / May 03, 2012 4:54am

    mark186282

    290 posts

    It looks like apache is configured with open_basedir for security purposes.  This is a good thing.

    You’ll have to adjust your httpd.conf to allow for your directory above htdocs.  Here’s a discussion about it:

    http://stackoverflow.com/questions/223800/how-can-i-relax-phps-open-basedir-restriction

     

  • #3 / May 03, 2012 10:46am

    JPDesignDev

    20 posts

    Thanks. I got it working. It seems that I was not following the proper steps for my webhost in changing the open_basefir on my subdomain.

    Those of you on MediaTemple, this article

    http://blog.picdorsey.com/labs/running-expressionengine-under-a-subdomain-on-the-mediatemple-dv4-server#.T6KVCJ9Yswk

    in combination with this

    http://kb.mediatemple.net/questions/514/How+do+I+set+the+path+for+open_basedir?#dv_40/requirements

    should get you going.

  • #4 / May 03, 2012 1:15pm

    Shane Eckert

    7174 posts

    Hey all,

    Nice work here!

    I am glad to see the community working so well together.

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases