Valet-plus: Can't install on Mac 10.14 (Mojave) - Could not find installation path for: apcu_bc

Created on 12 Dec 2018  路  12Comments  路  Source: weprovide/valet-plus

On both a VM and a real machine, fresh installs of 10.14, during [PECL] Installing extensions the make command for apcu_bc fails with Could not find installation path for: apcu_bc ... error: conflicting types for 'apc_sma_init'

Following comments in other tickets, running pecl install apcu-5.1.14 completes, and I can then run pecl install apcu_bc which completes.

valet install then fails with:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/pecl/20160303/apc.so' - dlopen(/usr/local/lib/php/pecl/20160303/apc.so, 9): Symbol not found: _zif_apcu_add
  Referenced from: /usr/local/lib/php/pecl/20160303/apc.so
  Expected in: flat namespace
 in /usr/local/lib/php/pecl/20160303/apc.so in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/pecl/20160303/apc.so' - dlopen(/usr/local/lib/php/pecl/20160303/apc.so, 9): Symbol not found: _zif_apcu_add
  Referenced from: /usr/local/lib/php/pecl/20160303/apc.so
  Expected in: flat namespace
 in /usr/local/lib/php/pecl/20160303/apc.so in Unknown on line 0
PHP Parse error:  syntax error, unexpected '' - dlopen(/usr/local/lib/php/' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ')' in Command line code on line 6
Password:
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/pecl/20160303/apc.so' - dlopen(/usr/local/lib/php/pecl/20160303/apc.so, 9): Symbol not found: _zif_apcu_add
  Referenced from: /usr/local/lib/php/pecl/20160303/apc.so
  Expected in: flat namespace
 in /usr/local/lib/php/pecl/20160303/apc.so in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/pecl/20160303/apc.so' - dlopen(/usr/local/lib/php/pecl/20160303/apc.so, 9): Symbol not found: _zif_apcu_add
  Referenced from: /usr/local/lib/php/pecl/20160303/apc.so
  Expected in: flat namespace
 in /usr/local/lib/php/pecl/20160303/apc.so in Unknown on line 0
PHP Parse error:  syntax error, unexpected '' - dlopen(/usr/local/lib/php/' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ')' in Command line code on line 6
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/pecl/20160303/apc.so' - dlopen(/usr/local/lib/php/pecl/20160303/apc.so, 9): Symbol not found: _zif_apcu_add
  Referenced from: /usr/local/lib/php/pecl/20160303/apc.so
  Expected in: flat namespace
 in /usr/local/lib/php/pecl/20160303/apc.so in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/pecl/20160303/apc.so' - dlopen(/usr/local/lib/php/pecl/20160303/apc.so, 9): Symbol not found: _zif_apcu_add
  Referenced from: /usr/local/lib/php/pecl/20160303/apc.so
  Expected in: flat namespace
 in /usr/local/lib/php/pecl/20160303/apc.so in Unknown on line 0
Could not open input file: 
Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/pecl/20160303/apc.so' - dlopen(/usr/local/lib/php/pecl/20160303/apc.so, 9): Symbol not found: _zif_apcu_add
  Referenced from: /usr/local/lib/php/pecl/20160303/apc.so
  Expected in: flat namespace
 in /usr/local/lib/php/pecl/20160303/apc.so in Unknown on line 0

Parse error: syntax error, unexpected '' - dlopen(/usr/local/lib/php/' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ')' in Command line code on line 6/cli/valet.php

php -v gives the correct (brew) version of 7.1.25, and my $PTH includes both /usr/local/opt/[email protected]/sbin and /usr/local/opt/[email protected]/bin

It all worked fine under 10.13, and upgraded machines are fine (at the moment).

Has anyone else seen this or know a fix?

Most helpful comment

I recently had this issue and the only thing that helped was to reinstall pecl manually without the sudo command as below

curl -O https://pear.php.net/go-pear.phar
php -d detect_unicode=0 go-pear.phar

also had to edit

/usr/local/opt/[email protected]/bin/pecl

by adding the -n to the last line like below

exec $PHP -C -n -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d safe_mode=0 -d register_argc_argv="On" $INCDIR/peclcmd.php "$@"

All 12 comments

I managed to get past this - by editing /usr/local/etc/php/7.1/php.ini and making sure that extension="apcu.so" was before extension="apc.so". Re-running install after that completed ok.

But this seems a cludge. Can anyone with some experience confirm if I'm doing something wrong? Or can I provide any further debugging info to help track down the cause?

Digging a bit more, this can be fixed in plus:

An installation then runs successfully.

thanks your tip helped me get back up

I commented in the PHP 7.3 PR on this issue.

tl;dr apcu's CI doesn't run tests for macOS and it fails compilation. They pushed a fix but it hasn't been versioned and pushed to PECL.

Using PHP 7.3 (if it matters), I was able to manually install the fix in apcu v5.1.16 and it builds correctly. Then apcu_bc builds correctly too.

pecl uninstall -r apcu
pecl uninstall -r apcu_bc
pecl install apcu-5.1.16
pecl install apcu_br

I had to do those uninstall commands first because no extensions were physically installed in the PHP 7.3 extensions_dir (/usr/local/lib/php/pecl/20180731), even though valet-plus and pecl were happy that they were installed.

Unfortunately geoip does not build, nor xdebug, though that may be something else on my system. I had to comment out geoip.so and xdebug.so from my php.ini because PHP 7.3 told me they weren't found, on every run.

@robrecord the fix for apcu has since been pushed to PECL.

Closing this issue since it has been fixed in PECL.

I recently had this issue and the only thing that helped was to reinstall pecl manually without the sudo command as below

curl -O https://pear.php.net/go-pear.phar
php -d detect_unicode=0 go-pear.phar

also had to edit

/usr/local/opt/[email protected]/bin/pecl

by adding the -n to the last line like below

exec $PHP -C -n -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d safe_mode=0 -d register_argc_argv="On" $INCDIR/peclcmd.php "$@"

@emirpprime solution didn't work for me. I got it working by disabling APCU_BC_EXTENSION by adding '7.1' => false, to here https://github.com/weprovide/valet-plus/blob/master/cli/Valet/Pecl.php#L51

Here is the screenshot for the change - https://prnt.sc/qpi5nf

@emirpprime solution didn't work for me. I got it working by disabling APCU_BC_EXTENSION by adding '7.1' => false, to here https://github.com/weprovide/valet-plus/blob/master/cli/Valet/Pecl.php#L51

Here is the screenshot for the change - https://prnt.sc/qpi5nf

Where can I edit this file on my Mac?

@basduchambre it depends on your config, but it's probably ~/.composer/vendor/weprovide/valet-plus/cli/Valet/Pecl.php

@emirpprime @basduchambre I would recommend to just upgrade to 2.0.0 ;).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

capitaladot picture capitaladot  路  24Comments

guarinogabriel picture guarinogabriel  路  15Comments

jahvi picture jahvi  路  24Comments

mike-hendriks picture mike-hendriks  路  25Comments

farmaworld picture farmaworld  路  18Comments