curl_init error after swapping PHP versions
Posted by: dawgbone98 (---.beanfield.net)
Date: December 01, 2017 06:53PM

I recently used the addons to updated WAMP from 3.0.0 to 3.1.1 and also added php versions 7.1.12 and 7.2.0.

When I switch from PHP 7.0.0 to either of the later versions I get the following error when I make a curl call:

Fatal error: Uncaught Error: Call to undefined function curl_init()

When I change back to 7.0.0 it works fine. After doing some searches there are recommendations to move libssh2.dll, ssleay32.dll, libeay32.dll and php_curl.dll into the apache folder, but those already have symlinks to the file locations (they exist in those locations, I checked).

Options: ReplyQuote
Re: curl_init error after swapping PHP versions
Posted by: Otomatic (Moderator)
Date: December 01, 2017 07:38PM

Hi,

> I get the following error when I make a curl call:
> Fatal error: Uncaught Error: Call to undefined function curl_init()
What do you mean by "a curl call"?
- running a command line script
- running a curl instruction within a web application

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: curl_init error after swapping PHP versions
Posted by: themezly (---.dynamic.sbb.rs)
Date: December 22, 2017 04:18PM

> What do you mean by "a curl call"?

Means use any curl function like curl_init()
the curl is simply not available


win 10 64
wamp 3.1.1
php , 5.6.19, .7.2 and 7.04

curl works on 5.6.19 and 7.0.4

I checked php.ini in apoache folder and it is a simlink to T:\wamp64\bin\php\php7.2.0\ext

extension_dir is T:\wamp64\bin\php\php7.2.0\ext which is correct but curl is not present

Options: ReplyQuote
Re: curl_init error after swapping PHP versions
Posted by: Otomatic (Moderator)
Date: December 22, 2017 04:47PM

Hi,





---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: curl_init error after swapping PHP versions
Posted by: themezly (---.dynamic.sbb.rs)
Date: December 22, 2017 04:55PM

I dont know how your images are showing what I should do but

[prntscr.com] dll is there


curl not loaded [prntscr.com]

curl is checked in tray and uncommentent in ini


[prntscr.com]

Options: ReplyQuote
Re: curl_init error after swapping PHP versions
Posted by: themezly (---.dynamic.sbb.rs)
Date: December 22, 2017 05:09PM

Solution for anyone who runs in to this



Apache 2.4.18 for some reasn does not load php 7.2 curl

I updated my Apache to 2.4.29 and curl loaded instantly

Options: ReplyQuote
Re: curl_init error after swapping PHP versions
Posted by: Otomatic (Moderator)
Date: December 22, 2017 06:05PM

Hi,

At the bottom of your localhost page there is a message :

It's a bad idea to add localhost in the url of launching projects. It is best to define VirtualHost in wamp/bin/apache/apache2.4.x/conf/extra/httpd-vhosts.conf file and not add localhost in the url.

For the moment everything seems to be working well, but sooner or later you will have problems, such as no access to the administration of WordPress, Joomla or any other CMS. You may also have major problems transferring sites between development and production.
This is why, as with all hosts, it is highly recommended to use VirtualHost and remove this option to add localhost to urls.
See : The need for Virtual Host

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.