3

I am attempting to add the ZeroMQ extension's PHP functionality to my local server. I have successfully installed it however binding it to the PHP of my system has been a challenge.

I've attempted both the PEAR/PECL and Github building methods however they all come down to this CLI Error:

In file included from /private/tmp/pear/install/zmq/zmq.c:31:
/private/tmp/pear/install/zmq/php_zmq.h:45:10: fatal error: 'php.h' file not found
#include "php.h"
         ^~~~~~~
1 error generated.
make: *** [zmq.lo] Error 1
ERROR: `make' failed

where can I generate and include this php.h file?

php-v shows: PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS )

phpize -v shows: grep: /usr/include/php/main/php.h: No such file or directory grep: /usr/include/php/Zend/zend_modules.h: No such file or directory grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory Configuring for: PHP Api Version:
Zend Module Api No:
Zend Extension Api No:

user3666197
  • 1
  • 6
  • 50
  • 92
Jared Garcia
  • 751
  • 1
  • 8
  • 17

1 Answers1

1

I ran into this when installing zmq on MacOS 10.14.3 Mojave. I'd done the followings and it's fixed.

  1. install the command line tools if you haven't done so.

    xcode-select --install

  2. install the header files

    cd /Library/Developer/CommandLineTools/Packages/ open macOS_SDK_headers_for_macOS_10.14.pkg

Credit to @Steven Installing xdebug on MacOs Mojave - 'php.h' file not found

neokidd
  • 11
  • 1