diff --git a/src/php/lib/Grpc/BaseStub.php b/src/php/lib/Grpc/BaseStub.php index e92990f1a8b..7669ba74338 100644 --- a/src/php/lib/Grpc/BaseStub.php +++ b/src/php/lib/Grpc/BaseStub.php @@ -43,7 +43,8 @@ class BaseStub */ public function __construct($hostname, $opts, $channel = null) { - if (!ChannelCredentials::isDefaultRootsPemSet()) { + if (!method_exists('ChannelCredentials', 'isDefaultRootsPemSet') || + !ChannelCredentials::isDefaultRootsPemSet()) { $ssl_roots = file_get_contents( dirname(__FILE__).'/../../../../etc/roots.pem' );