Comments (3)
Hi @jehanf
my-site.localhost, my-site.php72.localhost and my-site.php74.localhost - all should just work (mapping to the respective PHP version). If there's a redirect in place - it's likely to either be a .htaccess redirect (in your repo) or PHP (Wordpress) redirecting.
There's no redirects in place with the Docker environment.
from docker-dev.
As Matt suggested above, the simplest fix would be to change or remove the HTTP redirect that is happening. Most likely that means updating the site's URL in the wp_options
table.
I wouldn't recommend it, but if you wanted to force Docker Dev to use a specific hostname and PHP combination you could always manually edit the Apache config. Perhaps find one of the Virtual Host blocks that is roughly what you'e after, copy-paste to the top of the file (so it takes precedence), and adjust it to suit.
Run docker-compose up -d
once you've made the changes to activate them.
Example Config
# ...
# Custom PHP 7.2 website
<VirtualHost *:*>
ServerName my-site.localhost # Only use these rules if your domain is found
UseCanonicalName Off
VirtualDocumentRoot /var/www/html/my-site # Hard-code the site name/folder here
<FilesMatch "\.php$">
SetHandler proxy:fcgi://php72-fpm:9000 # Force it to use PHP 7.2 here
</FilesMatch>
</VirtualHost>
# ...
from docker-dev.
Hi,
Thank you for the really quick and precise answers, they should do the trick.
from docker-dev.
Related Issues (11)
- Can't connect to XDebug in PHP 7.4 container HOT 2
- Add PHPMyAdmin or Adminer ? HOT 2
- Sendmail configuration ? HOT 1
- double quote generates an error HOT 1
- Starting XDebug on Mac HOT 1
- Error 404 not found HOT 3
- (question) Working with oAuth (Specifically google) HOT 2
- You don't have permission to access / on this server. HOT 1
- 403 Forbidden when accessing info.localhost HOT 4
- Support for symlinks in document root HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-dev.