I'm on Mac OS X 10 Yosemite, so I'm wondering if others experience the same problem. This code gives you an insight into the problem. Make an index.php file, and this inside:
<?php
$exec = "diskutil list";
echo $exec;
$output = shell_exec($exec);
echo $output;
This is when using the built-in Apache + PHP version. When using XAMPP or Nightrain, it has no problem running the command above. So I'm wondering if the Apache or PHP version of OSX blocks certain shell_exec commands?
My experience so far:
When I type in the command-line the following command:
diskutil info /dev/disk1s1
I get a full overview of the disk information.
But when I use shell_exec()
to execute the same command in PHP on OSX I get an error:
Could not find disk: /dev/disk1s1
Apache is configured to use the same ownership as my user (User:staff) - and all other commands work.
Also when I use the following command in the command-line:
diskutil list
I get a full overview. But then again shell_exec()
is not returning anything, and in the Apache error log I see:
Could not start up a DiskManagement session
I Googled and found zero results.