microsoft / Oryx

Build your repo automatically.
Other
755 stars 174 forks source link

Add PHP pdo_sqlsrv extension in build image #868

Closed MCKLMT closed 3 years ago

MCKLMT commented 3 years ago

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

phpinfo()
PHP Version => 7.4.9

System => Linux 8d2ce96ad426 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64
Build Date => Aug 20 2020 08:18:39
Configure Command =>  './configure'  '--build=x86_64-linux-gnu' '--prefix=/opt/php/7.4.9' '--with-config-file-path=/opt/php/7.4.9/ini' '--with-config-file-scan-dir=/opt/php/7.4.9/ini/conf.d' '--enable-option-checking=fatal' '--with-mhash' '--enable-ftp' '--enable-mbstring' '--enable-mysqlnd' '--enable-bcmath' '--with-password-argon2' '--with-sodium=shared' '--with-pear' '--with-curl' '--with-libedit' '--with-openssl' '--with-zlib' '--with-libdir=lib/x86_64-linux-gnu' 'build_alias=x86_64-linux-gnu'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /opt/php/7.4.9/ini
Loaded Configuration File => /opt/php/7.4.9/ini/php.ini
Scan this dir for additional .ini files => /opt/php/7.4.9/ini/conf.d
Additional .ini files parsed => /opt/php/7.4.9/ini/conf.d/docker-php-ext-sodium.ini

PHP API => 20190902
PHP Extension => 20190902
Zend Extension => 320190902
Zend Extension Build => API320190902,NTS
PHP Extension Build => API20190902,NTS
Debug Build => no
Thread Safety => disabled
Zend Signal Handling => enabled
Zend Memory Manager => enabled
Zend Multibyte Support => provided by mbstring
IPv6 Support => enabled
DTrace Support => disabled

Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp, phar
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filters => zlib.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk

This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.4.0, Copyright (c) Zend Technologies

 _______________________________________________________________________

Configuration

bcmath

BCMath support => enabled

Directive => Local Value => Master Value
bcmath.scale => 0 => 0

Core

PHP Version => 7.4.9

Directive => Local Value => Master Value
allow_url_fopen => On => On
allow_url_include => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &
auto_append_file => no value => no value
auto_globals_jit => On => On
auto_prepend_file => no value => no value
browscap => no value => no value
default_charset => UTF-8 => UTF-8
default_mimetype => text/html => text/html
disable_classes => no value => no value
disable_functions => no value => no value
display_errors => Off => Off
display_startup_errors => Off => Off
doc_root => no value => no value
docref_ext => no value => no value
docref_root => no value => no value
enable_dl => Off => Off
enable_post_data_reading => On => On
error_append_string => no value => no value
error_log => no value => no value
error_prepend_string => no value => no value
error_reporting => 22527 => 22527
expose_php => On => On
extension_dir => /opt/php/7.4.9/lib/php/extensions/no-debug-non-zts-20190902 => /opt/php/7.4.9/lib/php/extensions/no-debug-non-zts-20190902
file_uploads => On => On
hard_timeout => 2 => 2
highlight.comment => <font style="color: #FF8000">#FF8000</font> => <font style="color: #FF8000">#FF8000</font>
highlight.default => <font style="color: #0000BB">#0000BB</font> => <font style="color: #0000BB">#0000BB</font>
highlight.html => <font style="color: #000000">#000000</font> => <font style="color: #000000">#000000</font>
highlight.keyword => <font style="color: #007700">#007700</font> => <font style="color: #007700">#007700</font>
highlight.string => <font style="color: #DD0000">#DD0000</font> => <font style="color: #DD0000">#DD0000</font>
html_errors => Off => Off
ignore_repeated_errors => Off => Off
ignore_repeated_source => Off => Off
ignore_user_abort => Off => Off
implicit_flush => On => On
include_path => .:/opt/php/7.4.9/lib/php => .:/opt/php/7.4.9/lib/php
input_encoding => no value => no value
internal_encoding => no value => no value
log_errors => On => On
log_errors_max_len => 1024 => 1024
mail.add_x_header => Off => Off
mail.force_extra_parameters => no value => no value
mail.log => no value => no value
max_execution_time => 0 => 0
max_file_uploads => 20 => 20
max_input_nesting_level => 64 => 64
max_input_time => -1 => -1
max_input_vars => 1000 => 1000
memory_limit => 128M => 128M
open_basedir => no value => no value
output_buffering => 0 => 0
output_encoding => no value => no value
output_handler => no value => no value
post_max_size => 8M => 8M
precision => 14 => 14
realpath_cache_size => 4096K => 4096K
realpath_cache_ttl => 120 => 120
register_argc_argv => On => On
report_memleaks => On => On
report_zend_debug => Off => Off
request_order => GP => GP
sendmail_from => no value => no value
sendmail_path => /usr/sbin/sendmail -t -i => /usr/sbin/sendmail -t -i
serialize_precision => -1 => -1
short_open_tag => Off => Off
SMTP => localhost => localhost
smtp_port => 25 => 25
sys_temp_dir => no value => no value
syslog.facility => LOG_USER => LOG_USER
syslog.filter => no-ctrl => no-ctrl
syslog.ident => php => php
track_errors => Off => Off
unserialize_callback_func => no value => no value
upload_max_filesize => 2M => 2M
upload_tmp_dir => no value => no value
user_dir => no value => no value
user_ini.cache_ttl => 300 => 300
user_ini.filename => .user.ini => .user.ini
variables_order => GPCS => GPCS
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
zend.assertions => -1 => -1
zend.detect_unicode => On => On
zend.enable_gc => On => On
zend.exception_ignore_args => On => On
zend.multibyte => Off => Off
zend.script_encoding => no value => no value
zend.signal_check => Off => Off

ctype

ctype functions => enabled

curl

cURL support => enabled
cURL Information => 7.52.1
Age => 3
Features
AsynchDNS => Yes
CharConv => No
Debug => No
GSS-Negotiate => No
IDN => Yes
IPv6 => Yes
krb4 => No
Largefile => Yes
libz => Yes
NTLM => Yes
NTLMWB => Yes
SPNEGO => Yes
SSL => Yes
SSPI => No
TLS-SRP => Yes
HTTP2 => Yes
GSSAPI => Yes
KERBEROS5 => Yes
UNIX_SOCKETS => Yes
PSL => Yes
HTTPS_PROXY => Yes
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
Host => x86_64-pc-linux-gnu
SSL Version => OpenSSL/1.0.2u
ZLib Version => 1.2.8
libSSH Version => libssh2/1.7.0

Directive => Local Value => Master Value
curl.cainfo => no value => no value

date

date/time support => enabled
timelib version => 2018.03
"Olson" Timezone Database Version => 2020.1
Timezone Database => internal
Default timezone => UTC

Directive => Local Value => Master Value
date.default_latitude => 31.7667 => 31.7667
date.default_longitude => 35.2333 => 35.2333
date.sunrise_zenith => 90.583333 => 90.583333
date.sunset_zenith => 90.583333 => 90.583333
date.timezone => no value => no value

dom

DOM/XML => enabled
DOM/XML API Version => 20031129
libxml Version => 2.9.4
HTML Support => enabled
XPath Support => enabled
XPointer Support => enabled
Schema Support => enabled
RelaxNG Support => enabled

fileinfo

fileinfo support => enabled
libmagic => 537

filter

Input Validation and Filtering => enabled

Directive => Local Value => Master Value
filter.default => unsafe_raw => unsafe_raw
filter.default_flags => no value => no value

ftp

FTP support => enabled
FTPS support => enabled

hash

hash support => enabled
Hashing Engines => md2 md4 md5 sha1 sha224 sha256 sha384 sha512/224 sha512/256 sha512 sha3-224 sha3-256 sha3-384 sha3-512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost gost-crypto adler32 crc32 crc32b crc32c fnv132 fnv1a32 fnv164 fnv1a64 joaat haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5 

MHASH support => Enabled
MHASH API Version => Emulated Support

iconv

iconv support => enabled
iconv implementation => glibc
iconv library version => 2.24

Directive => Local Value => Master Value
iconv.input_encoding => no value => no value
iconv.internal_encoding => no value => no value
iconv.output_encoding => no value => no value

json

json support => enabled

libxml

libXML support => active
libXML Compiled Version => 2.9.4
libXML Loaded Version => 20904
libXML streams => enabled

mbstring

Multibyte Support => enabled
Multibyte string engine => libmbfl
HTTP input encoding translation => disabled
libmbfl version => 1.3.2

mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.

Multibyte (japanese) regex support => enabled
Multibyte regex (oniguruma) version => 6.1.3

Directive => Local Value => Master Value
mbstring.detect_order => no value => no value
mbstring.encoding_translation => Off => Off
mbstring.func_overload => 0 => 0
mbstring.http_input => no value => no value
mbstring.http_output => no value => no value
mbstring.http_output_conv_mimetypes => ^(text/|application/xhtml\+xml) => ^(text/|application/xhtml\+xml)
mbstring.internal_encoding => no value => no value
mbstring.language => neutral => neutral
mbstring.regex_retry_limit => 1000000 => 1000000
mbstring.regex_stack_limit => 100000 => 100000
mbstring.strict_detection => Off => Off
mbstring.substitute_character => no value => no value

mysqlnd

mysqlnd => enabled
Version => mysqlnd 7.4.9
Compression => supported
core SSL => supported
extended SSL => supported
Command buffer size => 4096
Read buffer size => 32768
Read timeout => 86400
Collecting statistics => Yes
Collecting memory statistics => No
Tracing => n/a
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_caching_sha2_password,auth_plugin_sha256_password
API Extensions =>  

openssl

OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 1.1.0l  10 Sep 2019
OpenSSL Header Version => OpenSSL 1.1.0l  10 Sep 2019
Openssl default config => /usr/lib/ssl/openssl.cnf

Directive => Local Value => Master Value
openssl.cafile => no value => no value
openssl.capath => no value => no value

pcre

PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 10.34 2019-11-21
PCRE Unicode Version => 12.1.0
PCRE JIT Support => enabled
PCRE JIT Target => x86 64bit (little endian + unaligned)

Directive => Local Value => Master Value
pcre.backtrack_limit => 1000000 => 1000000
pcre.jit => 1 => 1
pcre.recursion_limit => 100000 => 100000

PDO

PDO support => enabled
PDO drivers => sqlite

pdo_sqlite

PDO Driver for SQLite 3.x => enabled
SQLite Library => 3.16.2

Phar

Phar: PHP Archive support => enabled
Phar API version => 1.1.1
Phar-based phar archives => enabled
Tar-based phar archives => enabled
ZIP-based phar archives => enabled
gzip compression => enabled
bzip2 compression => disabled (install ext/bz2)
Native OpenSSL support => enabled

Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
Directive => Local Value => Master Value
phar.cache_list => no value => no value
phar.readonly => On => On
phar.require_hash => On => On

posix

POSIX support => enabled

readline

Readline Support => enabled
Readline library => EditLine wrapper

Directive => Local Value => Master Value
cli.pager => no value => no value
cli.prompt => \b \>  => \b \> 

Reflection

Reflection => enabled

session

Session Support => enabled
Registered save handlers => files user 
Registered serializer handlers => php_serialize php php_binary 

Directive => Local Value => Master Value
session.auto_start => Off => Off
session.cache_expire => 180 => 180
session.cache_limiter => nocache => nocache
session.cookie_domain => no value => no value
session.cookie_httponly => no value => no value
session.cookie_lifetime => 0 => 0
session.cookie_path => / => /
session.cookie_samesite => no value => no value
session.cookie_secure => 0 => 0
session.gc_divisor => 1000 => 1000
session.gc_maxlifetime => 1440 => 1440
session.gc_probability => 1 => 1
session.lazy_write => On => On
session.name => PHPSESSID => PHPSESSID
session.referer_check => no value => no value
session.save_handler => files => files
session.save_path => no value => no value
session.serialize_handler => php => php
session.sid_bits_per_character => 5 => 5
session.sid_length => 26 => 26
session.upload_progress.cleanup => On => On
session.upload_progress.enabled => On => On
session.upload_progress.freq => 1% => 1%
session.upload_progress.min_freq => 1 => 1
session.upload_progress.name => PHP_SESSION_UPLOAD_PROGRESS => PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix => upload_progress_ => upload_progress_
session.use_cookies => 1 => 1
session.use_only_cookies => 1 => 1
session.use_strict_mode => 0 => 0
session.use_trans_sid => 0 => 0

SimpleXML

SimpleXML support => enabled
Schema support => enabled

sodium

sodium support => enabled
libsodium headers version => 1.0.11
libsodium library version => 1.0.11

SPL

SPL support => enabled
Interfaces => OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes => AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, CallbackFilterIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveCallbackFilterIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException

sqlite3

SQLite3 support => enabled
SQLite Library => 3.16.2

Directive => Local Value => Master Value
sqlite3.extension_dir => no value => no value

standard

Dynamic Library Support => enabled
Path to sendmail => /usr/sbin/sendmail -t -i

Directive => Local Value => Master Value
assert.active => 1 => 1
assert.bail => 0 => 0
assert.callback => no value => no value
assert.exception => 0 => 0
assert.quiet_eval => 0 => 0
assert.warning => 1 => 1
auto_detect_line_endings => 0 => 0
default_socket_timeout => 60 => 60
from => no value => no value
session.trans_sid_hosts => no value => no value
session.trans_sid_tags => a=href,area=href,frame=src,form= => a=href,area=href,frame=src,form=
unserialize_max_depth => 4096 => 4096
url_rewriter.hosts => no value => no value
url_rewriter.tags => form= => form=
user_agent => no value => no value

tokenizer

Tokenizer Support => enabled

xml

XML Support => active
XML Namespace Support => active
libxml2 Version => 2.9.4

xmlreader

XMLReader => enabled

xmlwriter

XMLWriter => enabled

zlib

ZLib Support => enabled
Stream Wrapper => compress.zlib://
Stream Filter => zlib.inflate, zlib.deflate
Compiled Version => 1.2.8
Linked Version => 1.2.8

Directive => Local Value => Master Value
zlib.output_compression => Off => Off
zlib.output_compression_level => -1 => -1
zlib.output_handler => no value => no value

Additional Modules

Module Name

Environment

Variable => Value
HTTP_HOST => testlinuxmimott.scm.azurewebsites.net
branch => master
LD_LIBRARY_PATH => /opt/php/7.4.9/lib:
POST_BUILD_COMMAND => postbuild.sh
MSBUILD_PATH =>  
DISABLE_HUGO_BUILD => true
SCM_COMMIT_ID => 8195c780910d448b47fd49866dfd85bd87e80d01
php => /opt/php/7.4.9/bin/php
SCM_DO_BUILD_DURING_DEPLOYMENT => True
LANG => C.UTF-8
WEBSITE_STACK => PHP
WEBSITE_SITE_NAME => testlinuxmimott
ScmType => BitbucketGit
HOSTNAME => 8d2ce96ad426
NOKOGIRI_USE_SYSTEM_LIBRARIES => true
OLDPWD => /tmp/8d896d7140c5c9e
APPSETTING_ScmType => BitbucketGit
WEBSITE_AUTH_ENCRYPTION_KEY => E3DDDDE8D654BA4F101326546765E71658E8384815287B2E2CCFB18FCDD3C9ED
KUDU_APPPATH => /opt/Kudu
WEBSITE_ROLE_INSTANCE_ID => 0
ASPNETCORE_URLS => http://0.0.0.0:8181
APPSETTING_POST_BUILD_COMMAND => postbuild.sh
SCM_USE_LIBGIT2SHARP_REPOSITORY => 0
NPM_JS_PATH => /usr/bin/npm-cli.js
FRAMEWORK => PHP
FRAMEWORK_VERSION => 7.4
RUBY_CONFIGURE_OPTS => --disable-install-doc
KUDU_SYNC_CMD => kudusync
WEBJOBS_DEPLOY_CMD => deploy_webjobs.cmd
PYTHONIOENCODING => UTF-8
DOTNET_SKIP_FIRST_TIME_EXPERIENCE => 1
SCM_DNVM_PS_PATH => /opt/Kudu/Scripts/dnvm.ps1
EnableNuGetPackageRestore => true
COMPUTERNAME => RD00155D988EC8
KUDU_WEBSSH_PORT => 3000
ORYX_SDK_STORAGE_BASE_URL => https://oryx-cdn.microsoft.io
FUNCTIONS_RUNTIME_SCALE_MONITORING_ENABLED => 0
NUGET_XMLDOC_MODE => skip
APPSETTING_DISABLE_HUGO_BUILD => true
ORYX_ENV_TYPE => AppService
WEBSITE_SKU => PremiumV2
APPSETTING_SCM_USE_LIBGIT2SHARP_REPOSITORY => 0
ORYX_PATHS => /opt/oryx:/opt/nodejs/lts/bin:/opt/dotnet/sdks/lts:/opt/python/latest/bin:/opt/php/lts/bin:/opt/php-composer:/opt/yarn/stable/bin:/opt/hugo/lts
SCM_BUILD_ARGS =>  
PWD => /tmp/8d896d7140c5c9e
VCTargetsPath =>  
HOME => /home
SCM_COMMIT_MESSAGE => postbuild.sh edited online with Bitbucket
dotnet => /opt/dotnet/sdks/2.2.402/dotnet
WEBROOT_PATH => /home/site/wwwroot
REMOTEDEBUGGINGVERSION => 16.0.28729.10
WEBSITE_OWNER_NAME => 5648d12a-ba49-4789-8793-6f7cc54e1556+testlinux-rg-WestEuropewebspace
WEBSITE_AUTH_ENABLED => False
DESTINATION_DIR => /home/site/wwwroot
WEBSITE_AUTH_AUTO_AAD => False
DEBIAN_FRONTEND => noninteractive
WEBSITE_PHP_VERSION => 7.4
DEPLOYMENT_SOURCE => /home/site/repository
RUBY_CFLAGS => -O3
KUDU_RUN_USER => fc3e0396774f8ed95e3d42ca
APPSETTING_WEBSITE_SITE_NAME => testlinuxmimott
PLATFORM_VERSION => 90.0.7.56
WEBSITE_HOSTNAME => testlinuxmimott.azurewebsites.net
PORT => 8181
LIBRARY_PATH => /opt/php/7.4.9/lib:
SELECT_LATEST_VERSION_CMD => /opt/Kudu/Scripts/selectLatestVersion.ps1
APPSETTING_WEBSITE_AUTH_LOGOUT_PATH => /.auth/logout
SCM_ENABLE_DYNAMIC_INSTALL => false
SCM_COMMAND_IDLE_TIMEOUT => 60
DEPLOYMENT_TARGET => /home/site/wwwroot
WEBSITE_RESOURCE_GROUP => testlinux-rg
composer => /opt/php-composer/1.9.3/composer.phar
GO_WEB_CONFIG_TEMPLATE => /opt/Kudu/Scripts/go.web.config.template
WEBSITE_INSTANCE_ID => 77d20cbc1ab51a0480294596e0895a2c809627a96c4507d2c0105e2b63042dce
DOTNET_USE_POLLING_FILE_WATCHER => true
WEBSITE_SSH_PASSWORD => Docker!
PREVIOUS_MANIFEST_PATH => /opt/Kudu/Scripts/firstDeploymentManifest
NEXT_MANIFEST_PATH => /home/site/deployments/8195c780910d448b47fd49866dfd85bd87e80d01/manifest
VCInstallDir_140 =>  
DOTNET_RUNNING_IN_CONTAINER => true
APPDATA => /opt/Kudu/local
IGNORE_MANIFEST => 0
RBENV_ROOT => /usr/local/.rbenv
SITE_BITNESS => AMD64
DEPLOYMENT_TEMP => /tmp/8d896d7140c5c9e
APPSETTING_FUNCTIONS_RUNTIME_SCALE_MONITORING_ENABLED => 0
HTTP_AUTHORITY => testlinuxmimott.scm.azurewebsites.net
PHP_VERSION => 7.4
dynamic_install_root_dir => /tmp/oryx/platforms
WEBSITE_SSH_USER => root
SCM_TRACE_LEVEL => Verbose
APPSETTING_SCM_ENABLE_DYNAMIC_INSTALL => false
APPSETTING_REMOTEDEBUGGINGVERSION => 16.0.28729.10
SHLVL => 3
ORYX_AI_INSTRUMENTATION_KEY => 4aadba6b-30c8-42db-9b93-024d5c62b887
SCM_LOGSTREAM_TIMEOUT => 7200
APPSVC_RUN_ZIP => FALSE
KUDU_SELECT_PYTHON_VERSION_CMD => python "/opt/Kudu/Scripts/select_python_version.py"
KUDU_SELECT_NODE_VERSION_CMD => node "/opt/Kudu/Scripts/selectNodeVersion"
GYP_MSVS_VERSION => 2015
SOURCE_DIR => /tmp/8d896d7140c5c9e
DOTNET_CLI_TELEMETRY_PROFILE => AzureKudu
APPSETTING_WEBSITE_AUTH_AUTO_AAD => False
PATH => /opt/php/7.4.9/bin:/home/site/deployments/tools:/opt/Kudu/Scripts:/usr/bin:/usr/bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/opt/dotnet/sdks/2.2.402:/usr/local/.rbenv/bin:/usr/local:/opt/oryx:/opt/nodejs/lts/bin:/opt/dotnet/sdks/lts:/opt/python/latest/bin:/opt/php/lts/bin:/opt/php-composer:/opt/yarn/stable/bin:/opt/hugo/lts:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.dotnet/tools:/opt/nodejs/9/bin
MSBUILD_15_DIR =>  
HOMEDRIVE =>  
NUGET_EXE => /opt/Kudu/Scripts/nuget.exe
ENABLE_ORYX_BUILD => true
APPSETTING_WEBSITE_AUTH_ENABLED => False
HOMEPATH => /home
deployment_branch => master
ORIGINAL_PATH => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
WEBSITE_AUTH_LOGOUT_PATH => /.auth/logout
WEBSITE_AUTH_SIGNING_KEY => 5D8136EF97023BE94ED10885BE31084913E5177185C9AB4B6589600ED6371CF9
ORYX_ENV_NAME => ~1testlinuxmimott
NUGET_PACKAGES => /var/nuget
_ => /opt/php/7.4.9/bin/php

PHP Variables

Variable => Value
$_SERVER['HTTP_HOST'] => testlinuxmimott.scm.azurewebsites.net
$_SERVER['branch'] => master
$_SERVER['LD_LIBRARY_PATH'] => /opt/php/7.4.9/lib:
$_SERVER['POST_BUILD_COMMAND'] => postbuild.sh
$_SERVER['MSBUILD_PATH'] => 
$_SERVER['DISABLE_HUGO_BUILD'] => true
$_SERVER['SCM_COMMIT_ID'] => 8195c780910d448b47fd49866dfd85bd87e80d01
$_SERVER['php'] => /opt/php/7.4.9/bin/php
$_SERVER['SCM_DO_BUILD_DURING_DEPLOYMENT'] => True
$_SERVER['LANG'] => C.UTF-8
$_SERVER['WEBSITE_STACK'] => PHP
$_SERVER['WEBSITE_SITE_NAME'] => testlinuxmimott
$_SERVER['ScmType'] => BitbucketGit
$_SERVER['HOSTNAME'] => 8d2ce96ad426
$_SERVER['NOKOGIRI_USE_SYSTEM_LIBRARIES'] => true
$_SERVER['OLDPWD'] => /tmp/8d896d7140c5c9e
$_SERVER['APPSETTING_ScmType'] => BitbucketGit
$_SERVER['WEBSITE_AUTH_ENCRYPTION_KEY'] => E3DDDDE8D654BA4F101326546765E71658E8384815287B2E2CCFB18FCDD3C9ED
$_SERVER['KUDU_APPPATH'] => /opt/Kudu
$_SERVER['WEBSITE_ROLE_INSTANCE_ID'] => 0
$_SERVER['ASPNETCORE_URLS'] => http://0.0.0.0:8181
$_SERVER['APPSETTING_POST_BUILD_COMMAND'] => postbuild.sh
$_SERVER['SCM_USE_LIBGIT2SHARP_REPOSITORY'] => 0
$_SERVER['NPM_JS_PATH'] => /usr/bin/npm-cli.js
$_SERVER['FRAMEWORK'] => PHP
$_SERVER['FRAMEWORK_VERSION'] => 7.4
$_SERVER['RUBY_CONFIGURE_OPTS'] => --disable-install-doc
$_SERVER['KUDU_SYNC_CMD'] => kudusync
$_SERVER['WEBJOBS_DEPLOY_CMD'] => deploy_webjobs.cmd
$_SERVER['PYTHONIOENCODING'] => UTF-8
$_SERVER['DOTNET_SKIP_FIRST_TIME_EXPERIENCE'] => 1
$_SERVER['SCM_DNVM_PS_PATH'] => /opt/Kudu/Scripts/dnvm.ps1
$_SERVER['EnableNuGetPackageRestore'] => true
$_SERVER['COMPUTERNAME'] => RD00155D988EC8
$_SERVER['KUDU_WEBSSH_PORT'] => 3000
$_SERVER['ORYX_SDK_STORAGE_BASE_URL'] => https://oryx-cdn.microsoft.io
$_SERVER['FUNCTIONS_RUNTIME_SCALE_MONITORING_ENABLED'] => 0
$_SERVER['NUGET_XMLDOC_MODE'] => skip
$_SERVER['APPSETTING_DISABLE_HUGO_BUILD'] => true
$_SERVER['ORYX_ENV_TYPE'] => AppService
$_SERVER['WEBSITE_SKU'] => PremiumV2
$_SERVER['APPSETTING_SCM_USE_LIBGIT2SHARP_REPOSITORY'] => 0
$_SERVER['ORYX_PATHS'] => /opt/oryx:/opt/nodejs/lts/bin:/opt/dotnet/sdks/lts:/opt/python/latest/bin:/opt/php/lts/bin:/opt/php-composer:/opt/yarn/stable/bin:/opt/hugo/lts
$_SERVER['SCM_BUILD_ARGS'] => 
$_SERVER['PWD'] => /tmp/8d896d7140c5c9e
$_SERVER['VCTargetsPath'] => 
$_SERVER['HOME'] => /home
$_SERVER['SCM_COMMIT_MESSAGE'] => postbuild.sh edited online with Bitbucket
$_SERVER['dotnet'] => /opt/dotnet/sdks/2.2.402/dotnet
$_SERVER['WEBROOT_PATH'] => /home/site/wwwroot
$_SERVER['REMOTEDEBUGGINGVERSION'] => 16.0.28729.10
$_SERVER['WEBSITE_OWNER_NAME'] => 5648d12a-ba49-4789-8793-6f7cc54e1556+testlinux-rg-WestEuropewebspace
$_SERVER['WEBSITE_AUTH_ENABLED'] => False
$_SERVER['DESTINATION_DIR'] => /home/site/wwwroot
$_SERVER['WEBSITE_AUTH_AUTO_AAD'] => False
$_SERVER['DEBIAN_FRONTEND'] => noninteractive
$_SERVER['WEBSITE_PHP_VERSION'] => 7.4
$_SERVER['DEPLOYMENT_SOURCE'] => /home/site/repository
$_SERVER['RUBY_CFLAGS'] => -O3
$_SERVER['KUDU_RUN_USER'] => fc3e0396774f8ed95e3d42ca
$_SERVER['APPSETTING_WEBSITE_SITE_NAME'] => testlinuxmimott
$_SERVER['PLATFORM_VERSION'] => 90.0.7.56
$_SERVER['WEBSITE_HOSTNAME'] => testlinuxmimott.azurewebsites.net
$_SERVER['PORT'] => 8181
$_SERVER['LIBRARY_PATH'] => /opt/php/7.4.9/lib:
$_SERVER['SELECT_LATEST_VERSION_CMD'] => /opt/Kudu/Scripts/selectLatestVersion.ps1
$_SERVER['APPSETTING_WEBSITE_AUTH_LOGOUT_PATH'] => /.auth/logout
$_SERVER['SCM_ENABLE_DYNAMIC_INSTALL'] => false
$_SERVER['SCM_COMMAND_IDLE_TIMEOUT'] => 60
$_SERVER['DEPLOYMENT_TARGET'] => /home/site/wwwroot
$_SERVER['WEBSITE_RESOURCE_GROUP'] => testlinux-rg
$_SERVER['composer'] => /opt/php-composer/1.9.3/composer.phar
$_SERVER['GO_WEB_CONFIG_TEMPLATE'] => /opt/Kudu/Scripts/go.web.config.template
$_SERVER['WEBSITE_INSTANCE_ID'] => 77d20cbc1ab51a0480294596e0895a2c809627a96c4507d2c0105e2b63042dce
$_SERVER['DOTNET_USE_POLLING_FILE_WATCHER'] => true
$_SERVER['WEBSITE_SSH_PASSWORD'] => Docker!
$_SERVER['PREVIOUS_MANIFEST_PATH'] => /opt/Kudu/Scripts/firstDeploymentManifest
$_SERVER['NEXT_MANIFEST_PATH'] => /home/site/deployments/8195c780910d448b47fd49866dfd85bd87e80d01/manifest
$_SERVER['VCInstallDir_140'] => 
$_SERVER['DOTNET_RUNNING_IN_CONTAINER'] => true
$_SERVER['APPDATA'] => /opt/Kudu/local
$_SERVER['IGNORE_MANIFEST'] => 0
$_SERVER['RBENV_ROOT'] => /usr/local/.rbenv
$_SERVER['SITE_BITNESS'] => AMD64
$_SERVER['DEPLOYMENT_TEMP'] => /tmp/8d896d7140c5c9e
$_SERVER['APPSETTING_FUNCTIONS_RUNTIME_SCALE_MONITORING_ENABLED'] => 0
$_SERVER['HTTP_AUTHORITY'] => testlinuxmimott.scm.azurewebsites.net
$_SERVER['PHP_VERSION'] => 7.4
$_SERVER['dynamic_install_root_dir'] => /tmp/oryx/platforms
$_SERVER['WEBSITE_SSH_USER'] => root
$_SERVER['SCM_TRACE_LEVEL'] => Verbose
$_SERVER['APPSETTING_SCM_ENABLE_DYNAMIC_INSTALL'] => false
$_SERVER['APPSETTING_REMOTEDEBUGGINGVERSION'] => 16.0.28729.10
$_SERVER['SHLVL'] => 3
$_SERVER['ORYX_AI_INSTRUMENTATION_KEY'] => 4aadba6b-30c8-42db-9b93-024d5c62b887
$_SERVER['SCM_LOGSTREAM_TIMEOUT'] => 7200
$_SERVER['APPSVC_RUN_ZIP'] => FALSE
$_SERVER['KUDU_SELECT_PYTHON_VERSION_CMD'] => python "/opt/Kudu/Scripts/select_python_version.py"
$_SERVER['KUDU_SELECT_NODE_VERSION_CMD'] => node "/opt/Kudu/Scripts/selectNodeVersion"
$_SERVER['GYP_MSVS_VERSION'] => 2015
$_SERVER['SOURCE_DIR'] => /tmp/8d896d7140c5c9e
$_SERVER['DOTNET_CLI_TELEMETRY_PROFILE'] => AzureKudu
$_SERVER['APPSETTING_WEBSITE_AUTH_AUTO_AAD'] => False
$_SERVER['PATH'] => /opt/php/7.4.9/bin:/home/site/deployments/tools:/opt/Kudu/Scripts:/usr/bin:/usr/bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/opt/dotnet/sdks/2.2.402:/usr/local/.rbenv/bin:/usr/local:/opt/oryx:/opt/nodejs/lts/bin:/opt/dotnet/sdks/lts:/opt/python/latest/bin:/opt/php/lts/bin:/opt/php-composer:/opt/yarn/stable/bin:/opt/hugo/lts:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.dotnet/tools:/opt/nodejs/9/bin
$_SERVER['MSBUILD_15_DIR'] => 
$_SERVER['HOMEDRIVE'] => 
$_SERVER['NUGET_EXE'] => /opt/Kudu/Scripts/nuget.exe
$_SERVER['ENABLE_ORYX_BUILD'] => true
$_SERVER['APPSETTING_WEBSITE_AUTH_ENABLED'] => False
$_SERVER['HOMEPATH'] => /home
$_SERVER['deployment_branch'] => master
$_SERVER['ORIGINAL_PATH'] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
$_SERVER['WEBSITE_AUTH_LOGOUT_PATH'] => /.auth/logout
$_SERVER['WEBSITE_AUTH_SIGNING_KEY'] => 5D8136EF97023BE94ED10885BE31084913E5177185C9AB4B6589600ED6371CF9
$_SERVER['ORYX_ENV_NAME'] => ~1testlinuxmimott
$_SERVER['NUGET_PACKAGES'] => /var/nuget
$_SERVER['_'] => /opt/php/7.4.9/bin/php
$_SERVER['PHP_SELF'] => 
$_SERVER['SCRIPT_NAME'] => 
$_SERVER['SCRIPT_FILENAME'] => 
$_SERVER['PATH_TRANSLATED'] => 
$_SERVER['DOCUMENT_ROOT'] => 
$_SERVER['REQUEST_TIME_FLOAT'] => 1606922997.5958
$_SERVER['REQUEST_TIME'] => 1606922997
$_SERVER['argv'] => Array
(
)

$_SERVER['argc'] => 0

PHP License
This program is free software; you can redistribute it and/or modify
it under the terms of the PHP License as published by the PHP Group
and included in the distribution in the file:  LICENSE

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

If you did not receive a copy of the PHP license, or have any
questions about PHP licensing, please contact license@php.net.
qianz2 commented 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!

MCKLMT commented 3 years ago

The two! Thanks This is important for a customer project. Is there any workaround we can use?

arroyc commented 3 years ago

@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?

arroyc commented 3 years ago

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
arroyc commented 3 years ago

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 ...

MCKLMT commented 3 years ago

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.1in two regions. The image seems to be a little old. What's the region you deployed on?

arroyc commented 3 years ago

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 !

MCKLMT commented 3 years ago

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

arroyc commented 3 years ago

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.

MCKLMT commented 3 years ago

I will try that with the customer. However, the startup command should be indempotent. Right?

MCKLMT commented 3 years ago

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.