Inkscape inside PHP/Apache doesn't render fonts to PNG Inkscape inside PHP/Apache doesn't render fonts to PNG apache apache

Inkscape inside PHP/Apache doesn't render fonts to PNG


As was determined in the comments above, this was caused by an environmental difference - the HOME env var was set differently inside the executed process. Using proc_open instead of simple exec gave more precise control over said process and explicitly setting that env var solved the issue.


For the record, here's the usage of proc_open that helped fix this issue:

$command = "{$exec} --without-gui {$params} {$file} {$redirect}";$return = -1;// Comment this out for now//exec($command, self::$output, $return);$descriptorspec = array(    0 => array("pipe", "r"),    1 => array("pipe", "w"),    2 => array("file", "/dev/null", "a"));$pipes = array();$env = array(    // Try additional stuff here, but culprit was:    'HOME' => '/Users/jon',);$resource = proc_open(    $command,    $descriptorspec,    $pipes,    $cwd = null,    $env);