Bedrock and Local by Flywheel

What issue or error are you experiencing?

When I open my site, I get a blank screen. When I open my admin-panel, I get this:

This page isn’t working right now

mysite.test redirected you too many times.

There are no php error logs, nginx error logs, or Local router logs.


What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc.

Elements:

  1. Bedrock boilerplate with Sage 9 theme
  2. Multisite
  3. GitHub Repository
  4. Wordpress 6.3.2

The production environment is live and I need get it running on my local computer. Steps taken:

  1. I created a Wordpress project in Local by Flywheel, named the domain mysite.test.
  2. I made a copy of the repository onto my local computer
  3. I added the repository to the Local Sites/mysite/app. I left app/conf/logs alone and public/sql remains in the folder with mvmt-wordpress.
  4. I downloaded a fresh copy of the database and changed domains in below tables from mysite.come to mysite.test:
  • wpuv_options
  • wpuv_blogs
  • wpuv_sites.
  1. I used the Local site shell to import the fresh copy of the production database into my local database. I left the original wordpress tables from creating the site in Local. The prod copy tables start with wpuv and the starter tables start with wp. I confirmed all of the tables were imported.
  2. In the Local Sites\site\app\site-wordpress.env, I updated:

DB_NAME=‘local’
DB_USER=‘root’
DB_PASSWORD=‘root’
DB_HOST=‘localhost’
DB_PREFIX=‘wpuv_’
WP_ENV=‘development’
WP_DOMAIN=‘mysite.test’

  1. The conf\nginx\site.conf.hbs file was update to:
root   "C:\Users\me\Local Sites\site\app\site-wordpress\web";
  1. I ran composer install in Local Sites\movement\app\mvmt-wordpress>
  2. I noticed that I did not have a \Local Sites\site\app\site-wordpress\web\wp so I made the folder in that location and copied in all of the files from Local Sites\movement\app\public. I left the original files in the public folder and left the folder in the app folder

System Details

  • Local Version:
  • Operating System (OS) and OS version: Windows 10

Hi @carter-standish,

Nice detail in this post :+1:

I’d guess the blank frontend and the admin redirect loop are two distinct issues.

Small things to check:

  1. When you changed the domains in the DB, did you choose the correct protocol? ie. http:// or https://?
  2. Have you verified Local is serving the correct ./web directory? Local sites need to be restarted to apply config changes.
  3. How did you clone the repo? If you downloaded a ZIP, you may possibly be missing files (due to .gitattributes export-ignore). Using git clone <url> will give you a full copy.

Bedrock will install ./web/wp via composer install - it should be missing from your repo. You should not create it manually.

I would re-clone the repo, apply your .env file and then re-run composer from the Local site shell from the repo root. ./web/wp should be created. If not, take note of the command output - errors should be visible.

You’ll also need to run composer install from your theme directory too if you’re running Sage.

Tom

1 Like

Hey Tom,

Thank you for your response!

1. When you changed the domains in the DB, did you choose the correct protocol? ie. http:// or https://?
In the three tables listed below, the original domain was just mysite.com with no http or https specified. I did not add on http or https. Those tables were:

  • wpuv_options
  • wpuv_blogs
  • wpuv_sites

2. Have you verified Local is serving the correct ./web directory? Local sites need to be restarted to apply config changes.
Is there a way to verify this outside of my code? My structure is as follows:

site/app/site-wordpress/web/app/themes/sage

And my root is pointed to:

root “C:\Users\me\Local Sites\site\app\site-wordpress\web”;

3. How did you clone the repo? If you downloaded a ZIP, you may possibly be missing files (due to .gitattributes export-ignore). Using git clone <url> will give you a full copy.

I re-cloned the repo through git clone url and when running composer install in there, I got an error to do with the ACF_PRO_KEY. I removed the plugin from composer.lock to just get passed the error. After that, I was able to successfully run composer install in the repo directory and the sage theme directory. I then updated the .env file and restarted my site on local.

Now, this is what I get when I navigate to mysite.test:
image

and if I navigate to mysite.test/wp-admin, I get this:

I am getting this error in the logs/nginx/error.log:

2023/11/17 11:22:47 [error] 25368#14076: *19 FastCGI sent in stderr: "PHP Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\wp-db.php on line 3030

PHP Deprecated: Return type of WP_Theme::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\class-wp-theme.php on line 554

PHP Deprecated: Return type of WP_Theme::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\class-wp-theme.php on line 595

PHP Deprecated: Return type of WP_Theme::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\class-wp-theme.php on line 535

PHP Deprecated: Return type of WP_Theme::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\class-wp-theme.php on line 544

PHP Deprecated: Return type of WP_REST_Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\rest-api\class-wp-

2023/11/17 11:22:47 [error] 25368#14076: *19 FastCGI sent in stderr: "rc\Pimple\Container.php on line 133

PHP Deprecated: Return type of Pimple\Container::offsetGet($id) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\app\plugins\better-wp-security\vendor-prod\pimple\pimple\src\Pimple\Container.php on line 98

PHP Deprecated: Return type of Pimple\Container::offsetSet($id, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\app\plugins\better-wp-security\vendor-prod\pimple\pimple\src\Pimple\Container.php on line 79

PHP Deprecated: Return type of Pimple\Container::offsetUnset($id) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\app\plugins\better-wp-security\vendor-prod\pimple\pimple\src\Pimple\Container.php on line 143

PHP Deprecated: Return type of iThemesSecurity\Lib\Lockout\Execute_Lock\Context::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\app\plugins\better-wp-security\core\lib\lockout\execute-lock\abstract-context.php on line 60

PHP Deprecated: Return type of iThemesSecurity\Lib\Lockout\Execute_Lock\Context::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in

2023/11/17 11:22:47 [error] 25368#14076: *21 FastCGI sent in stderr: "PHP Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\wp-db.php on line 3030

PHP Deprecated: Return type of WP_Theme::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\class-wp-theme.php on line 554

PHP Deprecated: Return type of WP_Theme::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\class-wp-theme.php on line 595

PHP Deprecated: Return type of WP_Theme::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\class-wp-theme.php on line 535

PHP Deprecated: Return type of WP_Theme::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\class-wp-theme.php on line 544

PHP Deprecated: Return type of WP_REST_Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\rest-api\class-wp-

2023/11/17 11:22:47 [error] 25368#14076: *21 FastCGI sent in stderr: "rc\Pimple\Container.php on line 133

PHP Deprecated: Return type of Pimple\Container::offsetGet($id) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\app\plugins\better-wp-security\vendor-prod\pimple\pimple\src\Pimple\Container.php on line 98

PHP Deprecated: Return type of Pimple\Container::offsetSet($id, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\app\plugins\better-wp-security\vendor-prod\pimple\pimple\src\Pimple\Container.php on line 79

PHP Deprecated: Return type of Pimple\Container::offsetUnset($id) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\app\plugins\better-wp-security\vendor-prod\pimple\pimple\src\Pimple\Container.php on line 143

PHP Deprecated: Return type of iThemesSecurity\Lib\Lockout\Execute_Lock\Context::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\app\plugins\better-wp-security\core\lib\lockout\execute-lock\abstract-context.php on line 60

PHP Deprecated: Return type of iThemesSecurity\Lib\Lockout\Execute_Lock\Context::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in

2023/11/17 11:22:47 [error] 25368#14076: *21 FastCGI sent in stderr: "press\web\index.php(6): require(‘C:\Users\Carter…’)

#11 {main}

thrown in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\wp-db.php on line 2056" while reading response header from upstream, client: 127.0.0.1, server: , request: “POST /wp-cron.php?doing_wp_cron=1700238167.4383308887481689453125 HTTP/1.0”, upstream: “fastcgi://127.0.0.1:10002”, host: “movementgyms.test”, referrer: “https://movementgyms.test/wp-cron.php?doing_wp_cron=1700238167.4383308887481689453125

2023/11/17 11:22:47 [error] 25368#14076: *19 FastCGI sent in stderr: "ed to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\Requests\Cookie\Jar.php on line 111

PHP Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetExists($key) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\Requests\Utility\CaseInsensitiveDictionary.php on line 40

PHP Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetGet($key) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\Requests\Utility\CaseInsensitiveDictionary.php on line 51

PHP Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetSet($key, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\Requests\Utility\CaseInsensitiveDictionary.php on line 68

PHP Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::offsetUnset($key) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\Requests\Utility\CaseInsensitiveDictionary.php on line 82

PHP Deprecated: Return type of Requests_Utility_CaseInsensitiveDictionary::getIterator() should either be compatible with IteratorAggregate::getIterator(): Tr

2023/11/17 11:22:48 [error] 25368#14076: *23 FastCGI sent in stderr: "PHP Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\wp-db.php on line 3030

PHP Deprecated: Return type of WP_Theme::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\class-wp-theme.php on line 554

PHP Deprecated: Return type of WP_Theme::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\class-wp-theme.php on line 595

PHP Deprecated: Return type of WP_Theme::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\class-wp-theme.php on line 535

PHP Deprecated: Return type of WP_Theme::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\class-wp-theme.php on line 544

PHP Deprecated: Return type of WP_REST_Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\rest-api\class-wp-

2023/11/17 11:22:48 [error] 25368#14076: *23 FastCGI sent in stderr: "rc\Pimple\Container.php on line 133

PHP Deprecated: Return type of Pimple\Container::offsetGet($id) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\app\plugins\better-wp-security\vendor-prod\pimple\pimple\src\Pimple\Container.php on line 98

PHP Deprecated: Return type of Pimple\Container::offsetSet($id, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\app\plugins\better-wp-security\vendor-prod\pimple\pimple\src\Pimple\Container.php on line 79

PHP Deprecated: Return type of Pimple\Container::offsetUnset($id) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\app\plugins\better-wp-security\vendor-prod\pimple\pimple\src\Pimple\Container.php on line 143

PHP Deprecated: Return type of iThemesSecurity\Lib\Lockout\Execute_Lock\Context::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\app\plugins\better-wp-security\core\lib\lockout\execute-lock\abstract-context.php on line 60

PHP Deprecated: Return type of iThemesSecurity\Lib\Lockout\Execute_Lock\Context::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in

2023/11/17 11:22:48 [error] 25368#14076: *23 FastCGI sent in stderr: "press\web\wp\wp-includes\functions.php(1291): WP->main(‘’)

#11 C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-blog-header.php(16): wp()

#12 C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\index.php(6): require(‘C:\Users\Carter…’)

#13 {main}

thrown in C:\Users\CarterStandish\Local Sites\movement\app\mvmt-wordpress\web\wp\wp-includes\wp-db.php on line 2056" while reading response header from upstream, client: 127.0.0.1, server: , request: “GET / HTTP/1.0”, upstream: “fastcgi://127.0.0.1:10003”, host: “movementgyms.test”

Some more things to check:

  • Check out the Bedrock installation guide - make sure you’ve handled everything there.
  • Make sure you’re running the right PHP version locally - looks like you’re running PHP8, when the code is assuming PHP7. That’ll at least clean up your logs.
  • Removing ACF could cause errors if your themes assume it’s installed. Instead of removing the dependency, set ACF_PRO_KEY in your .env file.
  • For Bedrock, WP-Admin lives at /wp/wp-admin

Hello,

@talss89 Thank you for your help so far! So an update here on some changes we’ve made with this project:

1. Instead of using the repository, we just pulled down a copy of the files straight from production. This was suggested this as the repository may not contain all of the required files. I downloaded this and placed it here:

C:\Users\CarterStandish\Local Sites\movement\app\staging.movementgyms.com

2. We switched over the Apache
Based on the production server, it made sense to switch over our local dev to apache. I made this switch in the Local dashboard web server option. After switching over, I updated the conf/apache/site.conf.hbs:

<VirtualHost *:{{port}}>
ServerAdmin webmaster@localhost
DocumentRoot “C:\Users\CarterStandish\Local Sites\movement\app\staging.movementgyms.com\web”

ErrorLog “{{logs.siteErrorLog}}”
LogFormat “%h %l %u %t "%r" %>s %b” common
CustomLog “{{logs.accessLog}}” common

  <Directory "C:\Users\CarterStandish\Local Sites\movement\app\staging.movementgyms.com\web">
   Options Indexes FollowSymLinks ExecCGI
   AllowOverride All
   Require all granted

I also left the conf/nginx-1.16.0/site.conf.hbs the same:

root   "C:\Users\CarterStandish\Local Sites\movement\app\staging.movementgyms.com\web";

Now, I am just receiving this error for both site and admin:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Is there anything that I missed with the Apache setup?

Looks like you are using .test with local you should be using .local

The site will be blank when you first visit as you will need to activate the new theme.

if /wp-admin doesnt work try /wp/wp-login

1 Like