valet-plus
valet-plus copied to clipboard
Could not find installation path for: apcu
- [x] I've checked the issue queue and could not find anything similar to my bug.
- [x] I'm on the latest version of valet-plus (
valet --version
):<Valet-Plus-Version>
- [x] I've run
valet fix
andvalet install
after updating and before submitting my issue/feature.
What is the problem?
Valet could not download and install pecl. I get the error below when i run valet install
. Any ideas on how i could fix this?
[php] Checking for errors within the php installation... [nginx] Stopping [[email protected]] Stopping [[email protected]] Stopping [[email protected]] Stopping [[email protected]] Stopping [redis] Stopping [devtools] Installing tools [devtools] wp-cli already installed [devtools] pv already installed [devtools] geoip already installed [devtools] zlib already installed [binaries] Installing binaries [BREW TAP] henkrehorst/php already installed [PECL] Updating PECL channel: pecl.php.net [PECL] Installing extensions
In Pecl.php line 146:
Could not find installation path for: apcu
Could not download from "https://pecl.php.net/get/apcu-5.1.17.tgz", cannot download "pecl/apcu" (Connection to `ssl://pecl.php. net:443' failed: ) Error: cannot download "pecl/apcu" Download failed install failed
Pecl issues are usually caused by an invalid openssl directory. Homebrew will install openssl into the following directory: /usr/local/etc/[email protected]
But PHP looks for it at the following location in all of its default configuration files in valet: /usr/local/etc/openssl
The solution to this is to create a symbolic link between the two using the following command:
ln -s /usr/local/etc/[email protected] /usr/local/etc/openssl
PLease add this solution to the installation checklist - fresh install mojave failed and this fixed it
@clnt Your solution worked perfectly, thank you!
@clnt Thank you! It worked very well in MacOS Catalina!
For macs with M1 chips the location is changed to /opt/homebrew/etc
to solve the above you need the following command:
ln -s /opt/homebrew/etc/[email protected] /opt/homebrew/etc/openssl
Confirming that @mmeester's solution from March works on M2 chips as well, but I did also need to follow the steps here: https://freek.dev/2151-fixing-the-dreaded-pcre2h-file-not-found-error-when-installing-imagick
In that article, the author uses this command:
brew install pcre2
ln -s /opt/homebrew/Cellar/pcre2/10.39/include/pcre2.h /opt/homebrew/Cellar/php/8.1.0_1/include/php/ext/pcre/pcre2.h
But this was written outside the context of Valet+, so the solution for me was:
ln -s /opt/homebrew/Cellar/pcre2/10.40/include/pcre2.h /opt/homebrew/Cellar/[email protected]/8.0.17/include/php/ext/pcre/pcre2.h
Note the php version in the last argument of that command—you'll want to update [email protected] to whatever version of valet-php you're using, as well as changing that 8.0.17 version to whatever you need. Hope that helps someone.