Guys, I had the same issue and found out which was the cause. On PrestaShop install (v.1.7.6.7 in my case) there was only the /override/classes directory.
So, it was trying to copy a file to a directory that does not exist (/override/classes/order).
My fix:
public function install()
{
$order_override_directory = _PS_OVERRIDE_DIR_ . 'classes/order';
if (!is_dir($order_override_directory)) {
mkdir($order_override_directory, 0755, true);
copy(_PS_MODULE_DIR_ . $this->name . '/index.php', $order_override_directory . '/index.php');
}
return parent::install();
}
Regards ✌🇬🇷🛠🇳🇱