# curl -V
curl 7.67.0 (x86_64-suse-linux-gnu) libcurl/7.67.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.2/openssl/zlib nghttp2/1.39.2
Release-Date: 2019-11-06
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz Metalink NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
# php -v
PHP 7.4.0 (cli) ( NTS )
Any idea?
Many thanks in advance
Philippe
Tumbleweed upgraded PHP from 7.3 to 7.4 lately. This is a major upgrade and many php apps will fail. It broke my Nextcloud, for example. Granted, rpm had a warning which I chose to ignore. Had to restore php 7.3 from backup. And since this is the second time this happened, I will probably switch to docker nextcloud. Anyway, try your app with 7.3
Although a version change might work (and it would be a Q&D way of troubleshooting), those commands look very basic to me, so basic I’d be surprised if they were deprecated.
A 400 error suggests either a permissions problem (I’d think unlikely) or a file that is missing or can’t be read… Can the error be traced in a debugger? What IDE are you using if any?
As for deploying and “freezing” a particular subsystem version…
Deploying in a Docker container can be one way.
I’m sure that if a new version of PHP was released just now, you should still be able to find the previous version (7.3) in the openSUSE repositories and lock that version. I’d also ask why anyone would be deploying code on a TW intended for Production use where everything changes rapidly. Deploying on LEAP would slow the pace of versioning immensely.
markdd:
Tumbleweed upgraded PHP from 7.3 to 7.4 lately. This is a major upgrade and many php apps will fail. It broke my Nextcloud, for example. Granted, rpm had a warning which I chose to ignore. Had to restore php 7.3 from backup. And since this is the second time this happened, I will probably switch to docker nextcloud. Anyway, try your app with 7.3
I forced the reinstall of php7.3.11 from http://download.opensuse.org/history/20191116. But the problem is also present there
I use this curl functionnality quite rarely and it may not have been working for some time. As far as I remember last time that it worked was in August or September.
Regards
Philippe
tsu2:
A 400 error suggests either a permissions problem (I’d think unlikely) or a file that is missing or can’t be read… Can the error be traced in a debugger? What IDE are you using if any?
I use the Eclipse IDE. I can debug therein the PHP code and see the different data used. But cannot trace the curl itself. I need to search if a logging can be done for the curl itself.
Regards
Philippe
Did you look up what HTTP return code 400 means? You do realize that this is response from server, do not you? And that the problem has nothing to do with either PHP or curl (at least, the problem is not in the code you show):
bor@bor-Latitude-E5450:~/src/curl$ telnet catalogue.bnf.fr 80
Trying 194.199.8.30...
Connected to catalogue.bnf.fr.
Escape character is '^]'.
GET /api/SRU?version=1.2&operation=searchRetrieve&query=(bib.isbn%20all%20"9782877726351")%20and%20(bib.author%20all%20"Coulon")&recordSchema=unimarcxchange HTTP/1.1
HTTP/1.1 400 Bad Request
Date: Mon, 23 Dec 2019 17:34:50 GMT
Server: Apache
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</body></html>
Connection closed by foreign host.
bor@bor-Latitude-E5450:~/src/curl$
url generated is
http://catalogue.bnf.fr/api/SRU?version=1.2&operation=searchRetrieve&query=(bib.isbn%20all%20"9782877726351")%20and%20(bib.author%20all%20"Coulon")&recordSchema=unimarcxchange
This URL is invalid, the " should be percent-encoded too. It is possible that something changed in functions used to generate it. But it most certainly is unrelated to curl at all.
arvidjaar:
This URL is invalid, the " should be percent-encoded too. It is possible that something changed in functions used to generate it. But it most certainly is unrelated to curl at all.
Thanks I corrected this and now it works. I probably did a change using urlencode and forgot the double quote
Many thanks
Philippe