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