Solved PHP from cronjob giving errors

Daniel_Dog

Verified User
Joined
Nov 16, 2019
Messages
446
I am trying to execute a PHP script that I made via conjobs on a schedule.
When I try to run it via cronjobs nothing happens.
I also tried the command manually but it gives the following error:
/usr/local/bin/php -q /home/**the user**/domains/**the domain**/public_html/**some folders**/lifetime.php
/usr/local/bin/php: /usr/local/lib/libcurl.so.4: no version information available (required by /usr/local/bin/php)
I compiled cURL from CustomBuilds 2.0 and I made sure cURL was not installed on the system.
Also my DirectAdmin got installed today and thus is still a clean install.

My system/setup info:
DirectAdmin: 1.61.5
cURL: 7.75.0
PHP: 7.4 as php-fpm
 
When I execute /usr/local/bin/curl --version and curl --version I get:
/usr/local/bin/curl --version
curl 7.75.0 (x86_64-pc-linux-gnu) libcurl/7.75.0 OpenSSL/1.1.1d zlib/1.2.11 zstd/1.3.8 nghttp2/1.36.0
Release-Date: 2021-02-03
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets zstd
So curl is not installed multiple times?
 
Hmmm.......
root@directadmin:/usr/bin# curl
curl: try 'curl --help' or 'curl --manual' for more information
root@directadmin:/usr/bin# apt remove curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'curl' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
 
So if you do:
whereis curl
you only get 1 binary?

Maybe multiple versions of libcurl.so.4.
Try:
locate libcurl.so.4

and
find / -name libssl.so*

Which OS are you using? Installed openssl via apt?
 
Output from "Whereis curl" (And yes it only gives me 1 location.)
curl: /usr/local/bin/curl
Output from "locate libcurl.so.4"
-bash: locate: command not found
Output "find / -name libssl.so*"
/usr/lib/x86_64-linux-gnu/libssl.so
/usr/lib/x86_64-linux-gnu/libssl.so.1.1
/usr/lib/libssl.so
And I use Debian 10 as OS.
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
 
You might try this:
apt-get install libcurl3

If already present or it does not help, then somebody else needs to help you.
 
You might try this:
apt-get install libcurl3

If already present or it does not help, then somebody else needs to help you.
When I run “apt-get install libcurl3” it says:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libcurl3 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libcurl4

E: Package 'libcurl3' has no installation candidate
And when i run “apt-get install libcurl4” it says:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcurl4 is already the newest version (7.64.0-4+deb10u2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
 
Oke, I created a ticket with DirectAdmin and they found out that I forgot (And I did not know this) to rebuild PHP after building cURL and thus giving this warning. (Even tho i thought it was an error. But I found out my PHP script was the issue.)

So after building cURL with CustomBuilds you need to run:
./build php n
 
Back
Top