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

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.1 32 bit - Apache 2.4.29 - PHP 7.2.2/7.1.14/7.0.27/5.6.33 - MySQL 5.7.21 - MariaDB 10.2.12
Wampserver 3.1.1 64 bit - Apache 2.4.29 - PHP 7.2.2/7.1.14/7.0.27/5.6.33 - MySQL 5.7.21 - MariaDB 10.2.12
PhPMyAdmin 4.7.7 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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,





------------------------------------------------------------------------------------------------------------
Wampserver 3.1.1 32 bit - Apache 2.4.29 - PHP 7.2.2/7.1.14/7.0.27/5.6.33 - MySQL 5.7.21 - MariaDB 10.2.12
Wampserver 3.1.1 64 bit - Apache 2.4.29 - PHP 7.2.2/7.1.14/7.0.27/5.6.33 - MySQL 5.7.21 - MariaDB 10.2.12
PhPMyAdmin 4.7.7 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

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

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.1 32 bit - Apache 2.4.29 - PHP 7.2.2/7.1.14/7.0.27/5.6.33 - MySQL 5.7.21 - MariaDB 10.2.12
Wampserver 3.1.1 64 bit - Apache 2.4.29 - PHP 7.2.2/7.1.14/7.0.27/5.6.33 - MySQL 5.7.21 - MariaDB 10.2.12
PhPMyAdmin 4.7.7 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote


Sorry, only registered users may post in this forum.