Matthew B
asked on
Error Running PHP Shell Command
I need to run a php script on my apache2 ubuntu server, i run php myscript.php and get an error ive never seen before in terminal
"The route is not found, check the URL"
The script is a curl request to register a webhook.
How can i run this script? ive run php scripts many times before from shell with no issues.
"The route is not found, check the URL"
The script is a curl request to register a webhook.
How can i run this script? ive run php scripts many times before from shell with no issues.
ASKER
ok i ran cURL with -V and --tlsv1.2 here is output, something to do with protocol, i am not using self signed certificate, i am using cert issued by lets encrypt, https works fine to access my web application via browser.
* Trying 104.195.95.6...
* Connected to api.bigcommerce.com (104.195.95.6) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certific ates.crt
* found 594 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA2 56
* server certificate verification OK
* server certificate status verification SKIPPED
* common name: *.bigcommerce.com (matched)
* server certificate expiration date OK
* server certificate activation date OK
* certificate public key: RSA
* certificate version: #3
* subject: C=AU,ST=New South Wales,L=Ultimo,O=Bigcommer ce Pty Ltd,CN=*.bigcommerce.com
* start date: Mon, 07 Dec 2015 00:00:00 GMT
* expire date: Wed, 13 Feb 2019 12:00:00 GMT
* issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert SHA2 High Assurance Server CA
* compression: NULL
* ALPN, server did not agree to a protocol
> POST /stores/mystore/v3/hooks HTTP/1.1
> Host: api.bigcommerce.com
> User-Agent: curl/7.47.0
> Accept: application/json
> Cache-Control: no-cache
> Content-Type: application/json
> X-Auth-Client: client
> X-Auth-Token: token
> Content-Length: 196
>
* upload completely sent off: 196 out of 196 bytes
< HTTP/1.1 404 Not Found
< Date: Mon, 18 Jun 2018 01:16:50 GMT
< Content-Type: text/plain; charset=UTF-8
< Content-Length: 37
<
* Connection #0 to host api.bigcommerce.com left intact
* Trying 104.195.95.6...
* Connected to api.bigcommerce.com (104.195.95.6) port 443 (#0)
* found 148 certificates in /etc/ssl/certs/ca-certific
* found 594 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA2
* server certificate verification OK
* server certificate status verification SKIPPED
* common name: *.bigcommerce.com (matched)
* server certificate expiration date OK
* server certificate activation date OK
* certificate public key: RSA
* certificate version: #3
* subject: C=AU,ST=New South Wales,L=Ultimo,O=Bigcommer
* start date: Mon, 07 Dec 2015 00:00:00 GMT
* expire date: Wed, 13 Feb 2019 12:00:00 GMT
* issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert SHA2 High Assurance Server CA
* compression: NULL
* ALPN, server did not agree to a protocol
> POST /stores/mystore/v3/hooks HTTP/1.1
> Host: api.bigcommerce.com
> User-Agent: curl/7.47.0
> Accept: application/json
> Cache-Control: no-cache
> Content-Type: application/json
> X-Auth-Client: client
> X-Auth-Token: token
> Content-Length: 196
>
* upload completely sent off: 196 out of 196 bytes
< HTTP/1.1 404 Not Found
< Date: Mon, 18 Jun 2018 01:16:50 GMT
< Content-Type: text/plain; charset=UTF-8
< Content-Length: 37
<
* Connection #0 to host api.bigcommerce.com left intact
What's your server's OS?
Check your OpenSSL version?
Outdated SSL protocol/ciphers?
Check your OpenSSL version?
Outdated SSL protocol/ciphers?
ASKER
apache2/2.4.33
ubuntu 16.04
openssl 1.1.1
ubuntu 16.04
openssl 1.1.1
Have you tested for http/2?
https://tools.keycdn.com/http2-test
Here's more info on HTTP/2 setup:
https://httpd.apache.org/docs/2.4/howto/http2.html
Also, check your cipher and make sure it is not on the blacklist:
https://httpwg.org/specs/rfc7540.html#BadCipherSuites
https://tools.keycdn.com/http2-test
Speaking of SSL, you need to be aware that most browsers will speak HTTP/2 only on https: URLs, so you need a server with SSL support. But not only that, you will need a SSL library that supports the ALPN extension. If OpenSSL is the library you use, you need at least version 1.0.2
Here's more info on HTTP/2 setup:
https://httpd.apache.org/docs/2.4/howto/http2.html
Also, check your cipher and make sure it is not on the blacklist:
https://httpwg.org/specs/rfc7540.html#BadCipherSuites
ASKER
tested http/2 all good
ALPN accepted
here are API pre reqs that i am sending too..
Any one of the following will cause a connection failure:
Hostname/DNS mismatch. - not an issue
Self-signed certificate. - not using
Intermediate certificates not loaded. - not using
Before you can send any requests or receive any responses, you will need the following:
A store: You can get a sandbox store by joining the Partner Program.
OAuth Client ID: Obtained during App Registration. - i have
OAuth token: Obtained during App Installation. - i have
Valid TLS/SSL setup: Verify your setup at the following site: https://sslcheck.globalsign.com. - checked, passed
ALPN accepted
here are API pre reqs that i am sending too..
Any one of the following will cause a connection failure:
Hostname/DNS mismatch. - not an issue
Self-signed certificate. - not using
Intermediate certificates not loaded. - not using
Before you can send any requests or receive any responses, you will need the following:
A store: You can get a sandbox store by joining the Partner Program.
OAuth Client ID: Obtained during App Registration. - i have
OAuth token: Obtained during App Installation. - i have
Valid TLS/SSL setup: Verify your setup at the following site: https://sslcheck.globalsign.com. - checked, passed
Are you POSTing to HTTP instead of HTTPS in your form action?
Is ALPN configured to negotiate h2?
What does this output from your console?
POST /stores/mystore/v3/hooks HTTP/1.1
* ALPN, offering http/1.1
Is ALPN configured to negotiate h2?
What does this output from your console?
curl -v
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Provide more context, like a copy of your code + exact command line options, if you're using any.
Likely someone can assist.
Or... better... wrap all your system calls with error checking + emit clear diagnostics at the point where you have the failure. Likely this will allow you to easily pinpoint the problem.
All this said, if you're running a Linux Distro with systemd-resolved running (rather than named or dnsmasq or any other local caching DNS server) you may be hitting one of the many known systemd-resolved bugs.
Test: Determine the URL or IP your referencing (should be emitted as part of your diagnostic when you catch system call errors/exceptions)...
Then on the command line, issue the command directly + see if you get the same route error.
You can also likely just ping the URL emitted + see the route problem.
If you're running any type of networking management package managed by SNAP, like LXD, you'll also hit the SNAP update problem, where all manual routes added to lxdbr0 are dropped anytime SNAP auto updates it's packages at random times... depending on your your Distro manages SNAP packages...
If you add a manual route + your code works, then mysteriously stops working... likely this is due to the related interface (usually a bridge or VETH or other virtual interface) being killed off during a package update + recreated...
So you'll see all your interfaces + route will show your routes have disappeared.
On all my machines now I run a script called route-reviver every 1 second + anytime a manual route disappears, the script regenerates the route.