PHP → Motoko · A different operating model

Keep the service.
Retire the PHP stack.

Rebuild selected PHP services in Motoko on the Internet Computer. Define what must work, then verify before cutover.

Read-only inventory first. Your approval before changes.

What changesPHP → Motoko
What you preserve

Content. Users. URLs.

Agree the requirements.
Verify before cutover.

Rebuilt in Motoko

The network operates.

Internet Computer

Run code.
Store data.
Serve the site.

Network infrastructure is upgraded
through public governance.

Recent security advisories · 14–21 October 2026 Affected products, versions and configurations vary.

Explore the architecture and sources

A different operating model

Less infrastructure.
More focus on the service.

Rebuild selected services in Motoko to retire their PHP runtime and the servers behind it. Agree which features to preserve, then verify the result.

Understand the architecture

75-second mainnet walkthrough

A city website.
The same site on ICP.

Meet Larkhaven, a fictional city built for this demo. See its WordPress pages, forms and search move to a Motoko backend on the Internet Computer, with the recorded command output and checks.

Get the migration skill

Silent · Real page captures and command-log replay · Private account and workspace details hidden

Checked in this demo

70
posts & pages
19
comments
3
forms

987 old URLs checked: 808 HTTP matches, 176 browser-resolved links and 3 deliberately retired WordPress endpoints.

Demo scope only. Sign-in, email delivery, integrations and production-domain cutover need separate validation. Read the reconciliation workflow.

Read the transcript of the Larkhaven video

This 75-second recording has no audio. It shows a city council website built on WordPress being moved to the Internet Computer (ICP) by a coding agent using the migrating-php-apps skill, and the result running on ICP mainnet. Every command shown ran for real; waiting time was removed. Private payment details, funding amounts, balances, the owner controller identifier and internal workspace paths are hidden in this public edit.

Opening card (0:00)

The kicker reads “migrating-php-apps · real run · waiting removed”. The title reads “A WordPress site moves to the Internet Computer.” Below it: “A city council website with a custom theme, forms, comments and search, moved by a coding agent with the migrating-php-apps skill. Every command below ran for real.”

Before: the WordPress site (0:04)

A browser window labelled “Before · WordPress on PHP” shows larkhaven.test, the website of the fictional City of Larkhaven. The view moves down the home page: the hero with a service search, popular services, latest news and what’s on. It then shows the bin collection days page and the comments on the “Draft budget 2027: your priorities” consultation. Captions read “Custom theme”, “Contact Form 7 · Yoast SEO · ACF” and “Comments · search · events”.

The agent’s run (0:14)

A terminal replays eleven steps from the recorded mainnet run. Each segment has a numbered title with its phase, the command, and lines copied from its real output. Long outputs are trimmed to the relevant lines; no text is changed. A progress bar runs along the top.

  • 1 of 11: Phase 1 · Inventory: what does this site actually contain? (0:14). The inventory script, bash php-inventory.sh /var/www/larkhaven, detects WordPress and lists the installed plugins (Yoast SEO, Advanced Custom Fields, Contact Form 7), the installed themes including the custom larkhaven theme, 2,347 PHP source files with 339,710 lines, the files that handle form posts (100), file uploads (8) and email (3), and 114 MB of uploads in 615 files. Only selected lines of the report are shown.
  • 2 of 11: Phase 4 · Export through WordPress itself (no password hashes) (0:18). bash tools/export-batches.sh exports the content through WordPress itself, without password hashes, and converts it to Candid batches: 70 content rows, 70 search rows, 19 comments, 4 users, 3 forms and 34 form rules.
  • 3 of 11: Phase 3 · Snapshot every public page, file and old URL (0:20). bash tools/snapshot-site.sh snapshots the public site and reports 981 URLs by status: 727 with 200, 181 with 301, 1 with 302 and 72 with 404.
  • 4 of 11: Phase 6 · Buy cycles by card (CyclePay) (0:23). CyclePay funding took place during the recorded run. The public edit hides payment links, order identifiers, amounts, fees, account balances and the associated command output. Card checkout is not shown.
  • 5 of 11: Phase 6 · Create the two canisters on ICP mainnet (0:26). The frontend and backend canisters were created on ICP mainnet. Funding allocations are hidden in this public edit. Their public demo addresses remain visible later in the video.
  • 6 of 11: Phase 6 · Add the owner as a backup controller (0:29). The owner was added as a backup controller of both canisters. The controller identifier and command are hidden in this public edit.
  • 7 of 11: Phase 3 · Build the site at its old paths for the mainnet address (0:31). The site was built for its public mainnet address. Internal workspace paths and the associated output are hidden in this public edit.
  • 8 of 11: Phase 6 · Deploy to ICP mainnet (0:34). icp deploy -e ic installs both canisters, syncs 722 assets to the frontend canister and lists the two canister URLs.
  • 9 of 11: Phase 4 · Import into the backend canister (controller-only, safe to re-run) (0:37). The import tool loads the batches into the backend canister: 70 content rows, 70 search documents, 19 comments, 3 forms, 34 form rules and 4 legacy users. The segment title says the import is controller-only and safe to re-run; a repeat run is not shown.
  • 10 of 11: Phase 4 · Reconcile against the WordPress database (0:40). A query of the backend canister's import counts shows 70 content items, 70 search documents, 70 routes, 19 comments (19 approved), 3 forms, 34 form rules and 4 legacy users. These match the WordPress database (70 posts and pages, 19 comments, 3 forms and 4 staff records); the WordPress side of the comparison is not shown on screen.
  • 11 of 11: Phase 6 · Check every old URL against the live site (0:43). The URL checker requests 987 old URLs from WordPress and from the live site. 808 behave the same at HTTP level, 176 query-string links are resolved in the browser, and 3 differ: /wp-admin/, /wp-login.php and /xmlrpc.php, which were retired on purpose.

Proof (0:45)

WordPress (left) and the live ICP site (right) show the /events/ page side by side and scroll together. The two full-page captures are then subtracted: WordPress minus ICP gives a black difference panel reading “0 differing pixels” (2400 × 6636 px compared), and the corner label reads “Proof · /events/ is pixel-identical”. A caption reads “987 old URLs checked on the live site: 808 identical, 176 query links resolved in the browser, 3 retired on purpose”.

After: the live site on ICP mainnet (0:55)

The same browser window, labelled “After · canisters on ICP mainnet”, shows lhhxl-xqaaa-aaaao-qqkwq-cai.icp.net. These steps were recorded on the live site:

  • The old bookmark /?p=92 is typed into the address bar and the browser lands on the news article “Harbour Bridge closes 24–26 October for repairs”. Caption: “An old ?p=92 bookmark still lands on the article”.
  • The contact form is filled in: name “Demo recording”, email demo@example.com, topic “General enquiry”, message “Recorded for the demo video. Please ignore.” The consent box is ticked and the form is sent. The site replies “Thank you. We have received your message and will reply within 5 working days. We have also sent a confirmation to your email address.” Caption: “Forms answered by a Motoko backend”.
  • “bins” is typed into the site search and the results page lists 7 results, with the matches highlighted. Caption: “Search ported from WordPress”.

Closing card (1:10)

The card reads “Same site. Same links. No PHP engine, web server or OS left to patch.” It shows “See it live: lhhxl-xqaaa-aaaao-qqkwq-cai.icp.net” and “Get the skill: phptomotoko.com”. The small print reads “Larkhaven is a fictional city built for this demo. Photos: Creative Commons, credited on the site.”

The recording shows selected pages, data and URL checks. Sign-in and the admin area, email delivery, integrations, a production-domain cutover and retiring the old host need their own evidence. Your team remains responsible for the rebuilt application, its access controls, dependencies and operation.

Download the privacy-edited transcript

Measured demo costs / public ICP

Larkhaven demo:
measured 30-day run rate.

Both the demo’s frontend and backend are included. The application owner funds cycles; visitors don’t need tokens to browse.

Estimated 30-day equivalent≈ US$0.37274.246 billion cycles · 0.274246 XDR

Seven-day elapsed window
3–10 November 2026
Frontend + backend

Only storage/idle charges were observed. The 115 observations span 168.51 hours, with recording gaps of 52.07 and 7.70 hours. This estimate is not a full-month bill, production-capacity quote or guarantee of future costs.

See how we measured

Converted at the 10 November 2026 rate: 1 XDR = US$1.355900. Traffic and dynamic features need their own estimate. Open Cloud infrastructure pricing is separate.

Questions & community help

Talk it through.

Ask the Motoko community about architecture, implementation and the move you’re planning.

Ask on the developer forum

Found a problem with the skill?

Share the steps to reproduce it in the skill’s GitHub repository.

Report a skill issue

These are public community channels, with no guaranteed response time. Redact secrets and personal data before posting.

For public services & business

Start with one
service that matters.

Map the journeys, permissions and integrations people rely on. Give every plugin or module a decision: rebuild, replace, retain or retire.

Plan with your team

The migration approach

Inventory.
Rebuild. Verify.

Start read-only. Agree the features, data and acceptance checks before implementation. Approve the result before production cutover.

Follow the six phases

Platform notes for the PHP you run

For each plugin or module, decide what to rebuild, replace or retain. Validate retained services and integrations.

Install & plan

The workflow
for your rebuild.

Give your developer or AI coding agent the migrating-php-apps skill. It provides instructions, reference code and tools to inventory the application, rebuild the agreed features and validate the result.

Install with the command, or download the ZIP for manual setup.

What’s in the download
Your planning workspacemigrating-php-apps

1. Install the migration skill

Run from your PHP project folder, then select your coding agent.

npx skills add JoshDFN/php-to-motoko-skill

2. Plan the move with your coding agent

Use the migrating-php-apps skill at https://www.phptomotoko.com/skills/migrating-php-apps/SKILL.md. Start with a read-only inventory of this PHP application. Plan this application on the Internet Computer, with the frontend on ICP and Motoko for the backend features it requires. For a content-only site, consider an asset canister without a custom backend. Map the features, data, access rules and integrations to preserve. Propose phases, acceptance checks, rollback, costs and open questions. Load relevant ICP guidance as needed. Do not modify the application or deploy until I approve the plan.

Inspect a PHP → Motoko code example
save.phpBefore: PHP
<?php
session_start();

if (!isset($_SESSION['user_id'])) {
    http_response_code(401);
    exit;
}

$pdo = new PDO($dsn, $dbUser, $dbPass);
$stmt = $pdo->prepare(
    'REPLACE INTO notes (user_id, body) VALUES (?, ?)'
);
$stmt->execute([$_SESSION['user_id'], $_POST['body']]);
Uses PHP sessions and a SQL database; your hosting stack still needs security maintenance.
main.moAfter: Motoko
import Map "mo:core/Map";
import Principal "mo:core/Principal";

persistent actor Notes {
  type Saved = { #saved; #signInFirst };

  let notes = Map.empty<Principal, Text>();

  public shared ({ caller }) func save(body : Text) : async Saved {
    if (caller.isAnonymous()) return #signInFirst;
    notes.add(caller, body);
    #saved
  };
};
caller comes from the request’s signature, not a session cookie, and notes persists without a database. This is an illustrative authenticated write; a production design needs application-specific validation.

Reported impact / 21 October 2026

Public services
went offline.

Organizations took websites and supporting services offline as a precaution while awaiting or applying PHP fixes. These are reported service interruptions, not proof of a breach.

  • NetherlandsMijnOverheidThe government portal was taken offline as a precaution, according to the Dutch government.Government statement
  • NetherlandsPort of RotterdamThe public website went offline; port operations were not affected.Report
  • WorldwideWikimediaToolforge and Cloud VPS were deliberately kept offline until they could be patched safely.Wikimedia’s statement
See all 14 reported cases
  • NetherlandsDigiDThe public website went offline; DigiD sign-in stayed available at other services, according to Logius.ANP interview
  • NetherlandsHouse of RepresentativesThe Dutch parliament’s website went offline.NOS
  • NetherlandsNCSC.NLThe National Cyber Security Centre took its own website offline as a precaution.NCSC’s notice
  • NetherlandsOverheid.nlThe national government portal went offline.Report
  • NetherlandsKNVBThe football association’s websites went offline, including Voetbal.nl.Live blog
  • NetherlandsRechtspraakSome judiciary websites were temporarily taken offline.Judiciary notice
  • GermanyITZBundThe federal IT provider took several websites offline.Report
  • FrancePrefecture websitesThe Interior Ministry pulled the prefecture websites.Report
  • BelgiumForeign ministryIts websites went offline after reports of attacks.Report
  • FinlandValtoriThe state IT centre took public web services offline.Report
  • DenmarkKombitMunicipal IT services went offline, including the national school platform.Report

Links lead to reporting or each organization’s own notice from 21 October 2026. Precautionary downtime does not by itself establish a breach. These organizations are news subjects; no endorsement or migration to ICP is implied.

Patch the current deployment first. Migration is a separate decision. Find PHP releases and mitigation guidance or browse the maintained security register.

Questions worth asking

Before you
commit.

Where can we ask questions?

Use the Motoko developer forum for public architecture and implementation questions. Report reproducible problems with the migration skill in its GitHub issue tracker. These are community channels, with no guaranteed response time. Redact secrets and personal data before posting.

Will we lose any data?

Define the reconciliation checks before migrating: compare exported records and relationships, verify uploaded files and account for edits made during the transition. Review the results before cutover. The Larkhaven demo checks selected content, files and URLs; your application needs its own agreed checks. Read the data-migration workflow.

Can we start with one service?

Yes. Choose one clearly defined service, identify its dependencies and agree what must work before moving it. Establish which system owns each part of the data during the transition.

What happens to the frontend?

The default plan moves the frontend to ICP and rebuilds the required PHP backend features in Motoko. PHP templates, forms, API calls, sign-in and plugin behavior need review. For a content-only site, an asset canister may be enough without a custom Motoko backend. An already independent frontend can retain its host when there is a specific requirement, but its backend integration still needs adaptation and testing. Read the architecture guidance.

What happens to our users and their logins?

Plan sign-in and verified account linking explicitly. Internet Identity and supported enterprise SSO are options, with provider and domain configuration where required. Roles and permissions must be rebuilt and tested; existing password hashes are not copied over. See the enterprise SSO guidance.

Can we keep our domain and our links?

Keeping the domain and important URLs is part of the migration plan. Map existing routes, redirects and .php links, then test them before approving DNS cutover.

Where does our data live?

ICP stores application code and data in units called canisters, replicated across a group of computers called a subnet. Review available locations and the complete architecture against your data requirements. Standard canister data should not be treated as confidential from node operators; review encryption and secret handling before moving sensitive data. Read the subnet selection and data storage guidance.

Can we choose the node providers?

With Open Cloud, you select the node providers and locations for an ICP cloud engine reserved for your organization. It remains part of the Internet Computer. Operator choice is separate from application access and data confidentiality. Confirm availability and your workload's requirements with Open Cloud; it currently invites early-access applications. Read how cloud engines work.

What does it cost to run?

Costs depend on the workload. Larkhaven’s demo frontend and backend normalize to about US$0.37 per 30 days: 274.246 billion cycles (0.274246 XDR). The 115 observations on 3–10 November 2026 span 168.51 hours, with recording gaps of 52.07 and 7.70 hours. Cumulative consumption counters include those gaps.

Only storage/idle charges were observed, with no billed update execution or HTTPS outcalls. The frontend reported about 260 query calls and the backend 0; these are delayed, cache-sensitive protocol statistics, not visitors, pageviews or a production-load benchmark. This run rate is not a full-month bill, production-capacity quote or guarantee of future costs.

The dollar figure uses the 10 November 2026 IMF rate of US$1.355900 per XDR. See the measurement and limits, or download the measurement data (JSON).

Estimate your own traffic, execution, external calls, reserved compute and retained services. Migration, development, setup, coding-agent fees, domain registration, email and other external services are excluded from the demo run rate. Compare ICP resource prices and the separate provider-set infrastructure and bandwidth charges in Open Cloud pricing.

What if something goes wrong during the move?

Agree how to return to the previous service before switching production traffic. Test recovery and data checks, including how records created during the transition will be handled. A snapshot alone does not reconcile records changed in both systems.

Start with the service you have

Keep what matters.Change what runs it.

Download the workflow and start with a read-only inventory.