php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80969 Default value for extension_dir setting doesn't work in Windows
Submitted: 2021-04-19 10:25 UTC Modified: 2021-05-05 16:26 UTC
From: marioneumann at gmail dot com Assigned: cmb (profile)
Status: Wont fix Package: PHP options/info functions
PHP Version: 7.4.16 OS: Windows 10
Private report: No CVE-ID: None
 [2021-04-19 10:25 UTC] marioneumann at gmail dot com
Description:
------------
php.ini on Windows (default, production):

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
;extension_dir = "./"
; On windows:
;extension_dir = "ext"

The issue is that default doesnt work on Windows. You have to uncomment extension_dir = "ext", otherwise PHP wont run if you uncomment extensions.



Expected result:
----------------
Windows extensions work right away


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-19 11:03 UTC] imsop@php.net
-Summary: not harmful but could be better +Summary: Default php.ini value for extension_dir doesn't work in Windows
 [2021-04-19 11:04 UTC] cmb@php.net
-Summary: Default php.ini value for extension_dir doesn't work in Windows +Summary: not harmful but could be better
 [2021-04-19 11:04 UTC] cmb@php.net
On Windows, the default value is actually the value of
PHP_EXTENSION_DIR (which is basically undocumented[1]).  That value
is actually PHP_PREFIX."\\ext", and the prefix can be configured
(--with-prefix) during build time.  The official binaries use the
default (C:\php for non debug builds).

I think this is basically the same on other operating systems.
Not sure what to do about php.ini.

[1] <https://www.php.net/manual/en/reserved.constants.php>
 [2021-04-19 11:15 UTC] imsop@php.net
-Summary: not harmful but could be better +Summary: Default value for extension_dir setting doesn't work in Windows
 [2021-04-19 11:15 UTC] imsop@php.net
Looks like we both hit edit at the same time :)
 [2021-04-19 12:23 UTC] marioneumann at gmail dot com
I had to uncomment it first to reach that extensions work at all and its always in ext folder on windows anyway. So I'd say its a bug and default value should be "ext" and not whatever it is.
 [2021-04-19 13:24 UTC] cmb@php.net
The relative path ext doesn't work for all SAPIs, e.g.
Apache2Handler needs an absolute path.
 [2021-05-05 16:26 UTC] cmb@php.net
-Status: Open +Status: Wont fix -Assigned To: +Assigned To: cmb
 [2021-05-05 16:26 UTC] cmb@php.net
PHP_EXTENSION_DIR is now documented[1].  I think we should leave
php.ini alone.

[1] <https://github.com/php/doc-en/commit/304f2b04c9b66ad3cea00b0e6aa97322b7de9935>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC