Closed MCKLMT closed 3 years ago
Hi @MCKLMT , we can add this extension in Oryx PHP images. Could you confirm you need it in the build image or in the runtime images? Thanks!
The two! Thanks This is important for a customer project. Is there any workaround we can use?
@MCKLMT can you please verify Oryx version?
From the log its look like you are using php 7.4 ... so you can try installing that extension using pecl in postbuild script ... but this is what I found .. https://github.com/microsoft/msphpsql/releases/tag/v5.8.0
I believe pdo_mssql is old and not supported anymore .. i think it's pdo_sqlsrv now ... We do have sqlsrv in our runtimes .. so if the build is failing can you try with having a pecl install command in prebuild script or something?
if it is runtime container you can get the oryx information and then you can get the extension information as follows
root@0ab788e09b67:/var/www/html# oryx version
Oryx Version: 0.2.20201121.1, Commit: 74ab0828634c83b68aa94b8929df8e5f9756161b, ReleaseTagName: 20201121.1
root@0ab788e09b67:/var/www/html# php -m | grep pdo
Cannot load Zend OPcache - it was already loaded
pdo_mysql
pdo_pgsql
pdo_sqlite
pdo_sqlsrv
if it is build container you can do as in the following ....
root@818a985d721e:/# oryx --version
Version: 0.2.20201121.1, Commit: 74ab0828634c83b68aa94b8929df8e5f9756161b, ReleaseTagName: 20201121.1
root@818a985d721e:/# pecl install pdo_sqlsrv
you cant install in the build container directly .. so you try doing it in prebuild script or something ...
Running these two commands in build container
root@818a985d721e:/# oryx --version Version: 0.2.20201121.1, Commit: 74ab0828634c83b68aa94b8929df8e5f9756161b, ReleaseTagName: 20201121.1 root@818a985d721e:/# pecl install pdo_sqlsrv
gives the output:
### Oryx version ### Version: 0.2.20200917.1, Commit: 59deb778658a124cb74ea8e2c8f39fa87abcc9d9, ReleaseTagName: 20200917.1 ### Enable SQL ### Cannot install, php_dir for channel "pecl.php.net" is not writeable by the current user
I tried in postbuild script.
Running the same command in runtime container gives:
### Oryx version ###
Oryx Version: 0.2.20200917.1, Commit: 59deb778658a124cb74ea8e2c8f39fa87abcc9d9, ReleaseTagName: 20200917.1
### Enable SQL ###
Cannot load Zend OPcache - it was already loaded
pecl/pdo_sqlsrv is already installed and is the same as the released version 5.8.1
So the problem is well in the build container.
Also I see the same version Oryx Version: 0.2.20200917.1
in two regions. The image seems to be a little old. What's the region you deployed on?
Thanks for verifying this ... we have updated the build image .. but it will take some time to get deployed .. in the mean time I would try to add the extension work in some sort of custom start up script so that we can at least get the customer unblocked. I mean if we can't do it in build container, we still can do it in run container .. can we give it a try and see if it works !
I have already tried and the command pecl install pdo_sqlsrv
does not work with the message Cannot install, php_dir for channel "pecl.php.net" is not writeable by the current user
no not in build container .. custom start up in run container
this is a relevant custom start up for python app ... but idea is same for php as well ... we need to create a custom startup file that will execute in run container .. idea is to configure the database related tasks here instead of doing it in postbuild action in build container https://docs.microsoft.com/en-us/azure/developer/python/tutorial-deploy-app-service-on-linux-04#:~:text=In%20the%20Azure%20portal%2C%20sign,Startup%20Command%2C%20then%20select%20Save.
I will try that with the customer. However, the startup command should be indempotent. Right?
Finnaly, we'll forget Oryx and will switch to Azure DevOps. It seems to be a more perennial solution in our context. Thanks for the previous help however.
Feature Request
My customer would like to execute command in post build script with doctrine in PHP. However, the database is SQL Server and the extension pdo_mssql is not enabled in Oryx image.
Is there a way to add this extension in the image? Is there a way to execute a PHPinfo command to see all enabled modules in the image?
Thanks in advance
Executing a PHPinfo inside the container confirms that the extension is not enabled