Req #79887 [Com]: Building PHP on Silicon (ARM) Mac

From: Date: Sat, 05 Dec 2020 18:38:10 +0000
Subject: Req #79887 [Com]: Building PHP on Silicon (ARM) Mac
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230877@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79887&edit=1 ID: 79887 Comment by: Dygear at gmail dot com Reported by: nicolas dot brachfogel at 4d dot com Summary: Building PHP on Silicon (ARM) Mac Status: Open Type: Feature/Change Request Package: *General Issues Operating System: Mac OS PHP Version: Irrelevant Block user comment: N Private report: N New Comment: I am also having this issue. An arm Mac Mini using a somewhat fresh install of macOS 11.1 Beta 2 (Version 11.1 Beta (20C5061b)), I have the current version of Xcode installed (Version 12.2 12B45b). It does have a pretty current version of PHP already installed, 7.3.24, only one away from current at time of writing for the 7.3.x branch. The problem is that I would love to actually build PHP 8.0.0 on there for obvious reasons. But there is another note that I can see inside of the php -v call. ``` WARNING: PHP is not recommended PHP is included in macOS for compatibility with legacy software. Future versions of macOS will not include PHP. PHP 7.3.24-(to be removed in future macOS) (cli) (built: Nov 23 2020 08:18:04) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.24, Copyright (c) 1998-2018 Zend Technologies ``` That's kind of rude Apple. PHP 8.0.0 is great! But I digress. I downloaded the PHP 8.0.0.tar.gz file and extracted it into my Downloads folder and then opened a terminal and cd to that directory. The ./configure --enable-calendar --enable-pcntl --enable-soap and the same with a simple ./configure because I wasn't sure if the SOAP (Not my ideal answer to this, but I don't have a choice.) required libxml, but it seems to be required by the core. The error message for that is below ... ``` Configuring extensions checking io.h usability... no checking io.h presence... no checking for io.h... no checking for strtoll... yes checking for atoll... yes checking whether to build with LIBXML support... yes checking for libxml-2.0 >= 2.9.0... no configure: error: in `/Users/dygear/Downloads/php-8.0.0': configure: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables LIBXML_CFLAGS and LIBXML_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see <http://pkg-config.freedesktop.org/>. See `config.log' for more details ``` Doing some of my own research, I looked to see what version of libxml comes with macOS. It does have one, but it's version 2.0.0 according to man libxml. As you can see under files, all of them point to a 2.0.0 version of libxml. ``` libxml(3) libxml(3) NAME libxml - library used to parse XML files DESCRIPTION The libxml library is used to parse XML files. Its internal document representation is as close as possible to the DOM (Document Object Model) interface, an API for accessing XML or HTML structured documents. The libxml library also has a SAX-like interface, which is designed to be compatible with expat(1). NOTE: SAX, the Simple API for XML, is a standard interface for event-based XML parsing, developed collaboratively by the members of the XML-DEV mailing list, currently hosted by OASIS. The expat library is a XML 1.0 parser written in C, which aims to be fully conforming. It is currently not a validating XML processor. The libxml library now includes a nearly complete XPath implementation. The XPath (XML Path Language) is a language for addressing parts of an XML document, designed to be used by both XSLT and XPointer. The libxml library exports Push and Pull type parser interfaces for both XML and html. FILES /depot/lib/libxml_2.0.0/libxml.a static library /depot/lib/libxml_2.0.0/libxml.so shared library /depot/package/libxml_2.0.0/bin/xmllint binary application for parsing XML files AUTHORS Daniel Veillard (daniel@veillard.com). Red Hat Inc. Manual page by Ziying Sherwin (sherwin@nlm.nih.gov), ``` With the note from the above php -v command, we are going to need to come up with a solution native to macOS ARM. Any foot hold that PHP had on that platform is about to be list as they remove PHP from the native build of macOS. If we as a community want to support the large number of developers who are using PHP on their Mac's as their dev platform of choice we have to give them an easy way to do that. And quite frankly, many people who are PHP dev don't want to compile from source in the first place. (I do, but that's because I'm comfortable with C and a command line -- and I need certain extensions built into the core -- I think the vast majority of the community doesn't want to go down that rabbit hole however.). Previous Comments: ------------------------------------------------------------------------ [2020-07-23 12:40:40] nicolas dot brachfogel at 4d dot com Sorry, I've seen with my developer, and it looks like I was not understanding everything. I'm concerned about the release of the new Silicon Macs. We will need to compile and run PHP on these machine and my "issue" was more of a request to know if PHP will work on this platform (and when if you have to change things on your side). I realize I may have chosen a bad way to ask this question, but I didn't find any other. ------------------------------------------------------------------------ [2020-07-23 10:23:38] cmb@php.net Which targets? Which library? ------------------------------------------------------------------------ [2020-07-23 09:04:46] nicolas dot brachfogel at 4d dot com Sorry, I may not have been clear. I just want the targets to be updated to compile the library without modifications. It's not a bug, more of a request. ------------------------------------------------------------------------ [2020-07-23 09:00:08] nikic@php.net How did you try to build it, and how did it fail? ------------------------------------------------------------------------ [2020-07-23 08:58:53] nicolas dot brachfogel at 4d dot com Description: ------------ There is currently no way to build PHP on the new Apple Silicon (ARM) Mac. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=79887&edit=1

« previous php.bugs (#230877) next »