这是来自 Application.cpp 的一些代码(从http://www.suphp.org/Download.html下载)
UserInfo directoryOwner = directory.getUser();
if (directoryOwner != owner && !directoryOwner.isSuperUser()) {
std::string error = "Directory " + directory.getPath()
+ " is not owned by " + owner.getUsername();
logger.logWarning(error);
throw SoftException(error, __FILE__, __LINE__);
}
看起来如果您让所有者成为超级用户(root 可能是最简单的),错误可能会消失。
冒着说明显而易见的风险,命令将是这样的
$sudo chown root /home/myuser/public_html
编辑以在评论中添加与问题相关的更多代码
try {
// Change working directory to script path
API_Helper::getSystemAPI().setCwd(
File(scriptFilename).getParentDirectory().getPath());
if (mode == TARGETMODE_PHP) {
std::string interpreterPath = interpreter.substr(4);
CommandLine cline;
cline.putArgument(interpreterPath);
API_Helper::getSystemAPI().execute(interpreterPath, cline, env);
} else if (mode == TARGETMODE_SELFEXECUTE) {
CommandLine cline;
cline.putArgument(scriptFilename);
API_Helper::getSystemAPI().execute(scriptFilename, cline, env);
}
} catch (SystemException& e) {
throw SoftException("Could not execute script \"" + scriptFilename
+ "\"", e, __FILE__, __LINE__);
}