Deploying Tweetr AS3 site on ISS without cURL - php

I've been developing a site for a client that uses the Tweetr API to post messages to a user's Twitter account. It has now been discovered that the destination server is running IIS, so no mod_rewrite for the Tweetr proxy. Also cURL is not available, which prevents the proxy from forwarding requests.
The lack of mod_rewrite can be got around, but I need an alternative to using cURL that doesn't require anything not included in a very basic PHP 5.2 install. I'm considering trying to recreate the proxy functionality with jQuery AJAX, but at the same time that seems like a very lengthy solution. Can anyone point me in the right direction here?

I think that this might be what you're looking for.

Related

CloudFlare for caching REST API response developed in core php

I have developed REST API in core php. This APIs are used in mobile app to fetch data from server.
Now we have a situation where 10000 users are using the app at the same time. When all this users are on app at same time, the server(Amazon EC2 UBUNTU 12.04) fails.
In order to solve this, we have decided to use CloudFlare. After lot of research, it is still not clear how to use cloudflare to cache the response coming from APIs.
Below are few links that I have followed so far:
https://support.cloudflare.com/hc/en-us/articles/202775670-How-Do-I-Tell-Cloudflare-What-to-Cache-
https://blog.cloudflare.com/introducing-pagerules-advanced-caching/ .
We have already set CNAME and HOST details on our CloudFlare account. Can someone help me to know what implementation is needed. Or if this is possible at all or no?
After a lot of research, I found that it is possible to cache the response of REST API. We just need to create a custom page rule.
Just in case someone else is facing the same issue then follow below steps:
1) Get the domain name for your URL. For example, if your API URL is http://xx.xx.xx.xx then you need to get a domain and link it so that your API URL can be http://domainname/...
2) Since the data is not HTML content or CSS, you should create a custom page rule. It is detailed very nicely by cloud flare but is hard to find the link. SO here is the link for the same: https://support.cloudflare.com/hc/en-us/articles/115000150272-How-do-I-use-Cache-Everything-with-Cloudflare-
The entire setup with Cloudflare is done and the performance of my server has improved drastically. We just need to follow the steps carefully!!!

php with symfony website tracing request on production server

I have a php website using symfony2 framework .I wanted to know what would be the best method to trace incoming request on production server in order to troubleshoot client issues .The only way that i know of is using php log file in C:Windows/Temp directory .Is there any other way of tracing request and troubleshooting error with respect to such request .all the request to website are https not sure fiddler can help me in this scenario .Please let me know your feedback on the same .
Thanks
There are more than on way to log client requests.
First, Apache will log incoming requests in the /var/log/www/access.log
Secondly, Symfony has its own logging enabled by default available in app/logs/prod.log
Thirdly, you can implement client side logging and logging with monolog , example : Javascript errors => send ajax request to log endpoint => log with monolog action
Now, on what type of OS will your site run ? You speak about Windows Temp directory, will your site be hosted on Windows or UNIX servers ? configurations and available tools will then be different.
I am currently working on some project where I plan to do it via GrayLog2 (as #Christophe suggested in a 3rd solution).
I ran some local trials and it seems more than capable of logging just anything.

IIS 7.5 site can't authenticate itself

I have a couple of sites on the same server and same domain (site1.domain.com, site2.domain.com...) which talk to each other with http post request. This works fine, but I also have a dev version of all sites that is under basic authentication so you need a username/password to see the sites, and on these the http post request doesn't work.
This seems to be because the server can't authenticate itself which seems kinda weird to me, I don't have much experience with IIS thou so probably have missed something.
Anyone know how to solve this?
Don't know if it makes a difference, but the sites are using php, not asp.net
You will need to send your credentials with your request. I do not know much about drupal_http_request, but if it doesnt have built in methods to add credentials to the request, you can manually add an auth header by base64 encoding your credentials.

Getting referrer

I am running an xml-rpc server to share my site's api methods.
I want to log all the requests to find out what sites are actually making requests to my xml-rpc server.
Is there any way to do this?
All I've tried is looking into $_SERVER and $request variables - nothing inside them.
Thanks.
CI v 2.1.3 in-box xmlrpcs library

What are the right uses for cURL?

I have already heard about the curl library, and that I get interest about...
and as i read that there are many uses for it, can you provide me with some
Are there any security problems with it?
one of the many useful features of curl is to interact with web pages, which means that you can send and receive http request and manipulate the data. which means you can login to web sites and actually send commands as if you where interacting from your web browser.
i found a very good web page titled 10 awesome things to do with curl. it's at http://www.catswhocode.com/blog/10-awesome-things-to-do-with-curl
One of it's big use cases is for automating activities such as getting content from another websites by the application. It can also be used to post data to another website and download files via FTP or HTTP. In other words it allows your application or script to act as a user accessing a website as they would do browsing manually.
There are no inherent security problems with it but it should be used appropriately, e.g. use https where required.
cURL Features
It's for spamming comment forms. ;)
cURL is great for working with APIs, especially when you need to POST data. I've heard that it's quicker to use file_get_contents() for basic GET requests (e.g. grabbing an RSS feed that doesn't require authentication), but I haven't tried myself.
If you're using it in a publicly distributed script, such as a WordPress plugin, be sure to check for it with function_exists('curl_open'), as some hosts don't install it...
In addition to the uses suggested in the other answers, I find it quite useful for testing web-service calls. Especially on *nix servers where I can't install other tools and want to test the connection to a 3rd party webservice (ensuring network connectivity / firewall rules etc.) in advance of installing the actual application that will be communicating with the web-services. That way if there are problems, the usual response of 'something must be wrong with your application' can be avoided and I can focus on diagnosing the network / other issues that are preventing the connection from being made.
It certainly can simplify simple programs you need to write that require higher level protocols for communication.
I do recall a contractor, however, attempting to use it with a high load Apache web server module and it was simply too heavy-weight for that particular application.

Categories