Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
In #1543858: Add a startup configuration for the built-in PHP server that supports clean URLs we add configuration for PHP's inbuilt webserver to work with clean URLs. Unfortunately this configuration does not support update.php
Proposed resolution
Make it support it.
Steps to test/reproduce
- Install standard
- Execute
$ php -S localhost:8888 .ht.router.php
from the command line from DRUPAL_ROOT - Visit http://localhost:8888/update.php
- Click on the continue button
- Ensure that
admin/structure/types/manage/article/fields/node.article.body
is not broken since this is why with the script in the first place - see https://bugs.php.net/bug.php?id=61286 - Ensure that http://localhost:8888/update.php/selection/blahd.blah
- Go to node/add/article
- Create a node with an image uploaded
- Ensure the image appears
falls back to an update screen since this is the behaviour on Apache.
Remaining tasks
User interface changes
None
API changes
None
Data model changes
None
Comment | File | Size | Author |
---|---|---|---|
#10 | 2929198-10.patch | 1.54 KB | alexpott |
#10 | 9-10-interdiff.txt | 1.36 KB | alexpott |
#9 | 8-9-interdiff.txt | 2.38 KB | alexpott |
#9 | 2929198-9.patch | 1.73 KB | alexpott |
#8 | 2929198-6.patch | 2.23 KB | alexpott |
Comments
Comment #2
alexpottHere's a patch that fixes it.
Comment #3
chr.fritschI was able reproduce the issue and can confirm that #2 fixes it.
Comment #4
alexpottHere's a better fix with support for things other than update.php.
Comment #6
alexpottTesting has shown that #3 breaks image styles :(
Here is a fix.
Comment #7
alexpottComment #8
alexpottWe can limit the amount of file system checking by just looking for paths that end in .php
Comment #9
alexpottFurther testing of the equivalent Drush command has shown that this needs a small tweak.
Comment #10
alexpottWorked out a nicer way with way less conditionals and probably quicker to boot too.
Comment #12
alexpottJust to note that Thunder is now successfully using this patch to spin up a server using PHP in travis testing.
Comment #13
dawehnerIs this a PHP bug we can link to?
I'm curious, is there a reason why we use a regex instead of a strpos?
Comment #14
alexpott1. The PHP bug is already linked in the file. See https://github.com/drupal/drupal/blob/8.5.x/.ht.router.php
2. Yep because I wanted to ensure that it was a .php file so the
$
is significant.Comment #15
dawehnerI was trying to apply some microoptimization, sorry.
Oh right, thank you!
This no longer needs manual testing.
Comment #17
catchCommitted/pushed to 8.6.x and cherry-picked to 8.5.x. Thanks!
Comment #20
alexpott