1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Plesk not usable any more... 10.3 how to disable open_basedir FOREVER!!!! -

Discussion in 'Plesk 10.x for Linux Issues, Fixes, How-To' started by andyb-uk, Aug 23, 2011.

  1. andyb-uk

    andyb-uk New Pleskian

    20
     
    Joined:
    Aug 17, 2009
    Messages:
    15
    Likes Received:
    0
    Plesk not actually usable any more... 10.3 how to disable open_basedir - FOREVER!!!!

    Hi.

    It seems the latest version of Plesk overrides safemode and open_basedir settings by writing to

    /var/www/vhosts/domain.name/etc/php.ini

    It completely ignores open_basedir settings in

    /etc/php.ini, etc

    And any settings relating to open_base dir in a vhost.conf file as outlined in Plesk's own knowledgebase article

    http://kb.odin.com/432

    -- This NO LONGER WORKS !!!! As the settings in /var/www/vhosts/domain.name/etc/php.ini override the settings in the vhost.conf file.

    If I edit

    /var/www/vhosts/domain.name/etc/php.ini

    Then do changes in Plesk it overwrites my changes (and breaks domains) by re-writing to

    /var/www/vhosts/domain.name/etc/php.ini

    The only way I can actually control the server is by using a cron job to delete

    /var/www/vhosts/*/etc/php.ini every 5 mins.... (not the best solution .................)

    - then it follows what is in the standard php.ini file - and my domains work.

    I know there are security implications regarding disabling it - that is not the point - I used to be able to disable it

    Now I can only disable it if no one touches hosting settings in Plesk....

    Does anyone have a solution that doesn't involve deleting files on a cron job ?


    Edit:-

    This applies to adding a directory to open_basedir as well as disabling it completely....

    From another post I saw you can create

    /var/www/vhosts/.skel/0/conf/php.ini

    - this does work for new domain - not the 100's that already exist..

    How do I disable open_basedir for domains that existed before I created
    /var/www/vhosts/.skel/0/conf/php.ini ?

    ANy help would be good

    Not happy with Plesk's changes...
     
    Last edited: Aug 23, 2011
  2. Sergey L

    Sergey L Golden Pleskian Staff Member

    32
    43%
    Joined:
    Aug 10, 2006
    Messages:
    1,195
    Likes Received:
    30
    While /etc/php.ini is global default for all sites, .../etc/php.ini and .../vhost.conf are different. They can override defaults of /etc/php.ini, but cannot override each other:
    .../etc/php.ini is only applied to FastCGI sites
    .../vhost.conf is only applied to mod_php sites

    If your sites were FastCGI - php options from .../vhost.conf just never were applied, it is not something broken in 10.3 or any other version.

    I think the problem root is different - prior to 10.3, FastCGI sites didn't support per-site configuration (i.e. safe_mode). So all settings were taken from global /etc/php.ini or just set in standard defaults. Apparently this problem was a coincidental match to a solution you were seeking for.

    For now a solution would be to make a simple bash script copying your php.ini ("open_basedir = ") into .../etc folder for all existing domains.

    For next version we'll have UI managing PHP settings transparently for mod_php and FastCGI. All customizations you are doing now in .../etc/php.ini will be preserved, but not imported.

    Regards
     
  3. MikeRoberts

    MikeRoberts Guest

    0
     
    I had huge issues with this as well.
    In the end I changed plesk's template file.
    This will change all (sub)domains on the server, but that doesn't bother me.

    I simply edited this file:

    /usr/local/psa/admin/conf/templates/default/service/php.php

    and changed open_basedir to what I needed.
    Then reloaded config changes.
     
  4. Sergey L

    Sergey L Golden Pleskian Staff Member

    32
    43%
    Joined:
    Aug 10, 2006
    Messages:
    1,195
    Likes Received:
    30
    Sneak preview of next version

    [​IMG]
    perhaps this may make you happier in the next version :)

    regards
     
  5. Gabev

    Gabev Guest

    0
     
    Hahahahaha.... next version ...are u saying that another Horror Upgrade is ahead of us? why is that everytime I upgraded the plesk panel I ended up with another broken server which took countless hours of work to figure out how to fix it?why is that on a debian base server WITHOUT Plesk Panel never had so much issues ? As we speak, the upgrade from ver 10.2 to 10.3 broke in the middle of the procedure, leaving me and my clients with a non-working server...I had to re-install plesk to get it working , and of course , the email server is all screwed up now ...and your utility from psa/admin/ which is supposed to "fix" the email issue doesnt work properly...and talking about php53 , in my version of 10.2 I never had the option to install php5.3 with the autoinstaller(which supposely is available according to Plesk documentation)...and to talk about "support" which always never comes when u need it but only AFTER other users suggested a solution...Next Version , yeah ...
     
  6. Conrad B

    Conrad B Guest

    0
     
    Plesk 10.3 - open_basedir and subdomains

    Hi Sergey,
    thanks for this explanation for the differences between the fast_cgi and mod_php configuration - I didnt get this information on any of the 100k websites I visited before telling me how to configure the vhost.conf file (for my fast_cgi server)

    I have the same issue than andyb-uk but also with subdomains inside my vhost. Plesk 10.3 didnt allow me to create the document root inside /subdomains/dev/httpdocs as I was used to (in plesk 8) and saying that this is a "service directory" - so I created a dictory "httpdocs_dev" in the main directory of the vhost which is working basically as expected. The only bad thing, I can't get the /etc/php.ini file running.. whether in /vhosts/domain.tld/etc/php.ini nor in /vhosts/domain.tld/subdomains/dev/etc/php.ini - settings are ignored completely..

    This is my directory structure (extracted the important things) - I try to access from httpdocs_dev/Symfony/web/config.php (market width a > to httpdocs_dev/Symfony/app/cache (marked with a #):
    The Document Root is saved in /vhosts/domain.tld/httpdocs_dev/Symfony/web -> which is also the open_basedir restriction.. is there any way I can have both? The document root *and* the open basedir settings? in best case, also to use the customized php.ini.. (of couse I ran /usr/local/psa/admin/bin/websrvmng -a -r or /etc/init.d/apache2 restart but it didnt make anything.. - not even test ini settings like memory_limit)
    .
    ├── anon_ftp
    ├── cgi-bin
    ├── conf
    ├── error_docs
    ├── error_logs
    ├── etc
    │** ├── group
    │** ├── passwd
    │** └── php.ini
    ├── httpdocs
    │** ├── index.html
    ├── httpdocs_beta
    │** └── index.html
    ├── httpdocs_dev
    │** ├── Symfony
    │** │** ├── app
    #** │** │** ├── cache
    #** │** │** ├── logs
    │** │** └── web
    >** │** ├── config.php
    │** │** ├── phpinfo.php
    ├── statistics
    ├── subdomains
    │** ├── beta
    │** │** ├── cgi-bin
    │** │** ├── conf
    │** │** └── error_docs
    │** └── dev
    │** ├── cgi-bin
    │** ├── conf
    │** │** └── vhost.conf
    │** ├── error_docs
    │** └── etc
    │** └── php.ini
    └── web_users


    Thanks, Conrad

    PS. I'm excited about the changes of plesk with php settings - for the next server with a newer Plesk version ;) I hope its possible to edit some more php settings
     
    Last edited by a moderator: Sep 21, 2011
  7. Conrad B

    Conrad B Guest

    0
     
    I found a quick - but kind of dirty way around this which may help anyone else who has to struggle with it:

    instead of creating a subdomain with "dev.mydomain.tld" - I created a new main domain which was called dev.mydomain.tld - the weird thing was that plesk did not create a httpdocs directory in the new main domain directory. When I told plesk to use "httpdocs" as document root, it used the httpdocs directory from the first domain directory! So I told plesk to use "httpdocs_dev" (which is automatically placed in "/var/www/vhosts/domain.tld/") and was able to edit the php.ini in /var/www/vhosts/dev.mydomain.tld/etc/ and change open_basedir and my other ini settings... after restarting apache, it worked :)
     
  8. Brade

    Brade Guest

    0
     

    Looks like something changed in 10.4 so this no longer works :mad:
    It's like they are intentionally trying to make this as difficult as possible.
    I've been searching for hours for the default template setting of "open_basedir" but even a simple grep of all the files in /usr/local/psa does not seem to lead me to any correct options. I am getting totes infuriated.
     
  9. GothicJB

    GothicJB New Pleskian

    13
    35%
    Joined:
    Sep 16, 2011
    Messages:
    17
    Likes Received:
    0
    Location:
    Blaine, MN
    the structure of the file: /usr/local/psa/admin/conf/templates/default/service/php.php has changed in 10.4 ... you must add the following:

    if (isset($OPT['settings'])) {
    echo $OPT['settings'];
    }
    if(array_key_exists('dir', $OPT) && $OPT['dir']) {
    echo "php_admin_value open_basedir {$OPT['dir']}/:/tmp/:/usr/local/share/php-lib/:/usr/local/share/php-lib/library/\n";
    }

    } else {

    AND...

    if (isset($OPT['settings'])) {
    echo $OPT['settings'];
    }
    if(array_key_exists('dir', $OPT) && $OPT['dir']) {
    echo "php_admin_value open_basedir {$OPT['dir']}/:/tmp/:/usr/local/share/php-lib/:/usr/local/share/php-lib/library/\n";

    }
    } else {


    REPLACING your correct paths in: {$OPT['dir']}/:/tmp/:/usr/local/share/php-lib/:/usr/local/share/php-lib/library/\n";}

    Hope this helps someone. took me a couple hours to figure out ...

    then just run /usr/local/psa/admin/bin/httpdmng --reconfigure-all
     
  10. Brade

    Brade Guest

    0
     
    Thanks, I actually found where the PHP settings are now in the Plesk panel itself for default settings (in Server --> Simple View Settings) and for each domain (PHP settings tab) -- I just set the open_basedir setting to none (without quotes). I'll just go thru and change these one by one since I only have about 25 domains set up. That way, the change should remain for future Plesk upgrades (as opposed to altering a core file again).

    I think it would be great if Plesk would let you select multiple domains at once to apply these types of settings--maybe in a future release ;)
     
  11. regisg

    regisg Regular Pleskian

    24
    90%
    Joined:
    Jan 19, 2010
    Messages:
    114
    Likes Received:
    1
    Hi,

    Same problem buy i can't find "/usr/local/share/php-lib/" on my plesk 10.4.4 (cent OS 5) !

    Please coul you help me ?

    Thx a lot.
     
  12. GothicJB

    GothicJB New Pleskian

    13
    35%
    Joined:
    Sep 16, 2011
    Messages:
    17
    Likes Received:
    0
    Location:
    Blaine, MN
    REPLACE your correct paths in: {$OPT['dir']}/:/tmp/:/other/path/to/file/you/are/trying/to/access/\n";}
     
Loading...