We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [multi-environment]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
22 views

New locale showing content from default/main site (Craft 2)

I have a Craft 2 site I've inherited that is using locales for multiple sites (each with their own domains). When I set things up initially, I got all the locales working without issue. I've been ...
0
votes
0answers
38 views

general.php not working on staging site

Craft 3.3.8 Locally everything is working as expected. However when I set up the staging site config values are not being respected. I have allowAdminChanges set to true for staging, however when ...
0
votes
1answer
34 views

Staging / Production w/ common DB and Assets

I'm hoping to implement staging and production installations for a larger scale Craft project I'm working on. My plan is to have the following structure: /staging.domain.com -- Complete Craft ...
1
vote
1answer
35 views

4 Different HTML from single Craft 3 CMS on 4 different domains?

Can we serve 4 different HTML from single Craft 3 CMS on 4 different domains? working on a client project which has their 4 different domains for their different brands of the same business. Is it ...
1
vote
1answer
28 views

How to set Commerce 2 confirmation email in .env file?

We're just in the process of upgrading from Craft 2 with Commerce 1 to Craft 3 and Commerce 2. One of the issues we had before was that the client was getting confirmation emails for test orders. Is ...
2
votes
0answers
53 views

How to reference domain specific asset path in multi domain multi env setup?

I have a site setup for Craft 3 like below .env variables for development local staging production Folder structure is standard. My assest volumes are like below. '@assetBaseUrl/documents/xx' '@...
2
votes
1answer
48 views

ImageOptimize not using image url specified in my multi-environment setup and my volume config

When I output my ImageOptimize field in the template, my images are not showing up. If you inspect the image url, it's missing a folder name I'm specifying as part of the url in my multi-environment ...
2
votes
1answer
50 views

Some (but not all) controller action routes return 404 on staging server

I've created a module for a project that has several actions, all of which are called through AJAX. Each is a post request that sends over any required params plus the CSRF token using the method ...
2
votes
1answer
195 views

Config for devMode not showing when true

I am using .env to set environment to local: # .ENV The environment Craft is currently running in ('dev', 'staging', 'production', etc.) CRAFTENV_CRAFT_ENVIRONMENT="local" My general config looks ...
1
vote
1answer
44 views

Uploading assets to different locations based on environment

I'm currently working on a new Craft CMS website for my company. We're using Elastic Beanstalk for hosting, which means that saving assets to file on the server isn't really viable- they get ...
1
vote
1answer
157 views

How to do multi-environment app config (config/app.php)?

I'm trying to setup different mail settings per environment. Here is my mail component that I'm defining in config/app.php: 'components' => [ 'mailer' => function() { // Get the ...
1
vote
1answer
166 views

Multi environment-lite

Morning folks. First time doing multi-environment in Craft 3, and separate installations for staging and production is a bit overkill for this particular project. Instead I just want to show a few new ...
6
votes
1answer
2k views

How to set up multi-env in Craft 3 with .env files?

How do I take advantage of the new .env files? I want to setup a local and production environment in Craft 3. Anyone know how to do this or know of any docs out there explaining it ?
1
vote
1answer
415 views

Multi-Environment Configs in CraftCMS 3

I am at the very early stages of using CractCMS but I'm keen to get off to the correct start, writing notes as I go along etc but I cannot figure this issue out. I have setup the Multi-Environment ...
1
vote
1answer
579 views

Clarification how staging site works

We have a single installation of Craft that is live and with lots of users and lead generation going. Now the client would like to have a staging environment where we can prepare new pages, or add ...
1
vote
2answers
192 views

phpdotenv with multi-lang Craft setup on MAMP

I inherited a Craft site which uses phpdotenv (which I'm unfamiliar with) and which I now have to make multi-lingual (https://craftcms.com/docs/localization-guide) with an added es and fr locale on ...
1
vote
1answer
230 views

How to use license in different environments

We have a very simple development process, and I believe this process has messed up the license. app-client.local.mycompany.com.br => developer environment (intranet only) app-client.qa.mycompany....
1
vote
1answer
76 views

Is it possible to change one segment of the current url and keep the rest of it the same in a cleaner way?

How would you go about changing one segment of the current url? I have a select in the footer that you can click on a country name and then it redirects you to the homepage of that country version of ...
5
votes
4answers
226 views

What are the best practices for the development setup?

I've started with Craft developing all locally. The struggle for me when working locally was synchronizing the database and the backend assets with coworkers on the same project. In the last project ...
2
votes
1answer
445 views

Structuring site with multiple subsites

I have to make a website that has a single craft installation and one database. Now the site is for a company that owns several garages which should have their own subsite on a subdomain. It should ...
2
votes
1answer
1k views

Craft 3: Environment variables are not parsed when used in Assets source field

I'm using Craft 3 and I have 2 Sites setup. In my config/general.php file I have: return [ '*' => [ 'environmentVariables' => [ 'baseAssetsUrl' => '//'.strtolower($...
1
vote
1answer
297 views

Local vs Amazon S3 asset paths in multi-environment config

I'm looking to pull assets from a local folder when developing locally, and an S3 folder when on staging/production. Is this possible? It looks like no, but I'm hoping that's not the definitive ...
2
votes
2answers
143 views

What is the most adviceable way to combine a staging and live database?

Scenario: Live server where customer adds content and articles, which are store in the database Staging server where we add new functionality, fields, sections and more When the development of the ...
1
vote
1answer
96 views

Can I get the value of an environment variable in routes.php (or other config files)?

I am trying to get the value of an environment variable (defined in the general.php config file) in the routes.php config file. Is it possible or not? I tried $environmentVariables = craft()->...
2
votes
1answer
402 views

Why is Craft extremely slow when using a shared, external database?

Every now and then I work in developer teams where we all use our local development environment to work on the code, but share the same database on a remote server (like discussed here etc.). Most of ...
2
votes
1answer
65 views

Multiple localhost config settings

Me and my coworker work on the same Craft project. We work locally with MAMP but access the database online, which works fine. For the assets I'd like to define separate localhost basepaths, since ...
2
votes
1answer
107 views

Production siteUrl being used in staging environment

I'm using the following multi-env config. My dev config works as expected. However, when I visit my staging site, it is setting the siteUrl to the production Url <?php // Dev URL $...
0
votes
0answers
80 views

https problem with multi environment config

I'm using Craft-Multi-Environment on a clients site and have it all working happily with standard http. However, we want the site to run on https to be more secure, but the server company can't seem ...
1
vote
0answers
416 views

Creating a Dev Environment

I've built a site using Craft, and now, I'd like to be able to create a mirrored development environment. With that, I'd like to be able to make changes and edits to the website that can then be ...
1
vote
1answer
134 views

With two EC2 Craft instances, the Control Panel session keeps expiring

Things were fine (no session logout for admin from CP) when there was only one EC2 instance for our website. I created a replica of the existing EC2 instance and now when I go to Control Panel, ...
2
votes
1answer
192 views

Can entries be disabled by default for 2/3 of the languages on my website

I have a 3 language website that I made for a client. The website is in Dutch, Japanese and English. When my clients creates a new entry, most of the time they want to have the Japanese and English ...
0
votes
1answer
702 views

Define a dynamic 'basePath' environmental variable without the locale

So in my general config file I've defined an environmental variable called basePath (as per the Environment-Specific Variables documentation). I'm using the getcwd() function to get the working ...
1
vote
1answer
180 views

multi-domain setup: template entry.url includes index.php

.htaccess is working fine. If I manually type url.com/about it shows the page. If I manually type url.com/asdf it shows 404 template page. url.com/index.php/testPathInfo shows success general.php ...
2
votes
1answer
575 views

How do I configure multiple environments for console commands?

I have built a plugin with some console commands for automating some regular tasks that will be run by a cron job for my site. In order to get the commands working, I had to replicate my database ...
1
vote
1answer
78 views

How to set multi-lingual image paths in a css file for different environments?

Not sure how to do this. I'm setting up a multi-lingual site with a couple of locales and I have 3 different environments set up. I've set up some environmentVariables for assets store and assets path ...
1
vote
1answer
65 views

Can multi-environment configuration be used in 'index.php'?

On my local dev sever, as well as the production server, the craft folder is one level above web root, so $craftPath in index.php is set like so: $craftPath = '../craft'; On the staging server, the ...
1
vote
1answer
256 views

Using Symbolic Links for Very Large Image directories

I'm converting an EE site to Craft. During the conversion we are establishing LOCAL > DEV > LIVE environments and using GitHub. LOCAL = My local MAMP PRO setup. DEV & LIVE = a single account at ...
2
votes
2answers
340 views

Root domain config overriding subdomain config

My question is similar to Subdomain database configuration picking up root domain config, but I don't have any custom database variables. I have a staging site and a (forthcoming) production site on ...
5
votes
1answer
119 views

Is environmental routing possible?

In the general.php config file, I can target settings for multi-environments like so: return array( '*' => array( 'devMode' => false ), '.loc' => array( 'devMode' => true ...
0
votes
1answer
218 views

Staging Server Database Not Connecting

I've moved my site to the staging server but now I'm getting a craft can't connect to the database with credentials in craft/config/db.php Thing is I uploaded this script with the same credentials ...
0
votes
1answer
844 views

multi environment nginx, how to check $_SERVER['SERVER_NAME']

I'm trying to have Craft switch baseUrl in general.php based on the environment. The Craft docs tells me to specify the environment in index.php by using logic based on the $_SERVER['SERVER_NAME'] ...
3
votes
3answers
563 views

Possible to share assets, templates and plugins across two domains but not all content?

I've seen many similar questions (Multiple databases, single codebase) but now a little confused on the best approach. This is our first Craft CMS site so still learning the possibilities. We have ...
4
votes
2answers
298 views

Multi-Environment S3 Asset Paths

If I have three environments; local, dev, and live, and want assets to be setup like this: local: stored in a local directory (/public/uploads) dev: stored on S3 dev bucket live: stored on S3 ...
1
vote
1answer
77 views

Multilingual MAMP port number siteUrl issue

I have my local dev setting up using MAMP on port 8888 'mydomain.dev:8888' => array( // ... 'environmentVariables' => array( 'basePath' => '/Users/mypath/SiteCode/mydomain/...
1
vote
1answer
347 views

Linking a page in a multilanguage website

Currently i am using this approach for linking to a entry(single page) of a structure, for example a cta button on the homepage which links to the contact page. {% cache %} {% set single = craft....
1
vote
2answers
713 views

Multi-Environment Config Database Credentials

Being driven to distraction trying to setup multiple environments with Craft. I have Craft running (and working) locally without issue. I have created a staging server with Digital Ocean and setup the ...
2
votes
1answer
257 views

devMode, phpdotenv variable ignored

I'm using dotphpenv for environment specific config. This works perfectly for my db config. I added another 2 environment vars for devMode and allowAutoUpdates DEV_MODE=false AUTO_UPDATE=false and ...
2
votes
1answer
206 views

Plugin Multi-Environment config not working

I have set up the plugin's multi-environment configuration as outlined in this answer. The config.php file for the plugin is as follows: <?php return array( // All '*' => array( ),...
1
vote
0answers
40 views

Wrong siteUrl chosen in multi-environment config [duplicate]

I have following setup for my site urls (after other testing domains): return [ '*' => [ 'omitScriptNameInUrls' => true, 'usePathInfo' => true, '...
3
votes
1answer
519 views

Custom Environmental Settings

Is it possible to use custom environmental settings with Craft? I have separate web services that I use in production and development environments. I would like to programmatically point to the ...