globals->config_path}/config.xml")) { copy("{$config->environment->coreDir}/src/etc/config.xml.sample", "{$config->globals->config_path}/config.xml"); } // gather php include paths and add to run command $include_paths = array(); foreach ($conf->application->contrib as $include) { if (is_dir($include)) { $include_paths[] = trim($include); } } if (PHP_OS == 'WINNT') { // include paths on windows differ $run_command[] = '-d include_path=".;' . implode(';', $include_paths) . '"'; } else { $run_command[] = '-d include_path=".:' . implode(':', $include_paths) . '"'; } $run_command[] = "-d open_basedir="; // listen to localhost $run_command[] = "-S localhost:8000"; // set document root $run_command[] = str_replace('//', '/', "-t {$config->environment->coreDir}/src/opnsense/www"); // .htaccess alternative routing copy(__DIR__ . '/public/.htrouter.php', "{$config->environment->coreDir}/src/opnsense/www/.htrouter.php"); $run_command[] = ".htrouter.php"; // set our working directory in the php environment in which the server runs putenv("DEV_WORKDIR=".__DIR__); // show executed command $cmd_action = implode(' ', $run_command) ; echo "{$cmd_action}\n"; chdir("{$config->environment->coreDir}/src/opnsense/www"); exec($cmd_action);