I'm working with Netbeans 8.0.2 on Mac. I have problems with exec statements. Within netbeans it seems it can't find commands that are available in terminal.
For example I have this execute statement:
exec('mongorestore --host='.$this->host.' -d '.$this->db_name.' --dir '.$this->schemaPath);
If I run:php restore.php
from terminal it runs without incident and imports the data. However if I run/debug/unittest from within netbeans output window shows:
sh: mongorestore: command not found
Other commands like mysqldump also have this issue. How can I make sure these command work from within Netbeans?
To be clear, I can run these commands in the terminal in netbeans, the problem only occurs if I run/debug/unittest a php file.
UPDATE: Running some more test I find that the path variable is different for Netbeans.
terminal: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
netbeans: /usr/bin:/bin:/usr/sbin:/sbin