findbom with the /go/findbom Command

/go/findbom lists the .php files whose first bytes are a UTF-8 BOM (EF BB BF). It only reads; it never changes a file. A BOM at the start of a PHP file is invisible in most editors, but the web server sends it to the browser before any other output. This causes problems such as: Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

/go/findbom example.com

Arguments

Argument Required Default Notes
<domain> One of the three — The account’s primary domain, written in full.
<path> One of the three — A folder or a single .php file. Avoid spaces in the path.
all One of the three — Scans all of /home.

The command has no --option flags.

Examples

# Scan one site
/go/findbom example.com

# Scan one folder
/go/findbom /home/example.com/www/wp-content/plugins

# Check one file
/go/findbom /home/example.com/www/index.php

# Scan every site and count the affected files
/go/findbom all | wc -l

Output

Outcome What you get
BOMs found The full path of each affected file, one per line.
None found Nothing. There is no "clean" message.
Target not found <argument> does not exist and exit code 1. With no argument the name is empty, so you see does not exist.

The exit code is 0 whether or not any BOM is found.

What is checked

  • Only files that end in lowercase .php.
  • Only the very start of each file, and only the UTF-8 BOM. Other BOMs (such as UTF-16) and whitespace before <?php are not reported.

Logging

Every run is appended to /var/log/go/findbom.log.

See the full reference at /go/findbom and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *