Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure: error: Cannot find php_hash.h #1822

Closed
ykabps1314 opened this issue Aug 5, 2020 · 17 comments
Closed

configure: error: Cannot find php_hash.h #1822

ykabps1314 opened this issue Aug 5, 2020 · 17 comments

Comments

@ykabps1314
Copy link

ykabps1314 commented Aug 5, 2020

  • OS: MACOS 15.15
  • PHP: 7.3.11
  • phpredis: 5.3.1

issue:
checking for hash includes... configure: error: Cannot find php_hash.h

@michael-grunder
Copy link
Member

Hi, were you able to solve this problem?

It's hard to help diagnose the problem because I no longer have a Mac and I know building software on them can be problematic (SIP protections, etc).

The first thing I'd do is make sure you have php_hash.h in your include path. It seems like you should have it by default but I'm not certain on OSX.

@zhangyu-chuanmo
Copy link

I am having the same problem

@michael-grunder
Copy link
Member

My guess is the error is exactly what it says. Your system doesn't have php_hash.h or it's not somewhere configure can find it.

@RGaius
Copy link

RGaius commented Aug 26, 2020

me too

@michael-grunder
Copy link
Member

We aren't going to be able to help here without more information.

Like as a starter, confirmation from someone that they do indeed have the file php_hash.h

@RGaius
Copy link

RGaius commented Aug 27, 2020

  • OS: MACOS 15.15
  • PHP: 7.3.11
  • phpredis: 5.3.1

issue:
checking for hash includes... configure: error: Cannot find php_hash.h

Maybe you don't have an /usr/include folder. MACOS 15.15 remove it

@NewZeal
Copy link

NewZeal commented Sep 3, 2020

I'm having this problem and I do have php_hash.h, see attached. I tried installing earlier versions of phpredis and had a similar issue with php_json.h which appears in another ticket.

Maybe this is a similar bug and requires a similar solution as the other ticket.
Screenshot 2020-09-03 at 1 13 49 PM

@hanhuizhu
Copy link

anyone has resolve is ?

@hsleewis
Copy link

Same issue when trying to install phpredis on a MacBook Air with a M1 processor.

@simonhard
Copy link

simonhard commented Dec 18, 2020

Just install it manually. In my case (Apple M1), the correct phpize version was not found by pecl.

I've successfully built phpredis like that (replace your php-config path with yours)

tar zxvf redis-5.3.2.tgz
cd redis-5.3.2
phpize
./configure --with-php-config=/opt/homebrew/Cellar/php@7.4/7.4.13_1/bin/php-config --enable-redis-igbinary=no --enable-redis-lzf=no --enable-redis-zstd=no
make
make install

@hongbinhsu
Copy link

WARNING: PHP is not recommended
PHP is included in macOS for compatibility with legacy software.
Future versions of macOS will not include PHP.
PHP 7.3.24-(to be removed in future macOS) (cli) (built: Nov 23 2020 06:45:16) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.24, Copyright (c) 1998-2018 Zend Technologies

@SpiceX
Copy link

SpiceX commented Apr 4, 2021

Same problem here, has anyone found a solution? php_hash.h it's in the include path

@shizhifeng
Copy link

any idea for this problem plz.

@field-fd
Copy link

field-fd commented Apr 20, 2021

I hava solved the problem. my macos is big sur 11.2.3
just install another php version.
brew install php72
install success you will see
780F99F1-5001-425E-A7E7-8579DD8FC256
than you can install phpredis extension

enter phpredis catalog
$ /usr/local/opt/php@7.2/bin/phpize  # attention , this is the new PHP installed catalog  
$ ./configure --with-php-config=/usr/local/opt/php@7.2/bin/php-config 
$ make && make install

@gesof
Copy link

gesof commented May 21, 2021

Note: MacOS comes with its own php version that gets installed in /usr/bin/php while brew will put it in /usr/local/bin/php
Be sure you have the path containing "local" before the default one in the $PATH.
Also, maybe it is not obvious: after installing PHP with brew, open a new terminal to get the proper php version running.

@therohitdas
Copy link

I ran into the same issue while installing the extension on Pop!_OS 21.04
I was passing the php binary as -

./configure --with-php-config=/opt/lampp/bin/php

I fixed it by passing php-config

./configure --with-php-config=/opt/lampp/bin/php-config

I was installing the extension to my Xampp installation so the location was /opt/lampp/

@michael-grunder
Copy link
Member

Going to close this old issue. If people are still running into this issue I'm happy to help. I've now actually got an M1 mac running PhpRedis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests