PHP script which works with Twitter Stream works on Mac, but not Linux


I’ve wrote the script whic listen to the Twitter Stream.
It works fine on Mac dev machine, but refuses to work on Linux.

I run it and gets: HTTP/1.1 401 Unauthorized.

Could you please advise me what to do?
The source code is in the attachment:

Signature base string:


The Request:

POST /1.1/statuses/filter.json HTTP/1.1
Authorization: OAuth oauth_consumer_key=“6D4eCG7bB4FKnNHtiwfEQ”, oauth_nonce=“4dcb034a5e11d915b5176ec93b033cb1”, oauth_signature=“5DFz7KFO5OsEqF1QtxzmQXSvcf8%3D”, oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1381546083”, oauth_token=“194489998-HKQHRdx14O7nv6OjPfcuqrkFCCfCTxz6rgjiuLGv”, oauth_version="1.0"
Content-Length: 54
Content-Type: application/x-www-form-urlencoded



Hello Karmakov,

Apologies for the late reply on this topic. Have you managed to solve your issue?

When you encounter such 401 errors, please always make sure the time on your system is correct. The system clock is used by the OAuth implementation and needs to be in sync with the Twitter servers. You can check the current time in the “Date” HTTP header returned with every request.

Read more about Troubleshooting OAuth 1.0A at and please let us know if that fixes your issues.