Wp-to-twitter. isn't able to establish the connetcion


I installed Wp-To-Twitter plugin on my WordPress blog. But the plug-in isn’t able to connect to twitter.
It gets no answer: Summary Connection Response: Array ( [http_code] => 0 [status] => )
For sure the plug-in is correctly configured. Where can I search a solution?
thanks in advance


You’ll need to contact the plugin’s author for support - we’re unable to offer support for 3rd party developer tools.


I tried but also the plug-in’s author isn’t able to understand where the problem is.
Can you give me just some idea to start search in the right direction ?
thanks in advance


My trouble is: Where do I have to search the problem?

  • Plug-in?
  • Website hosting configuration? What do I have to ask to my ISP?
  • The twitter application configuration?
  • Some twitter restrictions? Where can I find some references about this?

any idea will be greatly appreciated :slight_smile:
thanks in advance


HTTP code of 0 usually means the connection timed out or had some other sort of issue before it even hit Twitter’s servers. You may not have SSL enabled or Twitter’s certificate installed on your production machine.


I’ll investigate in this direction
Thanks so much


My ISP have given me the following answer.
Can I deduce that SSL and Twitter’s certificate are correctly installed on the production machine?
Thanks in advance

[root@lpanel /]# wget https://api.twitter.com
–2012-02-14 17:00:19-- https://api.twitter.com/
Resolving api.twitter.com…,,, …
Connecting to api.twitter.com||:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 40562 (40K) [text/html]
Saving to: `index.html’

100%[=======================================>] 40,562 71.1K/s in 0.6s

2012-02-14 17:00:21 (71.1 KB/s) - `index.html’ saved [40562/40562]


It’s likely that your PHP is set up to use cURL. Try issuing:

curl -I https://api.twitter.com/1/users/show.json?screen_name=twitterapi


This is the command response. Is it correct ?

HTTP/1.1 200 OK
Date: Tue, 14 Feb 2012 21:25:51 GMT
Status: 200 OK
X-RateLimit-Limit: 150
X-Transaction: 8d86aba68d5f8883
ETag: "05d281729a4e8675f760ef6cff0c85d5"
X-Frame-Options: SAMEORIGIN
Last-Modified: Tue, 14 Feb 2012 21:25:51 GMT
X-RateLimit-Remaining: 149
X-Runtime: 0.01630
X-Transaction-Mask: a6183ffa5f8ca943ff1b53b5644ef1146294d66e
Content-Type: application/json; charset=utf-8
Content-Length: 2131
Pragma: no-cache
X-RateLimit-Class: api
X-Revision: DEV
Expires: Tue, 31 Mar 1981 05:00:00 GMT
Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
X-RateLimit-Reset: 1329258351
X-MID: 2eebe313318f1bb5f570786007a4aa8447a7202d
Set-Cookie: k=; path=/; expires=Tue, 21-Feb-12 21:25:51 GMT; domain=.twitter.com
Set-Cookie: guest_id=v1%3A132925475179184603; domain=.twitter.com; path=/; expires=Fri, 14-Feb-2014 09:25:51 GMT
Set-Cookie: _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCDHewX01AToHaWQiJTM2Y2I0Yjc1ODI3ZDE5%250ANWVlM2UwMTgyOGQ2ZWY3YTc5IgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy%250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA–c405b7f4018a949c55c45441410b331a571c2306; domain=.twitter.com; path=/; HttpOnly
Vary: Accept-Encoding
Server: tfe


Yes, that appears to be correct. One more test would be to try and use cURL from PHP. You might try using the tmhOAuth library’s examples to test that your production server is able to connect to Twitter’s API. Download the https://github.com/themattharris/tmhOAuth project onto your server and check out the examples directory. If you’re able to run them successfully, then it’s likely an issue with the plugin.


BINGO ! That’s the right way !!!

Using tmhOAuth I tested the script “examples/verify_ssl.php” and I get the response:
ERROR: There was a problem making the request The HTTP response code was: 0

So this means the problem is in the server configuration? Right?

But my hosting provider isn’t able to solve the problem :frowning:
What can I suggest them to solve this problem?

Thanks in advance


I guess the next thing to do would be to check your PHP settings by creating a page which lists the output of phpinfo: http://php.net/manual/en/function.phpinfo.php - make sure that PHP is compiled with OpenSSL and cURL support. If not, see if your web provider can provide you with a PHP build which has these enabled.


Using the function phpinfo() I get the following informations:

cURL support enabled
cURL Information libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5

I think that’s correct. Is it?


The following is the php config of the server obtained from phpinfo() instruction.
Is it possible to find wrong or missing options?
Thanks in advance

‘./configure’ ‘–host=i686-redhat-linux-gnu’ ‘–build=i686-redhat-linux-gnu’ ‘–target=i386-redhatlinux’
’–program-prefix=’ ‘–prefix=/usr’ ‘–exec-prefix=/usr’ ‘–bindir=/usr/bin’ ‘–sbindir=/usr/sbin’
’–sysconfdir=/etc’ ‘–datadir=/usr/share’ ‘–includedir=/usr/include’ ‘–libdir=/usr/lib’
’–libexecdir=/usr/libexec’ ‘–localstatedir=/var’ ‘–sharedstatedir=/usr/com’ ‘–mandir=/usr
/share/man’ ‘–infodir=/usr/share/info’ ‘–cache-file=…/config.cache’ ‘–with-libdir=lib’ ‘–withconfig-
file-path=/etc’ ‘–with-config-file-scan-dir=/etc/php.d’ ‘–disable-debug’ ‘–with-pic’
’–disable-rpath’ ‘–without-pear’ ‘–with-bz2’ ‘–with-curl’ ‘–with-exec-dir=/usr/bin’ ‘–with-freetypedir=/
usr’ ‘–with-png-dir=/usr’ ‘–enable-gd-native-ttf’ ‘–without-gdbm’ ‘–with-gettext’ ‘–with-gmp’
’–with-iconv’ ‘–with-jpeg-dir=/usr’ ‘–with-openssl’ ‘–with-png’ ‘–with-pspell’ ‘–with-expatdir=/
usr’ ‘–with-pcre-regex=/usr’ ‘–with-zlib’ ‘–with-layout=GNU’ ‘–enable-exif’ ‘–enable-ftp’
’–enable-magic-quotes’ ‘–enable-sockets’ ‘–enable-sysvsem’ ‘–enable-sysvshm’ ‘–enablesysvmsg’
’–enable-track-vars’ ‘–enable-trans-sid’ ‘–enable-yp’ ‘–enable-wddx’ ‘–with-kerberos’
’–enable-ucd-snmp-hack’ ‘–with-unixODBC=shared,/usr’ ‘–enable-memory-limit’ ‘–enableshmop’
’–enable-calendar’ ‘–enable-dbx’ ‘–enable-dio’ ‘–with-mime-magic=/usr/share
/file/magic.mime’ ‘–without-sqlite’ ‘–with-libxml-dir=/usr’ ‘–with-xml’ ‘–with-system-tzdata’
’–enable-zip’ ‘–with-apxs2=/usr/sbin/apxs’ ‘–without-mysql’ ‘–without-gd’ ‘–without-odbc’
’–disable-dom’ ‘–disable-dba’ ‘–without-unixODBC’ ‘–disable-pdo’ ‘–disable-xmlreader’


Maybe it’s missing: --with-mhash ?


Warning: curl_exec() has been disabled for security reasons in […]/temp/ssl/tmhOAuth.php on line 641



Does this mean I cannot connect unless my provider changes this option?


Yeah that would be a problem.


Are you also posting from @BorisSclauzero, or is that someone else? I don’t see an issue here :frowning:


yes it’s always me