在PHP 7中使用--with-ldap会在Mac 10.13上导致错误“无法找到php_pdo_driver.h”

I am able to compile PHP 7.2.5 on my Mac 10.13.4, but when I add --with-ldap I get the following error during compilation:

checking for PDO includes... checking for PDO includes... ./configure: line 65719: test: too many arguments ./configure: line 65721: test: too many arguments

configure: error: Cannot find php_pdo_driver.h.

Here is my complete configure command: ./configure --prefix=/usr/local/php7 --with-apxs2=/usr/local/apache-2.4.33/bin/apxs --enable-exif --with-mysqli --with-curl --enable-ftp --with-gd --enable-mbstring --with-openssl=/usr/local/openssl --enable-sockets --with-zlib --with-ldap

I have tried using --with-ldap=/usr and --with-ldap-sasl, but the error was the same.

I am trying to get WordPress running locally. I got it running without LDAP, but now I want to use Active Directory credentials and the plugin I chose (https://wordpress.org/plugins/ldap-login-for-intranet-sites/) informs me that PHP is missing LDAP...

I had deleted the PHP source folder and re-created it. I thought Terminal was using the new PHP source folder but it was not. Now the compile worked as expected and I can now configure the WP AD plugin!