I am using SMPP with PHP for sending and receiving messages. I got this error when i am
trying to send a message. what is the cause of this and how can i send a message ?
thanks.
pfsockopen() [function.pfsockopen]: unable to connect to sms.korewireless.com:2777 (A
connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. )
Your program tries to connect to remote server, but fails to do it before timeout elapsed.
There could be plenty of reasons for this: server may be not listening this port, your firewall forbids access to it and so on.
Try to connect to that server using telnet to find where problem is.
SMPP usually needs a bind into their server from yours. This could include whitelisting IP's, User/Pass, etc... I would contact their help desk as it sounds to be a configuration error either on your side or theirs.
Related
I am getting error while i configure remote database in phpMyadmin.
error is like as below
#2002 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection
failed because connected host has failed to respond.
The server is not responding (or the local server's socket is not correctly configured).
Most likely your MySQL server does not accept connections from external hosts. Unless you are the administrator of the server, you most likely cannot change this.
The question has already been asked on this forum but my concern in different. I have shared server space on Crazy domains and Blue Host. I have tried sending push notification with both of them. When i try it on Crazy Domain I get the following error:
Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2196 (Connection timed out) in /home4/karmamob/public_html/pushNotification/api.php on line 20
Failed to connect: 110 Connection timed out
When i run the same on Crazy Domain , I get the following error.
Warning: stream_socket_client() [function.stream-socket-client]: unable to connect to ssl://gateway.sandbox.push.apple.com:2196 (Connection timed out) in /home4/karmamob/public_html/pushNotification/api.php on line 20
Failed to connect: 110 Connection timed out
There should be no issues with the certificate because it runs fine on my local mac PC.
What i want to ask is, Can I solve this problem if I buy a Dedicated IP from BLUE HOST?
No you don't. Shared hosting plans tend to have controlled environments that you, as a shared user, can't really change, such as open or blocked ports. Is there any way you can check if connections through port 2196 are being successfully established (not necessarily to Apple)? Some low-cost, shared plans are known for blocking some juice in favour of stability and security. Also check if your push certs are properly uploaded. Cheers.
Yes, as NewObjective clarified, 2195 & 2196 ports have to be open. To open these ports you might ask Bluehost technical support team (ticket/chat), but you have to have dedicated IP address before that.
But there is another issue. If you try to send push notification message right after dedicated IP address is set and both ports are open you might receive the same "Connection timed out" error. You can test that problem by logging in to your server via SSH and running "telnet gateway.sandbox.push.apple.com 2195" command. If you receive "Connection timed out" error - you can try to contact Bluehost support team, but they can't solve this problem.
If you try to telnet any other server with 2195 opened port you will also receive that error. I had about 10 chats with Bluehost support team, opened 10 or so tickets, but they really couldn't help me. But two weeks later everything began to work. I think it was because turning dedicated IP on takes some time, but I'm not sure. Anyway, it very interesting that Bluehost support team always answers that the problem is on the Apple side, even if you tell them that any other server with 2195 opened port isn't available too)
I am using NetworkRedux shared hosting and following the APNs setup instructions at http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12 then I get this:
Warning: stream_socket_client() [function.stream-socket-client]: unable to
connect to ssl://gateway.sandbox.push.apple.com:2195 (Connection timed out) in
FILEPATH on line 21
Failed to connect: 110 Connection timed out
It looks like they are blocking this, lame. Is there a may I can use my same script including my private key and everything to connect to a proxy that will connect to Apple? I am not interested in services that "do push for you" or web APIs or anything. I want a temporary fix that I can build off of and then remove when I migrate this to a real host, that doesn't block those ports.
Actually it is possible, but direct is the best way if possible in your environment. If you have to use an HTTP Proxy, then all you need to do is connect to the proxy, then create an HTTP Tunnel through the proxy to Apple's servers - don't initiate the TLS with Apple until after the proxy connection is create. Here is some good documentation on creating such a HTTP Tunnel with PHP: http://kakku.wordpress.com/2007/11/25/proxy-hacks-final-httptunnel-tcpip-connections-over-plain-old-get-and-post-requests/
I'm using PHPMailer to send out site contacts.
In development, the script works perfectly with the GMail service over smtp. However, in production, inside the client's DMZ, it appears unable to connect to the SMTP service they have there. I have connected to the same service using telnet to port 25, so I know for sure it exists and is available to the server.
Are there any circumstances where php might not be able to open a socket connection (fsockopen)...? The php extension openssl is loaded and ok.
The error is "Unable to connect to SMTP service".
Thanks!
If the same code works elsewhere on the same OS/webserver/PHP, then its nothing to do with the PHP code. Indeed you say:
inside the client's DMZ, it appears unable to connect to the SMTP service
This rather suggests that its a configuration issue on the production network. If you can get shell access to the srver, try telneting to port 25 on the SMTP server - I'll bet it doesn't work.
If there's a long delay in getting back this error message then it might be a DNS issue rather than a firewall/routing issue.
C.
This was resolved, turned out to be an authentication issue. Hooray for finally being able to talk to the network administrators!
I am running a local apache server on an ubuntu machine, and i am trying to use the phpmailer class to send mail.
It tries to connect by fsockopen to the mail server, but it throws a timeout error. I tried setting the timeout to 15sec with no luck.
It does work on other machines.
How can i find out if my ISP has blocked requests ?
The mail server responds to ping.
ping and SMTP command don't go via the same port ; it is possible that one port is opened, and not the other one.
If there is a timeout, it probably means that :
either your SMTP server is not accepting connections from your server
or there is something somewhere (like a firewall) that's blocking your requests.
If you have an ssh access to the server, using telnet in command line to try to connect to the SMTP server, and send SMTP commands, might allow you to get some more informations...
Here a couple of links that show examples of an SMTP session via telnet :
Sending an e-mail via Telnet
Send mail through SMTP using Telnet
If you cannot connect to the server, maybe you'll get some error message (telling you that you are not allowed to connect, for instance), or it'll timeout again... Which probably means your request are being blocked somewhere...
In that case, check with your network administrator ; maybe he'll have some idea about opening some port on the firewall.