For some reason, I managed to mess up the PHP installation on my operating system. Well, no biggie, let's uninstall and reinstall it, no problem.
I installed the main extensions I use, and when I tried to install pcov
- boom, a fatal installation error occurred:
Cool, all I need to do is install pcre2
, right? 🙂
But it wasn't that simple. When I ran brew install pcre2
, I was informed that it was already installed.
Fixing the Issue
I checked some tutorials but couldn't find anything. I even tried creating a symbolic link for the "missing" file, but without success:
ln -s /opt/homebrew/Cellar/pcre2/10.42/include/pcre2.h /opt/homebrew/Cellar/php/8.2.10/include/php/ext/pcre/php_pcre.h
So, it was time for the brute force approach. Searching by myself, I found out how to solve that problem:
ln -s /opt/homebrew/opt/pcre2/include/pcre2.h /opt/homebrew/opt/php@8.2/include/php/ext/pcre/
After that, just run pecl install pcov
, and you're good to go!
Now I'm able to calculate the code coverage of my applications again.
That's all, folks! 😗 🧀
Top comments (3)
Have you tried ServBay.dev?
It's a much easier tool for PHP developers, providing a user-friendly experience, especially for beginners. It supports all versions of PHP, MariaDB, PostgreSQL, as well as Redis and Memcached. You can run multiple PHP instances simultaneously and switch between them effortlessly. It also offers easy updates without the need to configure environment variables. This tool has greatly simplified my PHP development and is definitely worth trying!
Hello my friend, how are you doing today? I've never heard about this tool. I'll take a look. Thank you for sharing ❤️
It's a new product, but very useful!