--- a/ext/memcache/config9.m4	2017-06-15 09:24:26.966780303 +0000
+++ b/ext/memcache/config9.m4	2017-06-15 09:25:30.985784499 +0000
@@ -64,24 +64,19 @@
   fi
 
   AC_MSG_CHECKING(PHP version)
-  if test -d $abs_srcdir/src ; then
-    dnl # only when for PECL, not for PHP
-    export OLD_CPPFLAGS="$CPPFLAGS"
-    export CPPFLAGS="$CPPFLAGS $INCLUDES"
-    AC_TRY_COMPILE([#include <php_version.h>], [
+  export OLD_CPPFLAGS="$CPPFLAGS"
+  export CPPFLAGS="$CPPFLAGS $INCLUDES -I$srcdir/main"
+  AC_TRY_COMPILE([#include <php_version.h>], [
 #if PHP_MAJOR_VERSION < 7
   #error "PHP < 7"
 #endif
-    ], [
-      subdir=src
-      AC_MSG_RESULT([PHP 7.x])
-    ],
-      AC_MSG_ERROR([PHP 7.x required for pecl-php-memcache ver 4+. Use pecl-php-memcache ver 3.x for PHP 5.x.])
-    )
-    export CPPFLAGS="$OLD_CPPFLAGS"
-  else
-    AC_MSG_ERROR([unknown])
-  fi
+  ], [
+    subdir=src
+    AC_MSG_RESULT([PHP 7.x])
+  ],
+    AC_MSG_ERROR([PHP 7.x required for pecl-php-memcache ver 4+. Use pecl-php-memcache ver 3.x for PHP 5.x.])
+  )
+  export CPPFLAGS="$OLD_CPPFLAGS"
  
   if test "$PHP_MEMCACHE_SESSION" != "no"; then 
        AC_MSG_CHECKING([for session includes])
--- a/ext/memcache/src/memcache_session.c	2017-06-15 10:08:37.929829362 +0000
+++ b/ext/memcache/src/memcache_session.c	2017-06-15 10:08:45.933829302 +0000
@@ -31,7 +31,7 @@
 #include "SAPI.h"
 #include "ext/standard/php_smart_string.h"
 #include "ext/standard/url.h"
-#include "session/php_session.h"
+#include "ext/session/php_session.h"
 #ifdef PHP_WIN32
 #include "win32/time.h"
 #endif