cURL Installed but Not Detected in PHP info

sibipaul

Well-Known Member
#1
Hello,

Due to My WordPress Dashboard Warnings... I was Trying to Install cURL.

But, After some research, I came to Understand that cURL is Installed by Default, But the Version is 7.29

So, I think about Upgrading it.

After Posting on this Forum - https://www.litespeedtech.com/support/forum/threads/how-to-update-curl.18424/

I found This URL - https://www.litespeedtech.com/suppo...sion:curl#compile_and_install_the_latest_curl

The DOC for Update cURL

in This Doc, cURL 7.67 was Installed.

I was looking to get the Latest Version, After checking Their site... I came to Understand 7.69.1 is stable

Then, I just Modified the code as seen below.

Code:
wget https://curl.haxx.se/download/curl-7.69.1.tar.gz
tar xzvf curl-7.69.1.tar.gz
cd curl-7.69.1
./configure
make
make install
Then, I run this command to check cURL Installed Latest or NOT

Code:
curl -V
SSH Window showed the V 7.69.1

Then, I modified and run those PHP Commands as seen below.

Code:
wget https://www.php.net/distributions/php-7.4.4.tar.gz

tar xzvf php-7.4.4.tar.gz

cd php-7.4.4/ext/curl

/usr/local/lsws/lsphp74/bin/phpize

./configure --with-php-config=/usr/local/lsws/lsphp74/bin/php-config --with-curl=/usr/local/bin

make

make install
Then, I run
Code:
reboot
After reboot
Code:
curl -V
shows 7.69.1

But, My WordPress Dashboard not Solved the Warning.

So, I created a PHP Info File and Checked it...

There No Informations About cURL.

is there any Mistake I did?
 

sibipaul

Well-Known Member
#3
Kindly Check my SSH Log for Popular Commands Related to cURL

Code:
Using username "root".
Authenticating with public key "server-cloud"
Passphrase for key "server-cloud":
Last failed login: Thu Apr  9 22:40:11 UTC 2020 from 190.5.141.77 on ssh:notty
There was 1 failed login attempt since the last successful login.
Last login: Thu Apr  9 22:33:40 2020 from [IP]

This server has installed CyberPanel.
Visit  https://www.cyberpanel.net
Forum  https://forums.cyberpanel.net
Log in https://[IP]:8090

Current Server time : 2020-04-09 22:42:13.
Current Load average: 0.09, 0.11, 0.07
Current CPU usage   : 5.52546%.
Current RAM usage   : 348/1837MB (18.94%).
Current Disk usage  : 7/50GB (16%).
System uptime       : 0 days, 0 hours, 26 minutes.

Enjoy your accelerated Internet by CyberPanel.

[root@sibipaul ~]# yum install curl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.hostduplex.com
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: mirror.hostduplex.com
 * updates: mirror.sjc02.svwh.net
Package curl-7.29.0-54.el7_7.2.x86_64 already installed and latest version
Nothing to do
[root@sibipaul ~]# yum install php-curl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.hostduplex.com
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: mirror.hostduplex.com
 * updates: mirror.sjc02.svwh.net
Package php-common-5.4.16-46.1.el7_7.x86_64 already installed and latest version
Nothing to do
[root@sibipaul ~]# yum install php74-curl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.hostduplex.com
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: mirror.hostduplex.com
 * updates: mirror.sjc02.svwh.net
No package php74-curl available.
Error: Nothing to do
[root@server ~]#
is there something else I can do?
 

NiteWave

Administrator
#4
in your phpinfo page,
extension_dir /usr/local/lsws/lsphp74/lib64/php/modules /usr/local/lsws/lsphp74/lib64/php/modules
Additional .ini files parsed /usr/local/lsws/lsphp74/etc/php.d/20-curl.ini

what's the content of /usr/local/lsws/lsphp74/etc/php.d/20-curl.ini ?
does /usr/local/lsws/lsphp74/lib64/php/modules/curl.so exist ?
 

sibipaul

Well-Known Member
#5
what's the content of /usr/local/lsws/lsphp74/etc/php.d/20-curl.ini ?

I opened that 20-curl.ini file, and the inside code shows as below.

Code:
; Enable curl extension module
extension=curl.so
does /usr/local/lsws/lsphp74/lib64/php/modules/curl.so exist ?

Yes, there is a File, Name: " curl.so "

Along with many .so files
 

sibipaul

Well-Known Member
#6
for PHP 7.3

This Method Exactly Works

My PHP version was 7.3.16

So I Modified the Code Like this

Code:
wget https://curl.haxx.se/download/curl-7.67.0.tar.gz
tar xzvf curl-7.67.0.tar.gz
cd curl-7.67.0
./configure
make
make install
Code:
curl -V
Code:
wget https://www.php.net/distributions/php-7.3.16.tar.gz

tar xzvf php-7.3.16.tar.gz

cd php-7.3.16/ext/curl

/usr/local/lsws/lsphp73/bin/phpize

./configure --with-php-config=/usr/local/lsws/lsphp73/bin/php-config --with-curl=/usr/local/bin

make

make install
Code:
make test
Everything Installed Correctly...

But, When RUN the
Code:
Make Test
command, After RUN, some error like something shown.

But, I rebooted SSH

and tested my WordPress Dashboard + PHP Info Page.

I Could see cURL in PHP Page, also WP Dashboard cURL error disappeared.

Remember My Website Chosen PHP 7.3 in Cyber Panel.

Later, I changed it Back to PHP 7.4

Again, RUN The above Command, Modified like below


Code:
wget https://curl.haxx.se/download/curl-7.67.0.tar.gz
tar xzvf curl-7.67.0.tar.gz
cd curl-7.67.0
./configure
make
make install
Code:
curl -V
Code:
wget https://www.php.net/distributions/php-7.4.4.tar.gz

tar xzvf php-7.4.4.tar.gz

cd php-7.4.4/ext/curl

/usr/local/lsws/lsphp74/bin/phpize

./configure --with-php-config=/usr/local/lsws/lsphp74/bin/php-config --with-curl=/usr/local/bin

make

make install
Code:
make test
Now, PHP info Page NOT Showing cURL Details.

Also, WordPress Having the Same cURL Error.

So,

https://www.litespeedtech.com/suppo...sion:curl#compile_and_install_the_latest_curl

This Tutorial Works Only for PHP 7.3

Do, something for Latest PHP 7.4.4

Thanks.
 

sibipaul

Well-Known Member
#7
Then

I RUN These Commands

Code:
wget https://curl.haxx.se/download/curl-7.69.1.tar.gz
tar xzvf curl-7.69.1.tar.gz
cd curl-7.69.1
./configure
make
make install
Code:
wget https://www.php.net/distributions/php-7.4.4.tar.gz

tar xzvf php-7.4.4.tar.gz

cd php-7.4.4/ext/curl

/usr/local/lsws/lsphp74/bin/phpize

./configure --with-php-config=/usr/local/lsws/lsphp74/bin/php-config --with-curl=/usr/local/bin

make

make install
Code:
reboot
Still the Same problem.

Tell me what I can do now?

NB: When I choose PHP 7.3 Everything Works Good.

But, Problem with PHP 7.4
 

sibipaul

Well-Known Member
#8
Then I Run Few More Common Commands, and You can see the Results HERE.

Code:
This server has installed CyberPanel.
Visit  https://www.cyberpanel.net
Forum  https://forums.cyberpanel.net
Log in https://*****:8090

Current Server time : 2020-04-10 18:23:03.
Current Load average: 0.03, 0.15, 0.08
Current CPU usage   : 8.86218%.
Current RAM usage   : 362/1837MB (19.71%).
Current Disk usage  : 8/50GB (18%).
System uptime       : 0 days, 0 hours, 4 minutes.

Enjoy your accelerated Internet by CyberPanel.

[root@sibipaul ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.hostduplex.com
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: mirror.hostduplex.com
 * updates: mirror.sjc02.svwh.net
No packages marked for update
[root@sibipaul ~]# yum install curl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.hostduplex.com
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: mirror.hostduplex.com
 * updates: mirror.sjc02.svwh.net
Package curl-7.29.0-54.el7_7.2.x86_64 already installed and latest version
Nothing to do
[root@sibipaul ~]# yum install php-curl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.hostduplex.com
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: mirror.hostduplex.com
 * updates: mirror.sjc02.svwh.net
Package php-common-5.4.16-46.1.el7_7.x86_64 already installed and latest version
Nothing to do
[root@sibipaul ~]# yum install php74-curl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.hostduplex.com
 * epel: mirror.sfo12.us.leaseweb.net
 * extras: mirror.hostduplex.com
 * updates: mirror.sjc02.svwh.net
No package php74-curl available.
Error: Nothing to do
[root@sibipaul ~]#
Did You noticed,

When I RUN This Command

Code:
yum install php74-curl
I'm getting This Reply

Code:
No package php74-curl available.

Error: Nothing to do
I Hope, Now You can get an idea about this.
 

NiteWave

Administrator
#9
can you PM (private message) your server's ssh access, so I can check what's happened on php 7.4

p.s. you no need "yum install php74-curl", it's for apache
 
#10
NB: When I choose PHP 7.3 Everything Works Good.

But, Problem with PHP 7.4
yes, looks like I can confirm the issue.

when access phpinfo page. in stderr.log
PHP Warning: PHP Startup: Unable to load dynamic library 'curl.so' (tried: /usr/local/lsws/lsphp74/lib64/php/modules/curl.so (/usr/local/lsws/lsphp74/lib64/php/modules/curl.so: undefined symbol: curl_mime_type), /usr/local/lsws/lsphp74/lib64/php/modules/curl.so.so (/usr/local/lsws/lsphp74/lib64/php/modules/curl.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

I'll ask our staff who write the wiki to try on 7.4.4
 

qtwrk

Well-Known Member
#13
it works on my test

ScreenShot2020-04-12 19.03.00.png

check if you have /usr/local/lsws/lsphp74/etc/php.d/40-imagick.ini and /usr/local/lsws/lsphp74/lib64/php/modules/imagick.so
 

sibipaul

Well-Known Member
#18
Thank You very much Admin and qtwrk.

cURL issue with PHP 7.4.4 is now Fixed.

So, Can I try these steps ( https://www.litespeedtech.com/suppo...sion:curl#compile_and_install_the_latest_curl )

in my main Server?

I also Have Doubts...

Before this fix, we tried different versions Installed and tried different commands...

How to remove those unwanted files and folders from this server?

I mean, different PHP versions, and Different cURL Versions...

where I can find them and remove forever.

I only want to use PHP 7.4.4 and Latest cURL for all my sites...
 

qtwrk

Well-Known Member
#19
not sure what command you did , but just try to do a reverse way

personally I wouldn't suggest you to do that unless you have full understanding and knowledge about what exactly you are deleting , otherwise I would just waste some disk space , rather safe than sorry
 
Top