Versuchs mal damit. Ist zwar nicht schön, sollte seinen Zweck aber erfĂŒllen.Code:$bin = 'php'; if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') $bin = 'E:/xampp/php/php.exe'; define('DS', DIRECTORY_SEPARATOR); $oil_path = realpath(dirname(__FILE__).DS.'..'.DS.'..'.DS.'..'.DS).DS.'oil'; if($oil_path === FALSE) { return '$oil_path not found...'; } foreach($query->as_object()->execute() as $foo) { $output = shell_exec($bin.' '.$oil_path.' refine liebe foo='.$foo->id); \Cli::write($output); }
Realpath gibt false zurĂŒck, wenn er Probleme hat, den Pfad aufzulösen oder die Ordnerrechte nicht stimmen.
Weitere Info in der PHP Doku:
The running script must have executable permissions on all directories in the hierarchy, otherwise realpath() will return FALSE.




Zitieren