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