PHP exec() and spaces in paths
问题 I'm executing the following in a PHP application: $source = '/home/user/file.ext'; $output_dir = $this->setOutputString(); chdir('/home/ben/xc/phplib/bgwatcher-2011a/a01/'); exec('php bin/createjob.php $source $output_dir', $output); return $output[0]; The problem is this: I have control over $source , but not $output_dir , which is a legacy Windows filesystem, and there are spaces in the path. An example $output_dir is: /home/vol1/district id/store id/this_is_the_file.html When inserting the