diff --git a/src/php/ext/grpc/call.c b/src/php/ext/grpc/call.c
index df0635dc7272561fa6cec0e14c2279cfb0681eb5..798747109a1b21c486a0f374db6e977ae9f22524 100644
--- a/src/php/ext/grpc/call.c
+++ b/src/php/ext/grpc/call.c
@@ -56,6 +56,8 @@
 #include "completion_queue.h"
 #include "byte_buffer.h"
 
+zend_class_entry *grpc_ce_call;
+
 /* Frees and destroys an instance of wrapped_grpc_call */
 void free_wrapped_grpc_call(void *object TSRMLS_DC) {
   wrapped_grpc_call *call = (wrapped_grpc_call *)object;
diff --git a/src/php/ext/grpc/call.h b/src/php/ext/grpc/call.h
index 827e9a27a874c9e173d733110718546538634a4b..bce5d82974f37306fd043c6c3304099c5da535e8 100644
--- a/src/php/ext/grpc/call.h
+++ b/src/php/ext/grpc/call.h
@@ -57,7 +57,7 @@
   } while (0)
 
 /* Class entry for the Call PHP class */
-zend_class_entry *grpc_ce_call;
+extern zend_class_entry *grpc_ce_call;
 
 /* Wrapper struct for grpc_call that can be associated with a PHP object */
 typedef struct wrapped_grpc_call {
diff --git a/src/php/ext/grpc/channel.c b/src/php/ext/grpc/channel.c
index d6296f94130ee35bf7274d17557197a025f95260..5e99332fab81a04fe309db1ad395dbd9ba63d3aa 100644
--- a/src/php/ext/grpc/channel.c
+++ b/src/php/ext/grpc/channel.c
@@ -55,6 +55,8 @@
 #include "server.h"
 #include "credentials.h"
 
+zend_class_entry *grpc_ce_channel;
+
 /* Frees and destroys an instance of wrapped_grpc_channel */
 void free_wrapped_grpc_channel(void *object TSRMLS_DC) {
   wrapped_grpc_channel *channel = (wrapped_grpc_channel *)object;
diff --git a/src/php/ext/grpc/channel.h b/src/php/ext/grpc/channel.h
index f426a25cafcbfa70ce4f9bb0f479f1e19dbda226..2c79668a4d8599bb43b9a84dafe6d9e684dd9e27 100755
--- a/src/php/ext/grpc/channel.h
+++ b/src/php/ext/grpc/channel.h
@@ -46,7 +46,7 @@
 #include "grpc/grpc.h"
 
 /* Class entry for the PHP Channel class */
-zend_class_entry *grpc_ce_channel;
+extern zend_class_entry *grpc_ce_channel;
 
 /* Wrapper struct for grpc_channel that can be associated with a PHP object */
 typedef struct wrapped_grpc_channel {
diff --git a/src/php/ext/grpc/completion_queue.c b/src/php/ext/grpc/completion_queue.c
index 30c871b078319d68d9e31f9cb96ebff4d86dc62a..93abf5df36bff2b7da199fdc9b964ff5fff27daf 100644
--- a/src/php/ext/grpc/completion_queue.c
+++ b/src/php/ext/grpc/completion_queue.c
@@ -52,6 +52,8 @@
 #include "event.h"
 #include "timeval.h"
 
+zend_class_entry *grpc_ce_completion_queue;
+
 /* Frees and destroys a wrapped instance of grpc_completion_queue */
 void free_wrapped_grpc_completion_queue(void *object TSRMLS_DC) {
   wrapped_grpc_completion_queue *queue = NULL;
diff --git a/src/php/ext/grpc/completion_queue.h b/src/php/ext/grpc/completion_queue.h
index 6ce1df7c8cddfc2e309d1e015a0b8a3da81def7f..1d386cc58f4a9fa8356dbe5b270d1718bc8b6da4 100755
--- a/src/php/ext/grpc/completion_queue.h
+++ b/src/php/ext/grpc/completion_queue.h
@@ -46,7 +46,7 @@
 #include "grpc/grpc.h"
 
 /* Class entry for the PHP CompletionQueue class */
-zend_class_entry *grpc_ce_completion_queue;
+extern zend_class_entry *grpc_ce_completion_queue;
 
 /* Wrapper class for grpc_completion_queue that can be associated with a
    PHP object */
diff --git a/src/php/ext/grpc/credentials.c b/src/php/ext/grpc/credentials.c
index 6d8f59fa33dc6435848ecc28906c85aa2fc9a593..a94b0eac2d30d0bdda13d1b7c0e7d54b136d4207 100644
--- a/src/php/ext/grpc/credentials.c
+++ b/src/php/ext/grpc/credentials.c
@@ -49,6 +49,8 @@
 #include "grpc/grpc.h"
 #include "grpc/grpc_security.h"
 
+zend_class_entry *grpc_ce_credentials;
+
 /* Frees and destroys an instance of wrapped_grpc_credentials */
 void free_wrapped_grpc_credentials(void *object TSRMLS_DC) {
   wrapped_grpc_credentials *creds = (wrapped_grpc_credentials *)object;
diff --git a/src/php/ext/grpc/credentials.h b/src/php/ext/grpc/credentials.h
index 3ff75af9dbe51caf0981f0e416e20e4492a1260e..86d7ae5b144c983726a861674bbb7a0414f00e31 100755
--- a/src/php/ext/grpc/credentials.h
+++ b/src/php/ext/grpc/credentials.h
@@ -47,7 +47,7 @@
 #include "grpc/grpc_security.h"
 
 /* Class entry for the Credentials PHP class */
-zend_class_entry *grpc_ce_credentials;
+extern zend_class_entry *grpc_ce_credentials;
 
 /* Wrapper struct for grpc_credentials that can be associated with a PHP
  * object */
diff --git a/src/php/ext/grpc/server.c b/src/php/ext/grpc/server.c
index 00d08c6ecf0976d1c336e33bc86145e8a137f1ee..a5cfd952871798c0281f7767d00a624ca10ed6f4 100644
--- a/src/php/ext/grpc/server.c
+++ b/src/php/ext/grpc/server.c
@@ -56,6 +56,8 @@
 #include "channel.h"
 #include "server_credentials.h"
 
+zend_class_entry *grpc_ce_server;
+
 /* Frees and destroys an instance of wrapped_grpc_server */
 void free_wrapped_grpc_server(void *object TSRMLS_DC) {
   wrapped_grpc_server *server = (wrapped_grpc_server *)object;
diff --git a/src/php/ext/grpc/server.h b/src/php/ext/grpc/server.h
index ecef4c642998b094a37f86261da7fc8cdcdebac9..b55689c5816b3683cefe715626e614e2b477d08b 100755
--- a/src/php/ext/grpc/server.h
+++ b/src/php/ext/grpc/server.h
@@ -46,7 +46,7 @@
 #include "grpc/grpc.h"
 
 /* Class entry for the Server PHP class */
-zend_class_entry *grpc_ce_server;
+extern zend_class_entry *grpc_ce_server;
 
 /* Wrapper struct for grpc_server that can be associated with a PHP object */
 typedef struct wrapped_grpc_server {
diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c
index 8aaa86ce947ed51bcb4b00efb317f4dd69bc076c..df64e6598692d207a5f9e36b344e5d81742b6d71 100644
--- a/src/php/ext/grpc/server_credentials.c
+++ b/src/php/ext/grpc/server_credentials.c
@@ -49,6 +49,8 @@
 #include "grpc/grpc.h"
 #include "grpc/grpc_security.h"
 
+zend_class_entry *grpc_ce_server_credentials;
+
 /* Frees and destroys an instace of wrapped_grpc_server_credentials */
 void free_wrapped_grpc_server_credentials(void *object TSRMLS_DC) {
   wrapped_grpc_server_credentials *creds =
diff --git a/src/php/ext/grpc/server_credentials.h b/src/php/ext/grpc/server_credentials.h
index ce2a4da138c73f16447daff48b045b9409bdc8fe..8ed36971506d7fb5a18eeab39213ab506bc35240 100755
--- a/src/php/ext/grpc/server_credentials.h
+++ b/src/php/ext/grpc/server_credentials.h
@@ -47,7 +47,7 @@
 #include "grpc/grpc_security.h"
 
 /* Class entry for the Server_Credentials PHP class */
-zend_class_entry *grpc_ce_server_credentials;
+extern zend_class_entry *grpc_ce_server_credentials;
 
 /* Wrapper struct for grpc_server_credentials that can be associated with a PHP
  * object */
diff --git a/src/php/ext/grpc/timeval.c b/src/php/ext/grpc/timeval.c
index 5b0142cbe47d43218d75ed9292e03e334a0f7c09..f90f0062baba22e7f765d30104928c566beef5cb 100644
--- a/src/php/ext/grpc/timeval.c
+++ b/src/php/ext/grpc/timeval.c
@@ -50,6 +50,8 @@
 #include "grpc/grpc.h"
 #include "grpc/support/time.h"
 
+zend_class_entry *grpc_ce_timeval;
+
 /* Frees and destroys an instance of wrapped_grpc_call */
 void free_wrapped_grpc_timeval(void *object TSRMLS_DC) { efree(object); }
 
diff --git a/src/php/ext/grpc/timeval.h b/src/php/ext/grpc/timeval.h
index 0e215fc88480b07c0b3eaf0055712d7cbf47fb8c..e3183f691dbd34c7c587ff439638158842ea129d 100755
--- a/src/php/ext/grpc/timeval.h
+++ b/src/php/ext/grpc/timeval.h
@@ -47,7 +47,7 @@
 #include "grpc/support/time.h"
 
 /* Class entry for the Timeval PHP Class */
-zend_class_entry *grpc_ce_timeval;
+extern zend_class_entry *grpc_ce_timeval;
 
 /* Wrapper struct for timeval that can be associated with a PHP object */
 typedef struct wrapped_grpc_timeval {