lando / docs

The main docs site for Lando
https://docs.lando.dev/
GNU General Public License v3.0
20 stars 56 forks source link

Unable to use PHP 5.6 with Apache 2.2 (Docs Update?) #84

Closed blakethomp closed 5 years ago

blakethomp commented 6 years ago

v3.0.0-beta,39 on Windows 10 Enterprise

# LAMP stack example
name: lamp

# Give me http://lamp.lndo.site and https://lamp.lndo.site
proxy:
  appserver:
    - lamp.lndo.site

# Spin up services to run a basic LAMP stack
services:

  # Create a php 5.6 instance served by the latest apache with https turned on
  appserver:

    # PHP version 5.6
    type: php:5.6

    # Serve php by either apache or nginx. You can put in any `service:version`
    # string that is supported by Lando's nginx and apache services.
    via: apache:2.2

    # Optionally serve php over https
    ssl: true

    # Optionally specify a webroot if it is a subdirectory of the appRoot
    webroot: docroot

    # Optionally customize the configuration for php and its underlying webserver
    # These paths are both relative to (and must reside within) the app root directory
    #
    # For some examples that use this fairly well please check out
    # https://github.com/lando/lando/tree/master/examples
    # config:
      # Use a custom apache config file
      # server: config/apache/lamp.conf

      # Use a custom php.ini
      # This **should** load last which means you should be able to override
      # any previously set php settings.
      # conf: config/php/php.ini

    # Optionally activate xdebug
    #
    # If you are having trouble getting xdebug to work please see:
    # https://docs.devwithlando.io/services/php.html#using-xdebug
    xdebug: true

    # Optionally install the following composer dependencies globally
    # These follow the normal composer.json form
    # Note that many composer dependencies should not be installed globally but
    # on a per-project basis
    # composer:
    #   drush/drush: "~8"

    # Optionally run the following build steps
    # run:
    #  - "cd $LANDO_MOUNT && composer install"

    # Optionally install additional server software
    # run_as_root:
    #  - "apt-get update -y"
    #  - "apt-get install netcat -y"

  # My database service
  database:
    type: mysql
    portforward: 3308
    creds:
      user: lamp
      password: lamp
      database: lamp

# Add some nice command routing
tooling:
  composer:
    service: appserver
    description: Run composer commands
    cmd:
      - composer
      - --ansi
  php:
    service: appserver
  mysql:
    user: root
    service: database
    description: Drop into a MySQL shell

Tell us about the command you were running

lando start

Tell us generally about your bug

The comment with the "via" setting for apache says you can set any service:version for nginx or apache, however this is inaccurate. The above setting with apache:2.2 still installs the devwithlando/php:5.6 image which has apache 2.4.

Tell us more

I'm not sure if this is a bug, or misleading documentation, but it appears to be difficult to piece together setting up a php 5.6 / apache 2.2 environment with Lando.

dustinleblanc commented 6 years ago

Hey @blakestein! Thanks for the report. Did you see any other combos that don't work or is it just strictly 5.6 + 2.2? Most of us end up using Nginx so that explains why we would miss this 😄

Not sure whether we should correct the documentation, or modify the code. I imagine the issue here is that Apache is not a separate service in these cases, and we maintain our own PHP images, so it'd likely be a good deal of work to maintain another variation. We'll figure that out, thanks!

blakethomp commented 6 years ago

@dustinleblanc I needed 5.6 + 2.2 to match an environment for a project so that was really the only combo I was trying to set up that didn't work. Since both these versions should be on their way out it probably makes sense to just update the documentation, unless there are plans to move Apache/web server to its own container. Unfortunately I ended up switching to Docksal for this particular project :(