|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77342 php-src does not compile
Submitted: 2018-12-23 17:08 UTC Modified: 2020-08-10 17:00 UTC
From: Assigned: carusogabriel (profile)
Status: Closed Package: Compile Failure
PHP Version: master-Git-2018-12-23 (Git) OS: MacOS 10.14.2 (18C54)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2018-12-23 17:08 UTC]
I tried to configure php-src locally in a new MacBook, but without success while compiling. I can edit this bug with further needed information, but this is what I get when trying to run `make -j5` after `./configure --enable-maintainer-zts --enable-debug --enable-cli --without-iconv`: 

    Undefined symbols for architecture x86_64:
      "_sqlite3_column_table_name", referenced from:
          _pdo_sqlite_stmt_col_meta in sqlite_statement.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [sapi/phpdbg/phpdbg] Error 1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-12-23 17:35 UTC]
Interesting!  See <>.
 [2018-12-24 15:20 UTC]
Even using the `--without-sqlite3` flag, I still get this error.
 [2018-12-24 15:27 UTC]
But using both `--without-sqlite3 --without-pdo-sqlite` I could make it ran :)
 [2019-01-16 11:15 UTC]
It's mac, not PHP. Case is that this system is locked to its own packages and versions, yet to install a custom package, for example, via brew, it doesn't upgrade the system's sqlite package but installs its own under a special location - something like /usr/local/opt/sqlite

So, after inspecting particular package:

brew info sqlite3

we notice info where the package is installed and the command to configure PHP (at the time of this writing) becomes:

./configure --with-sqlite3=/usr/local/opt/sqlite --without-iconv --with-pdo-sqlite=/usr/local/opt/sqlite

(yes, with the current moving to so called pkg-config there will be quite a lot of adjustments still required on some systems because I'm not sure that it will recognize all packages without passing environment variables.

I'm assuming, but in your case it might be that php is trying to build against the system's sqlite3 version which is either outdated, or something else wrong with it, so you'll need to similarly point to the brew sqlite3 package.

P.S: Probably something similar goes for the iconv library...
 [2019-03-16 22:21 UTC]
I think Mac has now updated versions of these files... Try also this:
  sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

and then:
  xcode-select --install

also run Software updates to have latest and greatest versions installed.

Then it should go through ok.

Solution found here:

Please report back if this helps.
 [2019-03-17 19:13 UTC]
Hey Peter

I'm still getting some errors with the SQLite extension, but I'll use your previous comment to try to solve it and maybe mark this bug as solved.

Thanks for the support.
 [2019-04-09 00:40 UTC] gabrielrcouto at gmail dot com
I had the same problem and solved with these steps:

- brew install sqlite3
- download "Precompiled Binaries for Mac OS X (x86)" and "sqlite-amalgamation" from
- extract files from "Precompiled Binaries for Mac OS X (x86)" to "/usr/local/opt/sqlite/bin/" (yes, you'll replace the binary installed by brew)
- extract .h files from "sqlite-amalgamation" to "/usr/local/opt/sqlite/include/"
- add 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' to ~/.zshrc or ~/.bashrc

If you run "which sqlite3", the answer need to be "/usr/local/opt/sqlite/bin/sqlite3", otherwise maybe you have another sqlite3 instalation on your machine.
 [2020-08-10 11:07 UTC]
Did this issue get resolved in the meantime?
 [2020-08-10 17:00 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: carusogabriel
 [2020-08-10 17:00 UTC]
@nikic: Yeap. I still have problems with `iconv`, but the issue reported is fixed. Closing for now.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Oct 27 06:03:32 2021 UTC