← All writing

Integration

An AI chatbot for a PHP website you would rather not rebuild

Chatterbox runs on a PHP website as one script tag in the footer template. Nothing runs in PHP, so there is no Composer package, no PHP version floor, no model key in your config file and no queue to babysit. The AI stack stays off your server.

An old steel toolbox of worn hand tools with one new screwdriver among them.

A lot of working Indian business websites are PHP. CodeIgniter 3 that has run since 2017. A Laravel 8 app somebody upgraded twice and stopped. A pile of includes with a header.php, a footer.php and a db.php that nobody has opened in two years because it works.

The site earns money. Rebuilding it to get a chatbot is the wrong trade, and that is usually the unspoken assumption behind every "modern AI stack" tutorial you find.

Nothing has to run in PHP

The widget is client-side. Your PHP renders the page as it always has, the browser loads a script, and the conversation happens between the visitor's browser and Chatterbox.

That removes a long list of things from your side:

No Composer package, so no dependency resolution against a framework version you cannot move.

No PHP version floor. A 7.4 site works the same as an 8.3 one, because your PHP is not involved.

No model API key in config.php, no key in the repository, no key in a .env your deploy script copies around.

No vector database to install, size, back up or reindex. No embeddings job, no cron entry, no queue worker, no Redis you now have to keep alive on a ₹400 VPS.

No egress from your server to a model provider, which also means no new outbound firewall rule and no timeout in a request path that used to be a database read.

The failure mode is worth stating plainly. If the widget cannot load, the visitor sees your website without a chat bubble. Your pages, forms and checkout carry on.

What it means for a framework site

On any templated PHP site, the install lands in exactly one file: the shared footer. application/views/templates/footer.php, resources/views/layouts/app.blade.php, wp-content/themes/<theme>/footer.php, or whatever your project calls it. One tag before </body>, deployed the way you deploy anything else.

Full-page caching does not interfere. The script tag is part of the cached HTML, so Varnish, a Cloudflare cache rule or a WordPress cache plugin serve it along with everything else. There is no cache-busting problem to solve because there is no per-request state in the tag.

Your existing contact form stays where it is. Chatterbox captures a name, phone and email when it cannot answer, and those leads land in the Chatterbox dashboard and your inbox. That is a second, softer path to the same outcome, not a replacement for the form your CRM already reads.

The step-by-step version, including where to put the tag in an includes-based site and what to test after, is in the PHP install walkthrough.

Where the answers come from

The bot answers from your content, which it gets from a crawl of your site, an uploaded document, pasted text, or question-and-answer pairs you type by hand. Each answer shows the source passage it came from, so when a colleague reports a strange reply you can trace it to the page that produced it rather than guessing at a model.

Two constraints matter on an older PHP site.

The crawler reads public URLs. Anything behind a login, in an admin panel, or generated only after a form post will not be read. If your rate card lives inside a customer portal, upload it instead.

The crawler obeys robots.txt. Plenty of old sites carry a blanket User-agent: * disallow that somebody added during a staging phase and never removed. Allow ChatterboxBot or the crawl stops before it starts.

What this does not do

It does not read your database. Live stock levels, order status and account balances are not visible to it, and no crawl will make them so. A visitor asking "where is my order" needs your existing login flow, not a chatbot.

It does not edit your site or fix its content. If the answers were never published, the bot will keep asking for a phone number. That work is an afternoon with the content checklist, and it is the part that decides whether any of this is worth doing.

If your PHP site is the one earning the money and you want it answering questions at midnight without touching its code, start on the Free plan and try the tag on a staging copy first.