Is There a Headless Browser Available for FreeBSD Servers?

I’m searching for an open-source headless browser that can operate on a FreeBSD shared web hosting server. It should be capable of accurately rendering contemporary HTML, CSS, and JavaScript.

Since I have limited experience with Unix environments and lack root access, the software should not require dependencies that are typically unavailable on standard Apache shared web hosting setups (which I believe eliminates Java and HtmlUnit). Ideally, it would also be pre-compiled specifically for FreeBSD.

I’m looking for either a command-line interface or a PHP-compatible option (I’m unsure how these work).

If you have insights into the latest trend of using headless browsers for server-side rendering (like generating page previews and enhancing Google AJAX indexing), and can suggest suitable software for my scenario, please share. Thank you!