I think I am a decent PHP programmer, but I am lost when it comes to devops, C,
Makefiles and compiling stuff. I just want to write brew upgrade php and
be happy. If that doesn’t work I have to google each small step to fix the issue.
I love writing bash for example, but I need to google the syntax of an if-statement
for every bash script I write.
The RC for PHP 7.4.2 just came out this week. I decided to test it out. I downloaded
the release from the website http://qa.php.net/, unzipped them. I carefully followed
some guide saying:
If course I ran in to issues like:
Since OSX dont follow standard paths where libraries live you need to provide their
locations to the ./configure command. In OSX versions before Catalina (10.15)
you could do some trick,
but that does not work any more.
And in PHP versions before 7.4 you could use options like --with-libxml-dir,
but that has been removed in favor of
pkg-config.
What you should do
So every time it complains, ie for libxml2, you should update the PGK_CONFIG_PATH
environment variable. The value depends on the path to the library.
To find the path, lets run brew info:
From the output we see that libxml2 lives in /usr/local/Cellar/libxml2/2.9.9_2.
That means pkgconfig lives in this folder:
For my machine, I had to run the following three commands to successfully compile
PHP.
I struggled for hours to compile PHP 7.4. My main mistake was that I didn’t read
the output of the ./configure command. Please please please, make sure to read
at least the last 20 lines.
The Symfony Runtime component is AWESOME. I did a talk about it at
Symfony World 2021 where I explain how and
why it works. I spent a lot of time on the cont...
The lock component have saved me so many times. It helps me with race conditions,
it makes my code simpler and my application more reliable. I’m using it to ...
I’ve been blogging now and then for over a decade now. I have used Drupal, Wordpress,
plain HTML files, static generators as Jekyll and Sculpin. I’ve also us...
It has been one year since Jérémy Derussé and I started to work on a new API client
for AWS. At the time we could never have imagined how popular it would be...
Leave a Comment