Technical help built around real installation problems

Use this section when a camera is capturing vehicles but nothing appears in Ruby ANPR, when IN/OUT looks wrong, or when a server configuration is blocking the Hikvision event.

Getting started

Server requirements

Ruby Systems ANPR is designed for a standard PHP/MySQL web server. The application package includes an installer and full deployment guide.

PHP 7.4 or newerPHP 8.x is recommended for new installations.
MySQL or MariaDBPDO MySQL must be enabled.
PHP extensionsPDO, PDO MySQL, Fileinfo and SimpleXML are required.
Dedicated hostnameFor example anpr.yourdomain.com.
Camera setup

Hikvision Alarm Server settings

After adding a camera in Ruby ANPR, use the generated API key in the camera's Alarm Server configuration.

Destination / Hostname: anpr.yourdomain.com Protocol: HTTP Port: 80 URL: /ingest.php?key=YOUR_CAMERA_API_KEY ANPR Protocol: HIKVISION ANR: Enable

The exact Hikvision menu varies by firmware. On supported models the setting is normally under Event / Alarm Setting / Alarm Server or the equivalent Road Traffic linkage configuration.

Most common issue

Camera captures vehicles but Ruby ANPR stays empty

The Hikvision Alarm Server must be able to POST directly to /ingest.php over plain HTTP port 80. A hosting-panel or Apache Force HTTPS redirect can return HTTP 301 before PHP receives the event. Some Hikvision cameras do not follow that redirect correctly.

Fix

Keep HTTPS enabled for the normal portal, but exempt /ingest.php from HTTP-to-HTTPS redirection. The supplied Ruby ANPR .htaccess contains this exception. If your hosting panel creates a vhost-level redirect before .htaccess, disable the panel's Force HTTPS option for the ANPR hostname and let the supplied rules handle normal browser redirects.

# Expected diagnostic with an intentionally invalid key: curl -i "http://anpr.yourdomain.com/ingest.php?key=TEST" # Good result: HTTP 401 Unauthorized # Bad result: HTTP 301/302 redirect
Virtual hosting

Use the hostname, not the server IP address

Configure the Hikvision Alarm Server with the ANPR hostname. Posting to a shared server IP can land in the wrong Apache virtual host even when the server itself is reachable.

Recommended: anpr.yourdomain.com on port 80. Avoid entering the server's numeric public IP as the Alarm Server destination.
DNS

Cloudflare and proxy services

For the ANPR subdomain, a direct path from the camera to the web server is the simplest and most predictable configuration. If Cloudflare proxying causes camera events to disappear, set only the ANPR DNS record to DNS only while leaving the rest of the domain on Cloudflare if desired.

After changing DNS, some cameras may retain an old address briefly. Rebooting the camera forces a fresh DNS lookup.

Direction

Only IN captures or only OUT captures are showing

Ruby ANPR maps Hikvision forward to IN and reverse/backward to OUT. If a camera sends only one direction, the portal will correctly show only that direction.

Fix

In the Hikvision Road Traffic / Arming Schedule and Linkage Method settings, configure the required linkage for both Forward and Reverse if you want events generated in both directions. Also confirm the detection line and lane geometry are correct.

Hikvision quirk

The camera's Alarm Server Test says unavailable

Do not rely on the Hikvision Test button as the final proof. On some firmware versions the test can report unavailable while genuine ANPR multipart POSTs work normally. Always validate with a real vehicle detection and the Ruby ANPR dashboard or server access log.

Authentication

HTTP 401 Unauthorized from ingest.php

A 401 response means Ruby ANPR was reached, but the supplied camera API key was not accepted. Confirm the whole generated URL was copied into the camera. If the key has been exposed or is uncertain, use Rotate API key in the Cameras page and update the camera.

An intentional ?key=TEST request returning 401 is a useful server test because it proves PHP reached the ingest endpoint directly.
Capture evidence

Registration appears but images are missing

Check that the site's capture storage directory is writable by the PHP user and that PHP Fileinfo is enabled. Compatible Hikvision vehicleDetection events normally provide licensePlatePicture, vehiclePicture and detectionPicture.

Do not make the storage directory publicly browsable. Ruby ANPR serves stored images through its authenticated image endpoint.

Diagnostics

Prove where the fault is before changing settings

Work from the network inward. First confirm DNS, then HTTP, then Apache logs, then PHP/database behaviour. Changing multiple settings at once makes camera faults much harder to isolate.

# DNS nslookup anpr.yourdomain.com # Confirm ingest is direct HTTP, not redirected curl -i "http://anpr.yourdomain.com/ingest.php?key=TEST" # Apache access log example grep "ingest.php" /path/to/access.log | tail -20 # Network-level proof if required sudo tcpdump -ni any 'tcp port 80'

A genuine event should appear as a POST to /ingest.php?key=..., normally with eventType=vehicleDetection, registration, direction and confidence metadata.

Still need help?

Send the symptoms and the stage that is failing. Avoid sending passwords or live camera API keys.