msphpsql: libc++abi.dylib: terminating with uncaught exception

.+Please check the FAQ (frequently-asked questions) first. If you have other questions or something to report, please address the following:

PHP Driver version or file name

5.3.0

SQL Server version

SQL Server 2017 Express

Client operating system

MacOS 10.14.2

PHP version

7.2.13

Microsoft ODBC Driver version

13.1

Table schema

Problem description

I don’t know if this problem is with the PDO_SQLSRV driver or not. But so far I have experienced the same error running PHP 7.2 and 7.3 with both Nginx and Apache, and I tried using MAMP as well.

I have a local web server setup and am able to browse to my Laravel application fine and it’s able to pull data from the database (SQL Server is running on a remote server). I am able to perform GET, PATCH, and DELETE requests without any issues. However, when I send a POST request it errors on the response. The data does go through and an update is made to the database, but I get either a 502 Bad Gateway or ERR_EMPTY_RESPONSE error depending on if I"m using Apache or Nginx.

The thing that has me questioning the PDO_SQLSRV driver is the error I’m getting in the error log:

libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: collate_byname<char>::collate_byname failed to construct for C/C/en_GB.UTF-8/C/en_GB.UTF-8/C
[Fri Dec 14 10:27:59.163245 2018] [core:notice] [pid 25168] AH00052: child pid 26318 exit signal Abort trap (6)

I have no idea what this means and I really can’t find anything on it… So I’m just question if SQLSRV uses libc++abi.dylib and whether or not the error is originating somewhere here.

Note that I’m running the same application on both an IIS and Ubuntu server – in both cases everything is working fine so I don’t believe it’s an application error… I’ve spent many hours troubleshooting Apache/Nginx (replicating the Ubuntu server config), but to no avail.

Please let me know if SQLSRV could be the culprit or not, and if so what information I can provide.

Thanks

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

I think something was just massively wrong with my SQLSRV / ODBC driver installation. I blew everything away (Apache, Nginx, PHP, SQLSRV, ODBC), switched over to MAMP (in an attempt to have a clean web server installation), downloaded the SQLSRV driver via GitHub (instead of PECL), re-ran the Microsoft ODBC installation via Homebrew, and now it’s working as expected.

I have no idea if something perhaps went awry with the PECL installation?

In any case, I do appreciate the help. I’ll close the issue.

@yitam For now I’m sticking to Apache since it seems to provide the best error message (and I’m assuming the issue, whether I’m using Apache or Nginx, is the same).

Anyway, I did throw AddDefaultCharset utf-8 into my Apache error log, but the same issue occurs.

Laravel, the PHP framework I use, includes a nice command-line tool for testing PHP with. I’m pretty sure this means bypassing Apache. It returns the same error message:

libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: collate_byname<char>::collate_byname failed to construct for en_US.UTF-8/en_US.UTF-8/en_GB.UTF-8/en_US.UTF-8/en_GB.UTF-8/en_US.UTF-8

The database record IS being created, but whatever is happening inside Laravel’s create() method is causing the issues.

I also did the next logical thing: Take Laravel out of the equation. I wrote a simple PHP script that connects using the SQLSRV driver and inserts a record. This works without throwing any errors. So I am thinking at this point there’s something specific with my MacOS environment that Laravel is not playing nice with.