CURL doesn't working after upgrade PHP

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

CURL doesn't working after upgrade PHP

Postby Aar » 07. May 2024 19:05

Hello,

I've upgraded PHP in XAMPP from 8.1.2 to the 8.2.12. But CURL doesn't works.

I have downloaded XAMPP from this link: xampp-windows-x64-8.2.12-0-VS16.zip
Then I have renamed the old /php directory to /php_8_1_2 and i have placed the new PHP 8.2.12 from the /php in the zip-file into the /xampp directory.
PHP 8.2.12 runs perfectly after a reboot of XAMPP, but CURL doesn't work.

PHP gives the error that the CURL functions are not found:
Call to undefined function curl_init()

What happens? In the php.ini in /php (the newest) CURL is not disabled with a dot-comma character.

Code: Select all
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
; CUTTED TEXT HERE, YADDAH, BLAH, BLAH ;-)

extension=bz2

; The ldap extension must be before curl if OpenSSL 1.0.2 and OpenLDAP is used
; otherwise it results in segfault when unloading after using SASL.
; See https://github.com/php/php-src/issues/8620 for more info.
;extension=ldap

extension=curl
;extension=ffi
;extension=ftp
extension=fileinfo
;extension=gd
extension=gettext
;extension=gmp
;extension=intl
;extension=imap
extension=mbstring
extension=exif      ; Must be after mbstring as it depends on it
extension=mysqli
;extension=oci8_12c  ; Use with Oracle Database 12c Instant Client
;extension=oci8_19  ; Use with Oracle Database 19 Instant Client
;extension=odbc
;extension=openssl
;extension=pdo_firebird
extension=pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
extension=pdo_sqlite
;extension=pgsql
;extension=shmop

etc....


Why does CURL don't work?
User avatar
Aar
 
Posts: 29
Joined: 18. November 2014 18:36
Operating System: Windows and Linux (non XAMPP)

Re: CURL doesn't working after upgrade PHP

Postby Nobbie » 07. May 2024 19:56

Probably missing the Curl DLL? Is there a php_curl.dll in extensions folder?

That is one of many reasons why you *should not* upgrade PHP (or any other component of Xampp) by yourself. If you want to upgrade PHP etc., dont use Xampp. Xampp is not suitable for upgrading single components. Mostly it ended up like here with a corrupted installation.
Nobbie
 
Posts: 13212
Joined: 09. March 2008 13:04

Re: CURL doesn't working after upgrade PHP

Postby Aar » 07. May 2024 22:28

That is the first thing I checked, but it is certainly not missing, and is neatly in the /ext directory.
Furthermore, I know that PHP is the easiest to update. I've done that before with XAMPP. It's really not that closely intertwined with Apache. So I hope someone knows the solution.

Of course, I can also spend half an hour updating XAMPP (read: reinstalling it, transferring data and configuration, exporting and importing the database), but I am sure that the problem can be solved in a short time.
So I hope someone is willing to think along.
User avatar
Aar
 
Posts: 29
Joined: 18. November 2014 18:36
Operating System: Windows and Linux (non XAMPP)

Re: CURL doesn't working after upgrade PHP

Postby Altrea » 07. May 2024 23:24

XAMPP copies some of the php dlls into the Apache bin folder. Did you do this too?
- icudt71.dll
- icuin71.dll
- icuio71.dll
- icuuc71.dll
- libsasl.dll
- libssh2.dll

Alternatively you can add the PHP path to your Windows Path variable (but XAMPP philosophy is to be able to run without that).
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11949
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: CURL doesn't working after upgrade PHP

Postby Aar » 07. May 2024 23:38

I have copied those 6 files from the /php dir to the /bin of /apache.
But it doesn't work.

I have also read about setting the PHP path in Windows as an environment variable. But I don't know if this is correct?
The path to PHP is correct, but correct called in this dialog?

Image
User avatar
Aar
 
Posts: 29
Joined: 18. November 2014 18:36
Operating System: Windows and Linux (non XAMPP)

Re: CURL doesn't working after upgrade PHP

Postby Altrea » 08. May 2024 00:16

Aar wrote:But I don't know if this is correct?

It is not. There is a variable named Path. There you need to add the Path to your php folder.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11949
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: CURL doesn't working after upgrade PHP

Postby Nobbie » 08. May 2024 11:00

Aar wrote:Of course, I can also spend half an hour updating XAMPP (read: reinstalling it, transferring data and configuration, exporting and importing the database), but I am sure that the problem can be solved in a short time.


Actually, you think its better to offer our time instead of yours? Its obviously taking way more time to read your question, to understand the issue, to think about options, to ask about your configuration etc.pp. without having the option to test it and all of this for everybody reading the whole thread? All of this because only half an hour of your time isnt worth doing a clean installation? Wow...
Nobbie
 
Posts: 13212
Joined: 09. March 2008 13:04

Re: CURL doesn't working after upgrade PHP

Postby Aar » 08. May 2024 12:50

My bad, this was indeed the wrong place to add this path....

Now i have it added in the Path, like here:
Image

But, it still doesn't work.

Is there something what i can use te debug this problem?
Maybe a command in the CLI?

I can download XAMPP again, and transfer and install everything again. But that doesn't make you any wiser, although it can work. I'm curious about the solution. Maybe others can benefit from it.
User avatar
Aar
 
Posts: 29
Joined: 18. November 2014 18:36
Operating System: Windows and Linux (non XAMPP)

Re: CURL doesn't working after upgrade PHP

Postby cb » 11. May 2024 23:59

If you really want to go down this path then my suggestion is that there are files in the original PHP folder that are required for it to work. You could try reinstating the original PHP folder (keep another copy if you want) and then copy the new PHP files to overwrite the existing ones.

Have a look at https://community.apachefriends.org/f/viewtopic.php?f=16&t=82317&hilit=release+php&start=0

However, it might be easier/more reliable to export your databases using phpMyAdmin, uninstall Xammp, install the latest 8.2.12 version of Xampp and import your databases using phpMyAdmin.

The latest version of PHP is currently 8.3.7 and can be downloaded at https://windows.php.net/download
cb
cb
 
Posts: 38
Joined: 11. June 2008 22:48

Re: CURL doesn't working after upgrade PHP

Postby Aar » 12. May 2024 10:41

The point is that I just overwrite the entire /php folder with the new version. Then it should work fine, wouldn't you say?
After a shutdown of Apache I backup the old one by giving it the name 'PHP_', followed by the version number, so that I can easily downgrade in any case.
I would like to know why cURL is not working. It is one of the most used functions in PHP today.

Of course I can download and install a newer XAMPP, but that's like buying a new bike if your tire is flat. We now know that the problem does not appear to be in PHP. Or the latest XAMPP must also have the cURL bug on Windows, but I don't believe in that.
User avatar
Aar
 
Posts: 29
Joined: 18. November 2014 18:36
Operating System: Windows and Linux (non XAMPP)

Re: CURL doesn't working after upgrade PHP

Postby Nobbie » 12. May 2024 23:40

Aar wrote:Then it should work fine, wouldn't you say?


No. Why should it work fine?

Aar wrote:I would like to know why cURL is not working. It is one of the most used functions in PHP today.


Again no - who says that? I have written tons of PHP scripts and never used cURL

Aar wrote:Of course I can download and install a newer XAMPP, but that's like buying a new bike if your tire is flat.


Nonsense.

Aar wrote:We now know that the problem does not appear to be in PHP. Or the latest XAMPP must also have the cURL bug on Windows, but I don't believe in that.


I think its a problem of using different version of c-compilers for Xampp and the downloaded PHP. As PHP runs in "module" mode (as a DLL) it needs to be compiled with exactly the same environment as Apache.
Nobbie
 
Posts: 13212
Joined: 09. March 2008 13:04

Re: CURL doesn't working after upgrade PHP

Postby Aar » 13. May 2024 12:21

Nobbie wrote:Again no - who says that? I have written tons of PHP scripts and never used cURL

The fact that you've never used it means that others don't use it, or perhaps that's trying to insinuate that there are alternatives. In the time that people have been dealing a lot with APIs, this function has grown considerably, and I also have a lot of packages in Composer that use this. To be honest, this contribution of yours is not relevant to this problem. ;)

Nobbie wrote:Nonsense.

If you can argue this, it would be nice.

Nobbie wrote:I think its a problem of using different version of c-compilers for Xampp and the downloaded PHP. As PHP runs in "module" mode (as a DLL) it needs to be compiled with exactly the same environment as Apache.

This indeed sounds plausible. So the solution is to copy 'some' Apache files over as well.
Although I would have preferred an option that you could easily upgrade. It is a shame that XAMPP does not participate in this. Who knows in the future.

I would prefer to see if this can be debugged in any way. Because now it's pure gambling of course.
User avatar
Aar
 
Posts: 29
Joined: 18. November 2014 18:36
Operating System: Windows and Linux (non XAMPP)

Re: CURL doesn't working after upgrade PHP

Postby Nobbie » 13. May 2024 20:01

Aar wrote:The fact that you've never used it means that others don't use it


And vice verse. What makes you believing that cURL is one of the "most used" functions in PHP? Any proof?

Aar wrote:If you can argue this, it would be nice.


Again - vice verse. What is the relation between running a webserver and buying a bike?

Nobbie wrote:So the solution is to copy 'some' Apache files over as well.


No. The "solution" is simply a new Xampp installation, as recommended. It is simply your stubbornness that is holding you back from success.
Nobbie
 
Posts: 13212
Joined: 09. March 2008 13:04

Re: CURL doesn't working after upgrade PHP

Postby Aar » 13. May 2024 20:21

Nobbie wrote:And vice verse. What makes you believing that cURL is one of the "most used" functions in PHP? Any proof?

I don't think this is relevant to this thread. But I've seen it before in various scripts and packages.

Nobbie wrote:Again - vice verse. What is the relation between running a webserver and buying a bike?

I want to say that it is strange that because you have one small problem (curl module not working), that you then go and buy a new bike (install new XAMPP)

Nobbie wrote:No. The "solution" is simply a new Xampp installation, as recommended. It is simply your stubbornness that is holding you back from success.


That's possible, but there has to be a difference somewhere. That's why I'm still hoping for a good solution instead of a new installation. If there is no other way, then so be it, but I really don't believe in it.
There are probably some things that need to be debugged. But how?

I can also be very stubborn and install a new XAMPP, but will I learn anything from that? Not really....

The advantage of XAMPP is that it is not one software package, but separate components such as Apache, PHP and MariaDB that are connected in a simple way.
User avatar
Aar
 
Posts: 29
Joined: 18. November 2014 18:36
Operating System: Windows and Linux (non XAMPP)

Re: CURL doesn't working after upgrade PHP

Postby Aar » 15. May 2024 17:56

I find it very surprising that it doesn't work. I previously updated PHP in XAMPP on another machine from PHP 7 to PHP 8. I had to adjust some things in the vHost, but that was a piece of cake. PHP was updated and CURL worked.

But another computer, from PHP 8.1 to 8.2 does Curl break? Very remarkable.
I suspect a bug in XAMPP, Curl or somewhere in that chain?

I'm just going to reinstall everything. All very remarkable! :P
User avatar
Aar
 
Posts: 29
Joined: 18. November 2014 18:36
Operating System: Windows and Linux (non XAMPP)

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 66 guests