You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pre-check existence of index.php in docroot on ddev start and warn (for non-generic projects) #7157
People often get a 403 when they have the wrong docroot or no index.php in the docroot. We have this in our FAQ.
Describe your solution
@dalin suggested that we do a check-and-warn during ddev start if there is no index.php in the specified docroot. We could save people a lot of trouble.
There may be other useful pre-flight checks too. This one is fundamentally something like this during ddev start
#!/usr/bin/env bash
DOCROOT=$1# Find the real path to the docroot. Especially useful when the docroot is empty.
REALDOCROOT=$( readlink -f "./$DOCROOT")if [ !-d"$REALDOCROOT" ];thenecho"The docroot '$DOCROOT' does not exist at '$REALDOCROOT'. You'll likely get a 403 error when trying to visit this site in your browser. Please see '.ddev/config.yaml' for details.">&2exit 1
fiiftest -z "$(find "$REALDOCROOT" -maxdepth 1 -name 'index.*' -print -quit)";thenecho"There was no index.php, index.html or similar file found in docroot '$DOCROOT' at '$REALDOCROOT'. You'll likely get a 403 error when trying to visit this site in your browser. Please see '.ddev/config.yaml' for details.">&2# Maybe continue flow here, treating the above only as a warning???fi
changed the title [-]Pre-check existence of index.php in docroot on `ddev start` and warn[/-][+]Pre-check existence of index.php in docroot on `ddev start` and warn (for non-generic projects)[/+]on Apr 1, 2025
Activity
dalin- commentedon Mar 27, 2025
There may be other useful pre-flight checks too. This one is fundamentally something like this during
ddev startChloeSartorelli commentedon Apr 1, 2025
Hopefully goes without saying but just in case: this warning should not happen for the
genericproject type.On the other side of the coin, there might be other pre-flight checks that are project-type specific which would be appropriate.
[-]Pre-check existence of index.php in docroot on `ddev start` and warn[/-][+]Pre-check existence of index.php in docroot on `ddev start` and warn (for non-generic projects)[/+]refactor: check for docroot/index.* on start, fixes #7157
refactor: check for docroot/index.* on start, fixes ddev#7157 (ddev#7228