44cc0a
diff -up ./scripts/phpize.in.headers ./scripts/phpize.in
44cc0a
--- ./scripts/phpize.in.headers	2019-07-23 10:05:11.000000000 +0200
44cc0a
+++ ./scripts/phpize.in	2019-07-23 10:18:13.648098089 +0200
44cc0a
@@ -165,6 +165,15 @@ phpize_autotools()
44cc0a
   $PHP_AUTOHEADER || exit 1
44cc0a
 }
44cc0a
 
44cc0a
+phpize_check_headers()
44cc0a
+{
44cc0a
+  if test ! -f $includedir/main/php.h; then
44cc0a
+    echo "Can't find PHP headers in $includedir"
44cc0a
+    echo "The php-devel package is required for use of this command."
44cc0a
+    exit 1
44cc0a
+  fi
44cc0a
+}
44cc0a
+
44cc0a
 # Main script
44cc0a
 
44cc0a
 case "$1" in
44cc0a
@@ -183,12 +192,15 @@ case "$1" in
44cc0a
 
44cc0a
   # Version
44cc0a
   --version|-v)
44cc0a
+    phpize_check_headers
44cc0a
     phpize_print_api_numbers
44cc0a
     exit 0
44cc0a
   ;;
44cc0a
 
44cc0a
   # Default
44cc0a
   *)
44cc0a
+     phpize_check_headers
44cc0a
+
44cc0a
      phpize_check_configm4 0
44cc0a
 
44cc0a
      phpize_check_build_files