Unable to connect to dev server

I’m on a new mac, and trying to setup the dev server. Using Lima with Trellis.

Trellis vm start and shell work fine. When I run yarn dev and go to example.test, I get this error:

Warning: require(/srv/www/example.com/current/web/wp/wp-blog-header.php): Failed to open stream: No such file or directory in /srv/www/example.com/current/web/index.php on line 7

Fatal error: Uncaught Error: Failed opening required '/srv/www/example.com/current/web/wp/wp-blog-header.php' (include_path='.:/usr/share/php') in /srv/www/example.com/current/web/index.php:7 Stack trace: #0 {main} thrown in /srv/www/example.com/current/web/index.php on line 7

composer install has created the wp folder in public, as default in composer.json, but there is no wp folder in current/web…

Are there any clues, can I provide more info? I’ve been at this all day. Thanks!

I bolded the hostnames above — something ain’t right.

How did you setup Trellis?

What are the contents of your group_vars/development/wordpress_sites.yml and group_vars/development/vault.yml files?

What version of Trellis? What about Lima? What about macOS?

Please provide more details when looking for help, and make sure you paste logs and error messages with the proper formatting

apologies, i meant to change all to example.com for this post.

I really appreciate you taking a look and helping me out.

trellis-cli v1.13.0
trellis v1.23.0
limactl version 1.0.5
sequioa 15.3

installed trellis via
brew install roots/tap/trellis-cli
trellis new example.com
trellis vm start
trellis vm shell
after that i’m able to access database fine and use wp-cli

.env

AUTH_KEY='VdtdhYKo1smjWVKXVVKmvhHOdNaqCm1wYSliOogNS1cA1tkU2oXHkFQ6wG5Re08V'
AUTH_SALT='4qYeD4sk8J9H3b3Qh5djaSELRgsge2rznw6KFr8MwaJYC3RaOgyx9vbb5kJIoM34'
DB_HOST='localhost'
DB_NAME='example_com_development'
DB_PASSWORD='X8ubDYSiM7fB4vvGXSTLXzqbK0YKzESQx4fxAJ9bWgG7GAAtXvI84LUjGFH8NKsJ'
DB_USER='example_com'
DB_USER_HOST='localhost'
DISABLE_WP_CRON='True'
DOMAIN_CURRENT_SITE='example.test'
LOGGED_IN_KEY='xWj0aAOkfmhH4e0aUP11xeCzcttMfkuxsObRcexTV7XGnJlkn8Y2JZbB7TZv7nFZ'
LOGGED_IN_SALT='mJbbz3hDqg0UKERG3O64o5gyv9lgQFT6QUQ58sBVY1PUamO9uk4CkQ1LSKQzPndK'
NONCE_KEY='dfEDUaQ82Jiw9MHePbaxhfLEWcZTbqHDLBgxVCddiY4oTbm9103aSah6VcMpCJu2'
NONCE_SALT='0MG7SYBQlsICBfrNIpsLO9sR6orJDSMB1kz08lNmyFe9YJsA09CwLFH3GNbLfXQJ'
SECURE_AUTH_KEY='Qat5mkItbjM1MduWabgIFtKWNMJig9X5jquX8vvHA0uwJ1OEdQAzAsgKR2SYcoyN'
SECURE_AUTH_SALT='vUwRyactPrKb7DeqXsnCAB0F5nl6ASacPT1AvOJaLjeF8ZPou3dVBSFZ73vyuhqd'
WP_DEBUG_LOG='/srv/www/example.com/logs/debug.log'
WP_ENV='development'
WP_HOME='http://example.test'
WP_SITEURL='http://example.test/wp'

group_vars/development/wordpress_sites.yml

wordpress_sites:
  example.com:
    site_hosts:
    - canonical: example.test
      redirects:
      - www.example.test
    local_path: ../site
    admin_email: ty@example.com
    multisite:
      enabled: false
    ssl:
      enabled: false
      provider: self-signed
    cache:
      enabled: false

group_vars/development/vault.yml :

vault_mysql_root_password: Enq3qzAF0IpQu0KjxFcakC5sRGR9QmHIjk2CUwTZTIngWAcvMEjXlcFVBYU15MoI
vault_wordpress_sites:
  example.com:
    admin_password: jma4LTHcBGsR6rBvP5bjhzIZ8XnGv39ilSwiyW6iCseBCdEpLyDza5QatCl8Y8KB
    env:
      db_password: X8ubDYSiM7fB4vvGXSTLXzqbK0YKzESQx4fxAJ9bWgG7GAAtXvI84LUjGFH8NKsJ
      auth_key: VdtdhYKo1smjWVKXVVKmvhHOdNaqCm1wYSliOogNS1cA1tkU2oXHkFQ6wG5Re08V
      secure_auth_key: Qat5mkItbjM1MduWabgIFtKWNMJig9X5jquX8vvHA0uwJ1OEdQAzAsgKR2SYcoyN
      logged_in_key: xWj0aAOkfmhH4e0aUP11xeCzcttMfkuxsObRcexTV7XGnJlkn8Y2JZbB7TZv7nFZ
      nonce_key: dfEDUaQ82Jiw9MHePbaxhfLEWcZTbqHDLBgxVCddiY4oTbm9103aSah6VcMpCJu2
      auth_salt: 4qYeD4sk8J9H3b3Qh5djaSELRgsge2rznw6KFr8MwaJYC3RaOgyx9vbb5kJIoM34
      secure_auth_salt: vUwRyactPrKb7DeqXsnCAB0F5nl6ASacPT1AvOJaLjeF8ZPou3dVBSFZ73vyuhqd
      logged_in_salt: mJbbz3hDqg0UKERG3O64o5gyv9lgQFT6QUQ58sBVY1PUamO9uk4CkQ1LSKQzPndK
      nonce_salt: 0MG7SYBQlsICBfrNIpsLO9sR6orJDSMB1kz08lNmyFe9YJsA09CwLFH3GNbLfXQJ

heres a bit of my error.log

Stack trace:
#0 {main}
  thrown in /srv/www/example.com/current/web/index.php on line 7" while reading upstream, client: 10.0.0.97, server: example.test, request: "GET /wp/wp-admin HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test"
2025/02/08 22:09:42 [error] 749#749: *6 FastCGI sent in stderr: "PHP message: PHP Warning:  require(/srv/www/example.com/current/web/wp/wp-blog-header.php): Failed to open stream: No such file or directory in /srv/www/example.com/current/web/index.php on line 7" while reading response header from upstream, client: 10.0.0.97, server: example.test, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "http://example.test/wp/wp-admin"
2025/02/08 22:09:42 [error] 749#749: *6 FastCGI sent in stderr: "; PHP message: PHP Fatal error:  Uncaught Error: Failed opening required '/srv/www/example.com/current/web/wp/wp-blog-header.php' (include_path='.:/usr/share/php') in /srv/www/example.com/current/web/index.php:7
Stack trace:
#0 {main}
  thrown in /srv/www/example.com/current/web/index.php on line 7" while reading upstream, client: 10.0.0.97, server: example.test, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "http://example.test/wp/wp-admin"
2025/02/08 22:09:49 [error] 749#749: *6 FastCGI sent in stderr: "PHP message: PHP Warning:  require(/srv/www/example.com/current/web/wp/wp-blog-header.php): Failed to open stream: No such file or directory in /srv/www/example.com/current/web/index.php on line 7" while reading response header from upstream, client: 10.0.0.97, server: example.test, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test"
2025/02/08 22:09:49 [error] 749#749: *6 FastCGI sent in stderr: "; PHP message: PHP Fatal error:  Uncaught Error: Failed opening required '/srv/www/example.com/current/web/wp/wp-blog-header.php' (include_path='.:/usr/share/php') in /srv/www/example.com/current/web/index.php:7
Stack trace:
#0 {main}
  thrown in /srv/www/example.com/current/web/index.php on line 7" while reading upstream, client: 10.0.0.97, server: example.test, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test"
2025/02/08 22:09:49 [error] 749#749: *6 FastCGI sent in stderr: "PHP message: PHP Warning:  require(/srv/www/example.com/current/web/wp/wp-blog-header.php): Failed to open stream: No such file or directory in /srv/www/example.com/current/web/index.php on line 7" while reading response header from upstream, client: 10.0.0.97, server: example.test, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "http://example.test/"
2025/02/08 22:09:49 [error] 749#749: *6 FastCGI sent in stderr: "; PHP message: PHP Fatal error:  Uncaught Error: Failed opening required '/srv/www/example.com/current/web/wp/wp-blog-header.php' (include_path='.:/usr/share/php') in /srv/www/example.com/current/web/index.php:7
Stack trace:
#0 {main}
  thrown in /srv/www/example.com/current/web/index.php on line 7" while reading upstream, client: 10.0.0.97, server: example.test, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "http://example.test/"
2025/02/08 22:09:53 [error] 747#747: *11 FastCGI sent in stderr: "PHP message: PHP Warning:  require(/srv/www/example.com/current/web/wp/wp-blog-header.php): Failed to open stream: No such file or directory in /srv/www/example.com/current/web/index.php on line 7" while reading response header from upstream, client: 192.168.64.1, server: example.test, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test"
2025/02/08 22:09:53 [error] 747#747: *11 FastCGI sent in stderr: "; PHP message: PHP Fatal error:  Uncaught Error: Failed opening required '/srv/www/example.com/current/web/wp/wp-blog-header.php' (include_path='.:/usr/share/php') in /srv/www/example.com/current/web/index.php:7
Stack trace:
#0 {main}
  thrown in /srv/www/example.com/current/web/index.php on line 7" while reading upstream, client: 192.168.64.1, server: example.test, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test"
2025/02/08 22:09:54 [error] 753#753: *13 FastCGI sent in stderr: "PHP message: PHP Warning:  require(/srv/www/example.com/current/web/wp/wp-blog-header.php): Failed to open stream: No such file or directory in /srv/www/example.com/current/web/index.php on line 7" while reading response header from upstream, client: 192.168.64.1, server: example.test, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "http://localhost:3000/"
2025/02/08 22:09:54 [error] 753#753: *13 FastCGI sent in stderr: "; PHP message: PHP Fatal error:  Uncaught Error: Failed opening required '/srv/www/example.com/current/web/wp/wp-blog-header.php' (include_path='.:/usr/share/php') in /srv/www/example.com/current/web/index.php:7
Stack trace:
#0 {main}
  thrown in /srv/www/example.com/current/web/index.php on line 7" while reading upstream, client: 192.168.64.1, server: example.test, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "http://localhost:3000/"
2025/02/08 22:10:34 [error] 753#753: *15 FastCGI sent in stderr: "PHP message: PHP Warning:  require(/srv/www/example.com/current/web/wp/wp-blog-header.php): Failed to open stream: No such file or directory in /srv/www/example.com/current/web/index.php on line 7" while reading response header from upstream, client: 192.168.64.1, server: example.test, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test"
2025/02/08 22:10:34 [error] 753#753: *15 FastCGI sent in stderr: "; PHP message: PHP Fatal error:  Uncaught Error: Failed opening required '/srv/www/example.com/current/web/wp/wp-blog-header.php' (include_path='.:/usr/share/php') in /srv/www/example.com/current/web/index.php:7
Stack trace:
#0 {main}
  thrown in /srv/www/example.com/current/web/index.php on line 7" while reading upstream, client: 192.168.64.1, server: example.test, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test"
2025/02/08 22:10:35 [error] 753#753: *15 FastCGI sent in stderr: "PHP message: PHP Warning:  require(/srv/www/example.com/current/web/wp/wp-blog-header.php): Failed to open stream: No such file or directory in /srv/www/example.com/current/web/index.php on line 7" while reading response header from upstream, client: 192.168.64.1, server: example.test, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "http://example.test/"
2025/02/08 22:10:35 [error] 753#753: *15 FastCGI sent in stderr: "; PHP message: PHP Fatal error:  Uncaught Error: Failed opening required '/srv/www/example.com/current/web/wp/wp-blog-header.php' (include_path='.:/usr/share/php') in /srv/www/example.com/current/web/index.php:7
Stack trace:
#0 {main}
  thrown in /srv/www/example.com/current/web/index.php on line 7" while reading upstream, client: 192.168.64.1, server: example.test, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm-wordpress.sock:", host: "example.test", referrer: "http://example.test/"

@ben i’ve asked copilot about the step regarding this req:

  • Your document root must be configurable (most local development tools and webhosts should support this)

It asked me to check my lima.yaml file and to change it to this:

mounts:
  - location: "~"
    writable: true
  - location: "/Users/tbohnet/Documents/example.com"
    writable: true

from this:

mounts:
- location: "~"
  # Configure the mountPoint inside the guest.
  # 🟢 Builtin default: value of location
  mountPoint: null
  # Setting `writable` to true is discouraged when mountType is set to "reverse-sshfs".
  # 🟢 Builtin default: false
  writable: null

edit: didn’t do anything

You shouldn’t need to modify anything like that. It sounds like your Composer dependencies were never installed.

Were there no errors during the provisioning of your VM when you ran your first trellis vm start?

How are you able to use WP-CLI if WordPress isn’t installed?

The thing is, it seems they are installed…

I’ll start over from scratch and try everything again…however, i’ve done that once already.

Your group vars files are missing the modifications that the Radicle setup script does:

    local_path: ..
    public_path: public

Ref https://github.com/roots/radicle/blob/82838367eabe879ef7676805a0176ce48ba3017b/.radicle-setup/trellis.php#L73-L83

Since you’re using Radicle, you’ll want to follow the steps in the docs/README for setting up Trellis — you must run php .radicle-setup/trellis.php prior to trellis init

Yes…that worked. Thank you. I swear I did that at one point, but my trellis vm start failed a few times.

Thanks again!

1 Like