如果我在终端(MAC OSX)中运行它,我有一个完美运行的 shell 脚本
#!/bin/bash
cd /Applications/XAMPP/xamppfiles/htdocs/chemedit/
babel -imol 'a.mol' -oinchi 'outputfile.inchi'
babel -imol 'a.mol' -osmi 'a.smsi'
babel a.smi -O out.svg -xC -xe
exit
我在一个名为 a.sh 的文件中有这个
我想从 PHP 运行它:
$output = shell_exec("bash a.sh 2>&1");
这不起作用并返回:
Cannot write to outputfile.inchi
0 molecules converted
1 errors
对于所有文件
我已经给了两个文件 chmod 777。
我很确定 PHP 的安全模式已关闭。