Hosting is a system: establish the facts before changing anything
A hosting problem often looks like “the script is broken” when the real cause is a PHP version, missing extension, full filesystem, permission, network path or mail transport. Terminal work becomes calmer when you first describe the machine you actually have.
The same project can behave differently on a different host
Your files may be identical while the runtime is not. PHP version, loaded extensions, filesystem limits, ownership, permissions, time, network access and server policy all affect what the application can do.
This is why a useful first question is not “what should I change?” but “what environment is executing this?” A terminal is good at turning that vague environment into inspectable facts.
Start with one screen of facts
Do not treat a healthy summary as proof that every application is healthy. It is a baseline: a fast way to notice that the machine, Core or runtime is not what you expected before you investigate deeper.
coredoctor -qsys hostsys uptimeA PHP feature exists only when this runtime actually provides it
A missing capability is different from a bad command. Prefer a clear capability error over random workarounds; confirm the extension first and then decide whether to enable it, choose another tool or move the task elsewhere.
php versionphp modulesphp info memory -cdoctor extensionsFree space, directory usage and permissions are different questions
Do not “fix permissions” by making everything writable. Inspect owner and mode, change the smallest target that needs a change, then verify it again. Permissions are a local access boundary, not a substitute for authentication or encryption.
disk .disk . -rstat .Read logs before deleting, restarting or guessing
A useful log line has context: time, component, request or operation, and the actual error. Preserve that context before you “clean up” anything. Many difficult incidents become ordinary once you can say exactly when the failure started and what changed around it.
log -lEnvironment values and mail are separate subsystems worth testing explicitly
env server SERVER_ADDRenv TMPmailSave the baseline before the repair
Redirect compact reports into a diagnostics/ directory before you change PHP settings, modules, permissions or hosting configuration. After the change, collect the same reports again and compare facts rather than relying on “it feels better now”.
This habit scales beyond lil-terminal. On Linux, macOS, Windows, containers and control panels, good diagnostics follow the same sequence: identify the environment, isolate the layer, collect evidence, change one thing, verify.
md diagnosticsdoctor -j > diagnostics/doctor.json -rsys > diagnostics/system.txt -rphp version > diagnostics/php.txt -rKeep this as a script
Save this as hosting-baseline.lil. It collects a compact diagnostic snapshot into diagnostics/ without changing application data. Keep snapshots from before and after a hosting change: comparison is usually more useful than memory.
#lil
@install md doctor sys php disk log env
md diagnostics
core > diagnostics/core.txt -r
doctor -q > diagnostics/doctor.txt -r
sys > diagnostics/system.txt -r
php version > diagnostics/php.txt -r
disk . > diagnostics/disk.txt -r
log -l > diagnostics/logs.txt -r
env server SERVER_ADDR > diagnostics/server.txt -r