As i said it's your problem and this script useless. In your case you tried to fix all limitation of plans for virtual hosting. Ans as i said before, the PHP Info enough for check compatibility between installed PDO driver version and your target database because all plans uses universal own stable versions of PHP and don't cares about correct configure not declared features in hosting plan. And you are lucky man if it's works now, cause the hosting company could just block all ports on the stage for prepare software for providing virtual services.
I always thinked before (around 15 years) what this is a well-known fact, but no. Exists people who believe what they can trick the hosting sellers. First of all, need to read fully description of hosting plans before payment. Otherwise you will always wasting own time for nothing and after will talk about your bad experience based on fatal mistakes on selection hosting stage. But it will hidden and published as hosting company problem.
Have a nice day!