GithubHelp home page GithubHelp logo

Comments (3)

mcnamee avatar mcnamee commented on May 22, 2024

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.

wireblue avatar wireblue commented on May 22, 2024

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.

jehanf avatar jehanf commented on May 22, 2024

Hi,

Thank you for the really quick and precise answers, they should do the trick.

from docker-dev.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.