Documentation · Chapter 01

Run and understand
the project.

Start the server from the project root and open the address shown by AML.

Start the server

phpaml — zsh
aml serve
PHPAML is listening at http://127.0.0.1:8910
Use Ctrl+C to stop the server.

Keep this terminal open. If 8910 is busy, AML automatically tries the next port.

WHAT YOU ARE SEEING

127.0.0.1 is your own computer.

This address, also called localhost, points back to your machine. The number 8910 is the port: it lets the system distinguish the PHPAML server from other network programs. Someone else on the Internet cannot visit this address on your computer.

1You open the URL
→
2aml serve

receives the request

→
3PHPAML

returns the page

If runtime/ is missing

At startup, aml serve detects when it is missing and attempts to rebuild it. If that fails, aml install provides a detailed diagnostic.

phpaml — zsh
aml install
aml doctor
aml serve

Stop cleanly

In the server terminal, press Ctrl+C. No project file is deleted.

CHECK YOUR UNDERSTANDING

Why does the browser stop responding after Ctrl+C?

Show the answer

Because Ctrl+C stops the local server receiving requests. The code still exists, but no process is executing it for the browser.

SUMMARY

What to remember

  • aml serve starts a development-only server.
  • 127.0.0.1 identifies your computer.
  • The port identifies the local service.
  • runtime/ is rebuildable; Ctrl+C deletes no files.