I've written some API code for a project of mine, on my local machine (Wampserver), there's no problem sending custom request methods, and the stack handles them the same as GET and POST.
In Cloud9, however, all the basic methods go to the application bootstrap (a PHP file), but custom method names, for example "GENERATE", which I totally made-up, is stopped before the PHP bootstrapper with the following message: "Something went wrong! Server timed out or sent incomplete response" with error code 502.
I attempted to investigate and fix it myself, but couldn't. I don't even know which behaviour (Wampserver or Cloud9) is the default expected behaviour.
Can anyone help? How do I tell Cloud9 instances to handle custom methods the same as regular ones?
Related
I am having trouble with several php files.
The problem is when I try to access my WebApp in said php files it results in a 503 error. Both files have API calls to different services that have worked perfectly until yesterday. When I remove the API call from the code the WebApp opens with no problem. I called both API services and they are both getting the API requests made from my server with no problem.
I've already exhausted all options to fix this error but came up with no results.
Any help is valid.
Thank you so much.
I've tried to change PHP version, but as I said there is no problem with PHP. Removing the API call makes the webapp function normally.
I created an application using php slim 4. When I submit a form with a file attached to it, It works perfectly on my local machine but when I hosted it on the server, it also works but only a certain conditions.
If the filename has some certain characters, the application throws an 405 HttpMethodNotAllowed exception.
With the same filename, I tested it on previous applications I hosted using php slim 4 as well but they work well on those servers.
I later tried to use slim 4 methodoverridemiddleware by adding an X-Http-Method-Override with a POST value header to force the request method to POST. It doesn't throw the 405 HttpMethodNotAllowed anymore but the request strips off the body of the file.
Please has anyone ever experienced this before and what do you think might be the solution
In trying to follow the Hello Analytics API (https://developers.google.com/analytics/solutions/articles/hello-analytics-api) I have found many issues. I have downloaded it off github as described. The problem is: The API comes with errors itself. Firstly it has many internal (files from within the api to other files within the api) link errors. It does not link correctly to its other files. I was able to fix this
But, some functions that the class in the API provides are incorrect as well. There are errors that exist within the php files the api provides. Such as :
Call to undefined method Google_Http_Request::getItems().
This is due to a incorrect return type
In conclusion the API comes with errors within itself! How has anyone been able to use this API if it causes errors before it can even execute?
Did i download it from the correct location? (https://github.com/google/google-api-php-client)
Is there something causing an error with my server?
I dont understand how the API has errors by itself
Any help would be greatly appreciated.
I had the same problem.
The reason is that the function getItems return bad type in case it fails (http instead of list).
I'm trying to get Gracenote APi to work on my site. I got it working some months back but never went any further. I am using the same credintials that used back then when it worked and the php gracnote class from Rich Adams on github. I am trying to get the example file to work but am recieving this error.
Fatal error: Undefined class constant 'HTTP_RESPONSE_ERROR' in C:\wamp\www\Interface\php-gracenote-master\php-gracenote\HTTP.class.php on line 113
This is on my localhost atm. I tried it on my server aswell and it threw the same error.
I have made another app on Gracenote thinking they may have blocked the old one but that didn't help. Does gracenote block the entire account if it isn't active for some months or I am I just been a tool and missing something here?
EDIT
The issue seems to be when trying to register for a user id
This is caused when cURL returns an error code when trying to make the request to Gracenote's servers.
There was a bug in php-gracenote where HTTP_RESPONSE_ERROR wasn't defined, which is why you didn't get a human-friendly error message. I've just updated the code on GitHub, so you'll actually get a proper error now.
The exception will give you the cURL error code that was returned, which you can lookup in the libcurl error codes to see what the problem is. Could be anything from a DNS issue to an incorrect SSL version.
As far as I'm aware, Gracenote doesn't deactivate accounts for inactivity on the developer program. This may change in future though.
In our application, the backend is accessed via Zend_XmlRpc. In the backend, I'm using Zend_Http_Client together with Zend_Http_Client_Adapter_Curl to connect to another web service over HTTPS.
During unit tests, everything works as expected and the remote service is accessible. But when the frontend connects via Zend_XmlRpc to the backend and causes the backend to do the exact same thing like the unit tests do, I get the following error:
inet_pton(): Unrecognized address test.example.com#0 (url changed)
This is caused by Zend_Validate_Ip->isValid('test.example.com').
The only difference I can spot is the additional frontend-backend-connection which is also using Zend components for communicating. Everything else is the same.
Anybody any idea?
Looks like it might be a resolver issue in the server and zf isn't catching it beforehand. It's getting a hostname where it should be getting an IP address (obviously), and it can't convert a string to a binary IP address
It was an error in Zend_Validate that was fixed with release 1.9.