Skip to content

pecl install of sqlsrv & pdo_sqlsrv on MacOSC Catalina fails due to missing /usr/local/lib/php/pecl directory #1186

@sbreakey

Description

@sbreakey

Client operating system

Mac OSX Catalina Version 10.15.6 (19G2021)

PHP version

% php -v
PHP 7.4.9 (cli) (built: Aug  7 2020 19:23:06) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

Problem description

Following the instructions for OSX installation in this repo, the sudo pecl install sqlsrv command claims to complete successfully but shows a couple warnings:

Build process completed successfully
Installing '/usr/local/Cellar/php/7.4.9/pecl/20190902/sqlsrv.so'

Warning: mkdir(): File exists in System.php on line 294

Warning: mkdir(): File exists in /usr/local/Cellar/php/7.4.9/share/php/pear/System.php on line 294
ERROR: failed to mkdir /usr/local/Cellar/php/7.4.9/pecl/20190902

/usr/local/Cellar/php/7.4.9/pecl is a symlnk:
lrwxr-xr-x 1 StephenB staff 23B Sep 2 21:07 pecl -> /usr/local/lib/php/pecl

However the pecl directory does not exist in /usr/local/lib/php/
I manually created it with sudo mkdir /usr/local/lib/php/pecl and re-ran sudo pecl install sqlsrv which now completes without warnings:

Build process completed successfully
Installing '/usr/local/Cellar/php/7.4.9/pecl/20190902/sqlsrv.so'
install ok: channel://pecl.php.net/sqlsrv-5.8.1
Extension sqlsrv enabled in php.ini

I'm no expert here, so it's entirely possible this is a quirk due to something I did incorrectly. Thought I'd raise it here in case it isn't.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions