• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

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

R

rene verheij

Guest
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!
 
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
 
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?
 
And do you know if the cronjobs for a specific domain that I add in plesk would use the vhost.conf file?

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 :)
 
Back
Top