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

can't install successful on macOS Catalina with phpize #1654

Open
pagemarks opened this issue Oct 15, 2019 · 5 comments
Open

can't install successful on macOS Catalina with phpize #1654

pagemarks opened this issue Oct 15, 2019 · 5 comments

Comments

@pagemarks
Copy link

@pagemarks pagemarks commented Oct 15, 2019

The PHP version upgrade to 7.3.8 when i upgrade macOS to Catalina, so i need to rebuild php redis extension. when i build it with phpize,output:

TraveldeMacBook-Pro:redis-5.0.2 travel$ sudo phpize
Password:
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: 

I search on web, find the macOS Catalina can't use /usr/include anymore. when I create folder include in dir /usr/, it output Read-only File System.

how can I install redis.so on macOS Catalina?

I installed XcommandLineTools with xcode-select --install.

@michael-grunder

This comment has been minimized.

Copy link
Member

@michael-grunder michael-grunder commented Oct 15, 2019

I have a Mac but I'm not running Catalina so I can't try this out myself.

Perhaps this Superuser question can help? It sure looks related.

@pagemarks

This comment has been minimized.

Copy link
Author

@pagemarks pagemarks commented Oct 15, 2019

I have a Mac but I'm not running Catalina so I can't try this out myself.

Perhaps this Superuser question can help? It sure looks related.

sudo can't fix it.

@michael-grunder

This comment has been minimized.

Copy link
Member

@michael-grunder michael-grunder commented Oct 15, 2019

No I mean this answer on Superuser.com might be what you need:
https://superuser.com/questions/1487126/php-7-3-8-zip-extension-on-macos-catalina-10-15

INCLUDE_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include

make CPPFLAGS="-I${INCLUDE_PATH}/php -I${INCLUDE_PATH}/php/main -I${INCLUDE_PATH}/php/TSRM -I${INCLUDE_PATH}/php/Zend -I${INCLUDE_PATH}/php/ext -I${INCLUDE_PATH}/php/ext/date/lib"
@pagemarks pagemarks changed the title can't install successfull on macOS Catalina with phpize can't install successful on macOS Catalina with phpize Oct 15, 2019
@pagemarks

This comment has been minimized.

Copy link
Author

@pagemarks pagemarks commented Oct 16, 2019

No I mean this answer on Superuser.com might be what you need:
https://superuser.com/questions/1487126/php-7-3-8-zip-extension-on-macos-catalina-10-15

INCLUDE_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include

make CPPFLAGS="-I${INCLUDE_PATH}/php -I${INCLUDE_PATH}/php/main -I${INCLUDE_PATH}/php/TSRM -I${INCLUDE_PATH}/php/Zend -I${INCLUDE_PATH}/php/ext -I${INCLUDE_PATH}/php/ext/date/lib"

Thank you very much.
modify phpize(bash) codes includedir="eval echo ${prefix}/local/include/php" can fix phpize.But ./configure show errors, it's the same problem with the php lib path.

@pagemarks

This comment has been minimized.

Copy link
Author

@pagemarks pagemarks commented Oct 17, 2019

Here is my solution:
copy php lib header files to /usr/local/php

cp  /usr/bin/phpize /usr/local/phpize
cp /usr/bin/php-config /usr/local/php-config

# modify the phpize file line 8 to includedir="`eval echo ${prefix}/local/include`/php" (local)
# modify the php-config file line 9 to include_dir="${prefix}/local/include/php"
# change dir to your phpredis source folder
phpize
./configure --with-php-config=/usr/local/php-config
make
# I get the redis.so file in ./modules/, but terminal output error info when i run make install
# It's the same problem about 'Read-only file system' when i copy redis.so to the extension lib folder
# macOS Catalina locked the '/usr/lib' write permission, the folder is readonly
# and can't use  chmod coomand to change with sudo.
# at last, I change the extension_dir config in php.ini.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.