hello everyone! im using ozeki sms gateway for my website. but for some reason (which i dont know) when i use and implement the script i have on my uploaded website it doesnt work. i get an error message as follows:

Request:

Warning: fsockopen(): unable to connect to 192.168.254.103:9501 (Connection timed out) in /home/lyceumli/public_html/sendsms.php on line 18
Response:
Connection timed out (110)

192.168.254.103:9501 --> thats my local ip address or the ipv4 address of my computer with 9501 as the port of ozeki sms gateway, in my localhost, it works fine. Ive sought tutorials and reviews and even tips from ozeki themselves, they advised me to turn off my firewall, port forward 9501 to my router, and such likes but the error remains. Any idea on how will I solve this problem? if you wish to check it out, go to lyceumlibrary.com; i have there the sms form.

Thanks a lot!

Dani AI

Generated

As pointed out, an address in the 192.168.* range is private and will not be reachable from a website hosted on the public Internet. Building on 's comments about allowing port 9501 through the gateway, here is a compact, practical checklist and a few safe alternatives to get SMS sending working reliably.

  1. Map the network path. Determine whether the web site runs on the same LAN as the Ozeki gateway or on a remote host. If remote, the gateway must be reachable via a public IP (or via a tunnel) for HTTP calls to succeed.
  2. From the machine that runs the website, test TCP reachability to the gateway port 9501. If tests fail, the problem is routing/NAT or a firewall.
  3. If exposing the gateway is chosen: set a router NAT rule forwarding port 9501 to the internal host, open that port in the host firewall, and restrict access where possible (source IP allowlist). Use dynamic DNS if the public IP is not static.
  4. For short-term testing or when a public IP is not available, use a secure reverse tunnel (SSH) or a tunneling service so the website can reach the local gateway without opening the LAN to the Internet.
  5. Consider a hosted SMS API (provider with a public REST endpoint) or running Ozeki on a VPS to avoid local NAT complexity.

Quick commands and a simple PHP fallback to get clearer errors:

# from the web host (or another remote machine) to check port
telnet PUBLIC_IP 9501
# or
curl -v "http://PUBLIC_IP:9501/api?username=php1&password=...&action=sendmessage"

# reverse SSH tunnel (run on the gateway machine)
ssh -R 9501:localhost:9501 user@PUBLIC_HOST
$ch = curl_init('http://PUBLIC_IP:9501/api?...');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$response = curl_exec($ch);
if ($response === false) error_log('curl error: '.curl_error($ch));
curl_close($ch);

Security note: never expose the gateway without authentication and IP restrictions. If long-term reliability and ease are priorities, a public SMS provider or a VPS-hosted gateway is usually the simplest, safest route. This directly addresses the fsockopen timeout (errno 110) seen by : a TCP connection could not be established to that IP/port from the web host.

Recommended Answers

All 4 Replies

If you are trying to connect to 192.168.254.103:9501 from a host on the Internet, that isn't going to work. This is a private IP address. It's not public ally routable on the Internet.

If you are trying to connect to a host in your private network, you have to specify your public IP address and set up your router to map this public IP to the internal private IP on the appropriate ports.

For this to work, your public IP must be static. Your ISP controls whether its static or dynamic.

thanks for the reply JorgeM,

any tutorials on setting up my router map of public IP to my private IP assuming my public IP is static? or is there an alternative way to have my sms over the net? or any tutorials i can read to implement my sms from my website in the internet? im a newbie on this so I am relying on tutorials and google on how i can make this work.

thanks a lot!

Hey!

For using the sms gateway you will need a static IP adress. Ask for your service provider about it.

Here's a guide about how you can enable the Ozeki NG SMS Gateway in a private network: <URL SNPPED>

You do not need to turn off the firewall, just allow the requests through port 9501 to connect to Ozeki.
Try to search solution in the routers manual about this port forwarding.

Hi,

can someone recommend me some carrier az ozeki?

Thnks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.