Page 1 of 1

Xampp 7.3 looking in wrong directory for dll extensions

PostPosted: 20. December 2018 03:01
by TomXampp
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

Re: Xampp 7.3 looking in wrong directory for dll extensions

PostPosted: 20. December 2018 12:35
by Nobbie
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.

Re: Xampp 7.3 looking in wrong directory for dll extensions

PostPosted: 05. March 2019 08:15
by fritzmg
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

Re: Xampp 7.3 looking in wrong directory for dll extensions

PostPosted: 05. March 2019 15:05
by Nobbie
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.

Re: Xampp 7.3 looking in wrong directory for dll extensions

PostPosted: 05. March 2019 15:09
by fritzmg
Thx :)