'binaries' . $DS . 'libwebp-1.2.4-windows-x64' . $DS . 'bin' . $DS . 'cwebp', 'Linux' => 'binaries' . $DS . 'libwebp-1.2.4-linux-x86-64' . $DS . 'bin' . $DS .'cwebp', 'Darwin' => [ 'X86-64' => 'binaries' . $DS . 'libwebp-1.2.4-mac-X86-64' . $DS . 'bin' . $DS . 'cwebp', 'arm64' => 'binaries' . $DS . 'libwebp-1.2.4-mac-arm64' . $DS . 'bin' . $DS .'cwebp', ], ]; $server_operating_system = explode(' ', trim(php_uname()))[0]; $server_processor_architecture = trim(php_uname('m')); if($server_operating_system === 'Windows'){ $this->error('Windows OS are not permitted'); return; } if ($server_operating_system === 'Darwin') { $webp_binary_path = resource_path($cwebp_compilers['Darwin'][$server_processor_architecture]); } if ($server_operating_system === 'Linux') { $webp_binary_path = resource_path($cwebp_compilers[$server_operating_system]); } exec('chmod +x ' . $webp_binary_path, $output, $result); $this->info('Webp binaries are now executables'); } }