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

vhost.conf ignored when script run through ssh rather than browser?

Discussion in 'Plesk 9.x for Linux Issues, Fixes, How-To' started by rene verheij, Jun 22, 2010.

  1. rene verheij

    rene verheij Guest

    0
     
    Hi,

    Just set up open_basedir through vhost.conf to allow the whole domain to have access to /usr/local/share/something/, /var/www/vhosts/domain.com/httpdocs/ and /tmp.

    When I run my script www.domain.com/file.php through the browser it gets access to /usr/local/share/something/, just like I want it too.

    But now I need to run something through SSH:
    /usr/bin/php -q /var/www/vhosts/domain.com/httpdocs/some_folder/file.php

    which gives an error telling me about a open_basedir restriction. In other words, if running a script through SSH the open_basedir settings of vhost.conf seem to have no effect.

    When the script tries to access ../some_other_folder/ it gives an open_basedir restriction error "... some_other_folder is not within the allowed path(s): (/tmp)" ... which is the global open_basedir setting.

    Any advice?

    Tnx in advance!
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    Right, vhost.conf settings are actual only for access via webserver (apache) and haven't any effect when you run php via CLI. All actual settings for php command are stored in /etc/php.ini file
     
  3. rene verheij

    rene verheij Guest

    0
     
    Ok, that makes sense then. Tnx!

    And do you know if the cronjobs for a specific domain that I add in plesk would use the vhost.conf file?
     
  4. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    Once again - vhost.conf is just Apache config file and it is actual only for Apache operation. I don't know how this config file can be used for cronjob tasks. It can be modified somehow by cronjob task for changing webhosting domain's parameters (Apache settings), but can't be used as parameter for some cronjob tasks. Maybe it can be used but I can't imagine how :)
     
Loading...