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