Local development server without using Trellis?

I know php 5.4 has a built-in web server that you can launch with php -S but it has some functionality missing and it can’t serve files in the context of this bedrock/wordpress install, I’m thinking it’s something to do with the lack of an .htaccess file. It can display the front page just fine but there’s no styling or Javascript that appears.

I’m aware there’s Trellis but if I’m on a machine that doesn’t have the ability to use virtualization, I’d like to see if there’s an alternative.

Would the PHP version requirement in Bedrock’s composer.json affect you here?


 "require": {
    "php": ">=5.6",

You could use WP-CLI which uses php -S in the background. You’ll just need to pass the docroot like this:

1 Like

I set WP_HOME to the full url (with port), ran composer install, and used wp server --docroot=web and it works. Still wondering if the same thing would work with sage but I’ll cross that bridge when I get to it.

Late to the party, but I would suggest Valet and WP CLI Valet to make your life easier if you want a lightweight nginx server set up in seconds. Works flawlessly.