Fixed CLI PHP errors when using frontend scripts