Xampp 7.3 looking in wrong directory for dll extensions

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Xampp 7.3 looking in wrong directory for dll extensions

Postby TomXampp » 20. December 2018 03:01

The extension directives in php.ini are not looking in the correct directory.

Starting with the Xampp 7.2.#, the extension directives did not require the 'php_' prefix nor the '.dll' file extension, hence, to specify php_bz2.dll, you only needed to provide:

Code: Select all
extension=bz2


...and it would locate the dll in C:\xampp\php\ext\, which is where the extensions are located by default on my Windows set-up.

When I upgraded to Xampp 7.3, I received an error message for each of the extensions specified in php.ini, each like this:

[20-Dec-2018 01:55:08 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'php_bz2' (tried: C:\php\ext\php_bz2 (The specified module could not be found.), C:\php\ext\php_php_bz2.dll (The specified module could not be found.)) in Unknown on line 0


The error here is that Xampp is looking for the extensions in C:\php\ext, not in C:\Xampp\php\ext, where they're kept on my system.

The work-around is to spell out the location in full, like this:

Code: Select all
extension=C:\Xampp\php\ext\php_bz2.dll


This works, but it's inconvenient.

Is the directory location of the extensions stored in a variable anywhere, either in an INI file or an environment variable? If I could edit it once there, I'd be spared having to specify the full path name of the file each time.

Many thanks,
Tom
TomXampp
 
Posts: 59
Joined: 12. March 2015 03:58
Operating System: Windows 8.1

Re: Xampp 7.3 looking in wrong directory for dll extensions

Postby Nobbie » 20. December 2018 12:35

TomXampp wrote:...and it would locate the dll in C:\xampp\php\ext\, which is where the extensions are located by default on my Windows set-up.


Nonsense. PHP does not know anything about Xampp. Its due to the value of extension_dir in php.ini.

TomXampp wrote:Is the directory location of the extensions stored in a variable anywhere, either in an INI file or an environment variable?


http://php.net/manual/en/ini.core.php#ini.extension-dir

I just downloaded and installed Xampp 7.3 for Windows, in php.ini there is

Code: Select all
extension_dir="C:\xampp\php\ext"


and all extensions are loading from C:\xampp\php\ext. Probably you must have changed something in php.ini, out of the box it runs fine.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Xampp 7.3 looking in wrong directory for dll extensions

Postby fritzmg » 05. March 2019 08:15

Just to clarify: does this mean in current XAMPP (or PHP?) versions, settings like

Code: Select all
extension = intl

work interchangeably on Unix and Windows? Since before you had to set the actuall DLL file, e.g.

Code: Select all
extension = php_intl.dll
fritzmg
 
Posts: 2
Joined: 05. March 2019 08:12
XAMPP version: 7.3
Operating System: Windows 10

Re: Xampp 7.3 looking in wrong directory for dll extensions

Postby Nobbie » 05. March 2019 15:05

http://php.net/manual/en/install.pecl.windows.php

Loading an extension

The most common way to load a PHP extension is to include it in your php.ini configuration file. Please note that many extensions are already present in your php.ini and that you only need to remove the semicolon to activate them.

Note that, on PHP version 7.2.0 and up, the extension name may be used instead of the extension's file name. As this is OS-independent and easier, especially for newcomers, it becomes the recommended way of specifying extensions to load. File names remain supported for compatibility with prior versions.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Xampp 7.3 looking in wrong directory for dll extensions

Postby fritzmg » 05. March 2019 15:09

Thx :)
fritzmg
 
Posts: 2
Joined: 05. March 2019 08:12
XAMPP version: 7.3
Operating System: Windows 10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 113 guests