Hello,
I have a problem with getting ip camera pictures in a browser from internet.
IP camera is on address 192.168.4.44, port 5566
My computer is on 192.168.4.10.
My router is on 192.168.4.1 and is registered on no-ip service.
Also, I have port forwarded 5566 in my router.
Xampp is listening on port 5566.
I have created php file and placed in xampp server.
Inside php file is connection string to camera ip, port, username, password just to get a picture in php file so it could be previewed in browser.
Locally I can view camera contents in the browser.

But when I typed with no-ip address from my cell phone, over mobile network, I get all the contents of php file, but not camera pics.
I tried turning off windows firewall but with no luck.

What am I missing?

Big thnx

Dani AI

Generated

Quick diagnosis: when the PHP page itself loads from the Internet but the camera images do not, the remote browser is almost always being asked to fetch the camera at a private LAN address. That works on the local network but fails across the Internet. As suggested, forwarding the camera's port is one option — but there are safer and easier fixes too.

Checklist and simple tests

  • View the served page source (on the remote phone) and check each <img> src. If any src points to a private IP (192.168., 10.) the remote device cannot reach it.
  • Two practical solutions: (A) forward an external port on the router directly to the camera and use the public:port URL in the page, or (B) proxy the snapshot through the XAMPP/PHP server so the browser always requests the image from the web server (this keeps camera credentials off the client and works without extra forwarding).
  • Test reachability: from an external machine try curling the camera URL on the public port, or load the camera snapshot URL directly in a remote browser. If the webserver page loads but curl of the camera fails, the problem is routing/NAT, not PHP.
  • Make sure the router’s forwarding points to the camera’s LAN IP (not to the PC) if you go with direct forwarding; remember a single external port can’t be forwarded to two different internal hosts.

Server-side proxy example (safe, avoids exposing camera)

<?php
// snapshot.php - proxy camera image through the web server
$cam = 'http://CAM_LOCAL_IP:CAM_PORT/IMAGE_PATH';
$user = 'USERNAME';
$pass = 'PASSWORD';

$ch = curl_init($cam);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERPWD, $user . ':' . $pass);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$data = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);

if ($data && ($info['http_code'] ?? 0) === 200) {
  header('Content-Type: ' . ($info['content_type'] ?? 'image/jpeg'));
  header('Cache-Control: no-cache, no-store, must-revalidate');
  echo $data;
} else {
  header('HTTP/1.1 502 Bad Gateway');
  echo 'Unable to fetch camera image';
}

Embed as: <img src="snapshot.php?ts=TIMESTAMP"> to prevent caching.

Security notes: exposing a camera directly to the Internet is risky. Use strong passwords, change defaults, enable HTTPS or a VPN when possible, or keep the proxy approach so only the webserver is public and camera credentials remain on the server.

Have you forwarded port 5566 for the IP camera address (192.168.4.44)?

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.