When this script is working as part of your website, maybe you are using different version of PHP (which is configured with different list of extensions)?
Please also check if you need this extension (php_pdo_oci.dll):
php_pdo_oci.dll is interface for Oracle database and it requires that you have Oracle interface DLLs installed on your server as well. (They are not part of PHP package, they are distributed separately by Oracle).
So if you don't really need php_pdo_oci.dll, you should disable it.