View Single Post
Old 27th June 2013, 00:03
tio289 tio289 is offline
Join Date: Mar 2009
Posts: 70
Thanks: 2
Thanked 14 Times in 9 Posts
Default Cannot set/change open_basedir via remote api

Hi all,

I cannot set php open_basedir via remote api. I need create subdomain and change basedir one directory up, but it not work.

PHP Code:
$params = array(
'server_id' => 1,
'ip_address' => '*',
'type' => 'vhostsubdomain',
'parent_domain_id' => $this->repo->site_id,
'domain' => $this->branch.'.'.$this->repo->site_domain,
'web_folder' => $document_root// sub_somebranch/public
'errordocs' => 0,
'subdomain' => 'none',
'suexec' => 'y',
'php' => 'fast-cgi',
'active' => 'y',
'hd_quota' => 1000,
'traffic_quota' => '-1',
'allow_override' => 'All',
'php_open_basedir' => $parent_document_root.DIRECTORY_SEPARATOR.'sub_'.$this->branch// /var/www/clients/client1/web36/sub_somebranch
'pm_max_children' => 10,
'pm_start_servers' => 2,
'pm_min_spare_servers' => 1,
'pm_max_spare_servers' => 5,
'pm_process_idle_timeout' => 10,
'pm_max_requests' => 0,
$subdomain_id IspconfigRemote::sites_web_vhost_subdomain_add($this->client_id$params); 
It always generate open_basedir with full path to document root. (/var/www/clients/client1/web36/sub_somebranch/public)

I also try update subdomain via remote api and it was too unsucces.

When I update open_basedir via control panel, it shows me full path, but in db changes to only parrent domain (/var/www/clients/client1/web36), which solves problem with current subdomain, but I need it fully automatic, users cant go to CP edit basedir whe they publish branch.

Would somebody help me? Also vhost_subdomain api is undocumented
Independent Senior Webdeveloper
Reply With Quote
Sponsored Links