Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

feat ref #223: fixes the error installing sqlsrv #224

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

robertoperuzzo
Copy link

@robertoperuzzo robertoperuzzo commented Mar 22, 2023

Fixes issue #223:

  • uses odbc version 2.3.7
  • parameterizes PHP version

The New Solution/Problem/Issue/Bug:

Using the previous Dockerfile I get the following error

❯ ddev debug refresh
failed to solve: executor failed running [/bin/sh -c pecl -d php_suffix=8.1 install sqlsrv]: exit code: 1
...
...
...
#22 18.22 /bin/sed: can't read /usr/lib/x86_64-linux-gnu/libltdl.la: No such file or directory
#22 18.22 libtool:   error: '/usr/lib/x86_64-linux-gnu/libltdl.la' is not a valid libtool archive
#22 18.22 make: *** [Makefile:250: sqlsrv.la] Error 1
#22 18.23 ERROR: `make' failed
...
...

It seems something related to version 2.3.11 of unixodbc.

How this PR Solves The Problem:

Forcing the unixodbc version 2.3.7

Manual Testing Instructions:

  1. Copy the Dockerfile in .ddev/web-build/
  2. run ddev php --info | grep pdo_sqlsrv

You should get

/etc/php/8.1/cli/conf.d/20-pdo_sqlsrv.ini,
pdo_sqlsrv
pdo_sqlsrv support => enabled
pdo_sqlsrv.client_buffer_max_kb_size => 10240 => 10240
pdo_sqlsrv.log_severity => 0 => 0
pdo_sqlsrv.report_additional_errors => 1 => 1
pdo_sqlsrv.set_locale_info => 2 => 2

Related Issue Link(s):

* uses odbc version 2.3.7
* parameterizes PHP version
Copy link
Member

@rfay rfay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@drupal-daffie please review and manually test this and see if you approve. Assuming you're still familiar with this setup.

docker-compose-services/sqlsrv/Dockerfile Show resolved Hide resolved
@rfay
Copy link
Member

rfay commented Mar 23, 2023

I haven't manually tested, but hope @drupal-daffie will take a look

@rfay
Copy link
Member

rfay commented Mar 23, 2023

Actually, what I'd love to have you do is turn this into a ddev-get add-on and then maintain it, so we wouldn't find out things like this by accident. https://ddev.readthedocs.io/en/latest/users/extend/additional-services/#creating-an-additional-service-for-ddev-get

Would you consider doing that?

@robertoperuzzo
Copy link
Author

Actually, what I'd love to have you do is turn this into a ddev-get add-on and then maintain it, so we wouldn't find out things like this by accident. https://ddev.readthedocs.io/en/latest/users/extend/additional-services/#creating-an-additional-service-for-ddev-get

Would you consider doing that?

It sounds good. I'm going to read the add-on documentation and try do create the new add-on.

@robertoperuzzo
Copy link
Author

@rfay I created this repo for the ddev add-on https://github.com/robertoperuzzo/ddev-sqlsrv

@robertoperuzzo
Copy link
Author

@rfay I created this repo for the ddev add-on https://github.com/robertoperuzzo/ddev-sqlsrv

I have to fix the README and the tests.

@rfay
Copy link
Member

rfay commented Mar 26, 2023

Awesome!

You'll probably want to change this PR to a "Go to the maintained add-on instead" notice.

@rfay
Copy link
Member

rfay commented Aug 4, 2023

Let's get this in and please just add a reference to your maintained add-on. Thanks so much!

@robertoperuzzo
Copy link
Author

Let's get this in and please just add a reference to your maintained add-on. Thanks so much!

I'm sorry but I didn't understand what "add a reference to your maintained add-on" means.

@rfay
Copy link
Member

rfay commented Aug 5, 2023

Just update ddev-contrib here to point to ddev/ddev-sqlsrv and point out that the existing recipe here isn't the authoritative one any more.

@drupal-daffie
Copy link
Contributor

drupal-daffie commented Aug 7, 2023

I have not test the code, but all the changes look good to me.
The PHP specific version stuff was a real pain in the ass.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants