phpbrew icon indicating copy to clipboard operation
phpbrew copied to clipboard

Can't build on MacOSX via Macports installed PHP

Open GabeAtWork opened this issue 7 years ago • 5 comments

Output

Error: Configure failed:
The last 5 lines in the log file:
checking size of int... (cached) 4

checking size of long... (cached) 8

checking size of long long... (cached) 8

checking size of off_t... 0

configure: error: off_t undefined; check your library configuration

Expected Result

No error, I gess

Command

Paste your phpbrew install command here (be sure to install with --debug flag, e.g. phpbrew --debug install)

phpbrew --debug install 5.6 +default

Build Log

https://gist.github.com/GabeAtWork/3a13c04f786164ff75d6564bf2ceea61

Platform

OS: OS X 10.12.6

Installing PHP: 5.6, 7.1

GabeAtWork avatar Oct 26 '17 13:10 GabeAtWork

I had the same problem and I reinstall openssl before i run

phpbrew install 7.1.9 +default +fpm +pdo +mysql +sqlite +gd +openssl=/usr/local/opt/openssl -- --with-gd=shared --with-jpeg-dir=/usr/local/Cellar --with-png-dir=/usr/local/Cellar --enable-gd-native-ttf --with-freetype-dir=/usr/local/Cellar

reinstall openssl command line.

brew reinstall openssl

csi0n avatar Oct 30 '17 05:10 csi0n

Same problem here.

Platform: OSX 10.12.6

Wanted to install 7.1.11. Had the same error with other versions I tried too.

What I did to somehow understand what exactly failed I looked in the running processes while phpbrew was running and found the whole ./configure commmand:

./configure
'--cache-file=/Users/hauke/.phpbrew/cache/config.cache'
'--prefix=/Users/hauke/.phpbrew/php/php-7.1.11'
'--with-config-file-path=/Users/hauke/.phpbrew/php/php-7.1.11/etc'
'--with-config-file-scan-dir=/Users/hauke/.phpbrew/php/php-7.1.11/var/db'
'--disable-all' '--enable-phar'
'--enable-session'
'--enable-short-tags' 
'--enable-tokenizer' 
'--with-pcre-regex' 
'--with-zlib=/usr' 
'--enable-dom' 
'--enable-libxml'
'--enable-simplexml'
'--enable-xml'
'--enable-xmlreader'
'--enable-xmlwriter'
'--with-xsl'
'--with-libxml-dir=/usr/local/opt/libxml2' 
'--enable-opcache'
'--enable-bcmath'
'--with-bz2=/usr' 
'--enable-calendar'
'--enable-cli'
'--enable-ctype' 
'--enable-dom'
'--enable-fileinfo'
'--enable-filter' 
'--enable-shmop'
'--enable-sysvsem'
'--enable-sysvshm'
'--enable-sysvmsg' 
'--enable-json'
'--enable-mbregex' 
'--enable-mbstring' 
'--with-mhash=/usr/local' 
'--with-mcrypt=/usr/local'
'--enable-pcntl'
'--with-pcre-regex' 
'--with-pcre-dir=/usr/local'
'--enable-pdo'
'--with-pear=/Users/hauke/.phpbrew/php/php-7.1.11/lib/php/pear' 
'--enable-phar' 
'--enable-posix'
'--with-readline=/usr/local/opt/readline' 
'--enable-sockets' 
'--enable-tokenizer' 
'--with-curl=/usr' 
'--with-openssl=/usr/local/opt/openssl'
'--enable-zip'
'--enable-bcmath'
'--enable-calendar'
'--enable-mbstring'
'--enable-pcntl' 
'--enable-sockets' 
'--enable-zip' 
'--with-bz2=/usr/local/lib' 
'--with-mhash=/usr/local/lib' 
'--with-pcre-regex' 
'--with-libxml-dir=/usr/local/opt/libxml2' 
'--with-pdo-mysql'
'--with-readline=/usr/local/opt/readline'
'--with-curl' 
'--with-openssl=/usr/local/opt/openssl'
'--with-mysqli' 
'--with-mcrypt'
'--with-pear'

With this I tried a "divide & conquer" approach to find out which toggle was responsible for the configure: error: off_t undefined; check your library configuration error message.

The culprit is the zip extension contained in the +default variants.

I'm not sure why but building PHP with the zip extension seems to be a known problem for some users since I found a bug report on this: https://bugs.php.net/bug.php?id=68302

When I tried to compile PHP with phpbrew without the default variant but by specifying all contained variants but the zip extension it compiled.

phpbrew install php-7.1.11 +bcmath +bz2 +calendar +cli +ctype +dom +fileinfo +filter +ipc +json +mbregex +mbstring +mhash +mcrypt +pcntl +pcre +pdo +pear +phar +posix +readline +sockets +tokenizer +xml +curl +openssl

Partyschaum avatar Nov 10 '17 14:11 Partyschaum

Ok, short addendum before I finally go into my weekend...

I just thought maybe it's the new XCode 9 and installed XCode 8.3.3 again.

Look here how to work with multiple XCodes: https://medium.com/@hacknicity/working-with-multiple-versions-of-xcode-e331c01aa6bc

After switching back to XCode 8.3.3 everything is back to normal. I can compile PHP like a god now. ;-)

Partyschaum avatar Nov 10 '17 14:11 Partyschaum

me too

sdhou avatar Jan 03 '18 09:01 sdhou

ProductName:	Mac OS X
ProductVersion:	10.12.6

this probably solves issue #941 too. i was successful using this prefix:

LDFLAGS="-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/system"

reference: https://amedog.net/archives/438

gpedro avatar Jan 03 '18 23:01 gpedro

The solution is available on above reply. And the issue will be closed.

peter279k avatar Dec 02 '22 04:12 peter279k