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