Tuxman
Tuxman

Reputation: 398

Laragon load some php extensions on CLI but not load in Apache (curl, intl, pdo_pgsql)

I'm trying to load a php environment with Laragon in Windows 10.

When I start Apache, in php_errors.log file I get this warnings:

[13-Sep-2024 01:03:32 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'curl' (tried: C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\ext\curl (No se puede encontrar el módulo especificado), C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\ext\php_curl.dll (No se puede encontrar el módulo especificado)) in Unknown on line 0
[13-Sep-2024 01:03:32 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'intl' (tried: C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\ext\intl (No se puede encontrar el módulo especificado), C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\ext\php_intl.dll (No se puede encontrar el módulo especificado)) in Unknown on line 0
[13-Sep-2024 01:03:32 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'pdo_pgsql' (tried: C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\ext\pdo_pgsql (No se puede encontrar el módulo especificado), C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\ext\php_pdo_pgsql.dll (No se puede encontrar el módulo especificado)) in Unknown on line 0

When I show a phpinfo() output, effectively curl, intl and pfo_pgsql are not loaded. But if I run php -m in the terminal, the extensions are loaded.

C:\laragon\www
λ php -m
[PHP Modules]
bcmath
calendar
Core
ctype
curl
date
...
iconv
intl
json
...
PDO
pdo_mysql
pdo_pgsql
Phar
...

The ini file is the same on CLI and Apache.

In CLI

C:\laragon\www
λ php --ini
Configuration File (php.ini) Path:
Loaded Configuration File:         C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

In Apache (using PHP Info)

an output of the php info showing the path of php.ini

The *.dlls files are present in the directory C:\laragon\bin\php\php-8.1.10-Win32-vs16-x64\ext\

a capture of windows explorer showing the dlls in the directory mentioned above

Upvotes: 0

Views: 128

Answers (1)

Tuxman
Tuxman

Reputation: 398

The problem it was the PHP default version of Laragon package.

I try to add new PHP versions using the links of the Wiki Page, install new PHP version 8.1.29 and enable the pdo_pgsql extension, and all works fine.

Extra info: The old version of PHP in the package was 8.1.10 and not include nts in his name. The new version is 8.1.29. IDK if this is relevant.

capture of different versions of PHP added to Laragon

Upvotes: 0

Related Questions