Bug #78423 [Com]: ODBC functions work without extension=odbc

From: Date: Sat, 17 Aug 2019 17:46:25 +0000
Subject: Bug #78423 [Com]: ODBC functions work without extension=odbc
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222296@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78423&edit=1 ID: 78423 Comment by: phpbugreports at gmail dot com Reported by: dpfender44 at gmail dot com Summary: ODBC functions work without extension=odbc Status: Assigned Type: Bug Package: PHP options/info functions Operating System: Windows 10 PHP Version: 7.4.0beta2 Assigned To: cmb Block user comment: N Private report: N New Comment: what about compare the output of "php.exe -n -m" and "php-cgi.exe -n -m" so that you can easily bypass "seems" and "assumptions" Previous Comments: ------------------------------------------------------------------------ [2019-08-17 17:41:42] dpfender44 at gmail dot com It seems that the php-cgi.exe has odbc included, but php.exe does not. ------------------------------------------------------------------------ [2019-08-17 17:36:06] dpfender44 at gmail dot com For PHP 7.4.0beta2, I removed the php.ini file and the odbc functions still work, but another script using mysqli_connect fails. C:\PHP740>php --ini Configuration File (php.ini) Path: C:\WINDOWS Loaded Configuration File: (none) Scan for additional .ini files in: (none) Additional .ini files parsed: (none) C:\PHP740> ------------------------------------------------------------------------ [2019-08-17 17:19:50] dpfender44 at gmail dot com C:\WINDOWS\system32>cd \php740 C:\PHP740>php --ini Configuration File (php.ini) Path: C:\WINDOWS Loaded Configuration File: C:\PHP740\php.ini Scan for additional .ini files in: (none) Additional .ini files parsed: (none) C:\PHP740>php -m |findstr odbc C:\PHP740>php -r "odbc_connect();" Fatal error: Uncaught Error: Call to undefined function odbc_connect() in Command line code:1 Stack trace: #0 {main} thrown in Command line code on line 1 C:\PHP740> C:\PHP740>cd \php739 C:\PHP739>php --ini Configuration File (php.ini) Path: C:\WINDOWS Loaded Configuration File: C:\PHP739\php.ini Scan for additional .ini files in: (none) Additional .ini files parsed: (none) C:\PHP739>php -m |findstr odbc C:\PHP739>php -r "odbc_connect();" Fatal error: Uncaught Error: Call to undefined function odbc_connect() in Command line code:1 Stack trace: #0 {main} thrown in Command line code on line 1 C:\PHP739> C:\PHP739>cd \php738 C:\PHP738>php --ini Configuration File (php.ini) Path: C:\WINDOWS Loaded Configuration File: C:\PHP738\php.ini Scan for additional .ini files in: (none) Additional .ini files parsed: (none) C:\PHP738>php -m |findstr odbc odbc C:\PHP738>php -r "odbc_connect();" Warning: odbc_connect() expects at least 3 parameters, 0 given in Command line code on line 1 C:\PHP738> --PHP script-- <?php if (!function_exists('odbc_connect')) { echo "<br><br><b>Function odbc_connect does not exist!</b><br>\n"; echo "Make sure that php.ini enables extension for odbc.<br>\n"; } else { -------- This error never occurs in 7.3.9RC1 or 7.4.0beta2, only in 7.3.8. Mysterious. The odbc functions work properly (odbc_connect, odbc_prepare, odbc_execute, odbc_num_rows) without php.ini enabled for odbc. It fails if I disable odbc in 7.3.8. ------------------------------------------------------------------------ [2019-08-17 16:42:54] cmb@php.net D:\Users\cmb>curl -L -s --output php-7.3.9RC1-nts-Win32-VC15-x64.zip https://windows.php.net/downloads/qa/php-7.3.9RC1-nts-Win32-VC15-x64.zip D:\Users\cmb>7z x -ophp-7.3.9RC1-nts-Win32-VC15-x64 php-7.3.9RC1-nts-Win32-VC15-x64.zip > nul D:\Users\cmb>cd php-7.3.9RC1-nts-Win32-VC15-x64 D:\Users\cmb\php-7.3.9RC1-nts-Win32-VC15-x64>php --ini Configuration File (php.ini) Path: C:\WINDOWS Loaded Configuration File: (none) Scan for additional .ini files in: (none) Additional .ini files parsed: (none) D:\Users\cmb\php-7.3.9RC1-nts-Win32-VC15-x64>php -m | findstr odbc D:\Users\cmb\php-7.3.9RC1-nts-Win32-VC15-x64>php -r "odbc_connect();" Fatal error: Uncaught Error: Call to undefined function odbc_connect() in Command line code:1 Stack trace: #0 {main} thrown in Command line code on line 1 ------------------------------------------------------------------------ [2019-08-17 15:59:32] dpfender44 at gmail dot com There is only one php.ini file and Fast CGI is use in IIS to process PHP files. When I initially saw the problem, I tried changing the php.ini file to enable and then disable the extension=odbc line and saw no difference. I even powered off the computer and then back on with the extension disabled and it still works. I also searched the php.ini file for all occurrences of the string 'odbc' looking for another string that might enable it, but found none. Testing on the same system with PHP 7.3.8 and the same PHP script, it detects when the function 'odbc_connect' is not available when changing the php.ini option. PHP 7.3.9RC1 and 7.4.0beta2 have the same symptom. I did not submit this bug report until I tested all 3 versions of PHP using the same PHP script. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=78423 -- Edit this bug report at https://bugs.php.net/bug.php?id=78423&edit=1

« previous php.bugs (#222296) next »