6 votes
Accepted

devMode, phpdotenv variable ignored

It looks like getenv returns a string (or false if the variable is not set, but it is in this case). So you need to cast the string to a boolean value to make it work. However, (bool)'false' gives ...
  • 35.9k
5 votes
Accepted

Installing other PHP app in sub directory

Yes, possible. You just need to override the URL routing within the subdirectory, so requests to /sub/* get routed to /sub/index.php rather than /index.php. For example, if you’re using Apache, just ...
5 votes
Accepted

Limit number of sessions per user

This can be done with a plugin. The plugin would create an 'activity' table that saves the current user's ID and a timestamp of their last known activity. You can insert the first row by listening ...
  • 66.5k
4 votes

Limit number of sessions per user

Im on Craft v3.4.25, and I've added the following event handler in my module to handle this. There are two scenarios here: either you want the new login to invalidate any existing session, or you want ...
3 votes

Multiple instances of Craft in same hosting account root

There are various ways to go about this. Here’s a few: Option 1: Keep each site completely contained If you are able to keep each installation in its own directory, each with its own web root, that ...
3 votes
Accepted

Less complicated local development w/Craft 3, is it possible?

If you're used to Local you can also use that for Craft. Here's 2 articles to get you started: https://medium.com/@madebyraygun/a-quick-and-easy-local-environment-for-craft-3-4fd7c7ff5815 and ...
3 votes

How to have Craft 3 and 2 on same host?

Both the craft/ folder name in Craft 2, and the craft executable in Craft 3, can be renamed. Since the craft executable is user-facing (when SSH’d in), I’d recommend leaving that alone and rename ...
3 votes

Setting system email address and sender name in multi config

Marion's answer is a workaround for Craft 2, but this has been officially addressed in the upcoming Craft 3: https://github.com/craftcms/cms/issues/840
  • 66.5k
3 votes
Accepted

Setting system email address and sender name in multi config

The testToEmailAddress config setting which Configures Craft to send all system emails to a single email address (or multiple email addresses), for testing purposes. sounds like the one you are ...
3 votes

Social Login plugin question

Your /craft/config/social.php file should probably look like this: <?php return [ 'lockDomains' => [ 'awebaddress.net', ], ]; If you wanted to add more config settings, that ...
3 votes
Accepted

contactform.php messing up site

The problem is the ... in your contactform.php file. The docs use it because they assume you might have some other valid config settings you want to include in that config file, but it's not real ...
  • 66.5k
3 votes
Accepted

Craft "Unsupported DB driver" error after resetting Windows

Found the problem. I had to remove putenv from the disabled functions in php.ini
  • 137
3 votes
Accepted

Why would Craft produce a template loader error (TemplateLoaderException) when rendering its default error pages?

As it turns out, I had made a configuration change that broke Craft's default behavior: 'defaultTemplateExtensions' => array('twig', 'xml') All of Craft's internal templates use .html, and HTML ...
  • 3,400
2 votes
Accepted

Update Plugin's config.php

In this situation you don't want to use a config file and instead you want to use plugin settings. The settings have a UI and save to the db, which does exactly what you want. The config files are ...
2 votes
Accepted

Asset uploads failing on new installation of Craft CMS

You probably just need to set upload_tmp_dir in your php.ini file to be a path under your openbase_dir paths. Or just remove the openbase_dir restrictions.
  • 66.5k
2 votes

Disable entry versioning

No need for a plugin, just don't check this option
2 votes
Accepted

Turning off a site in multi-site/multi-environment config

The isSystemLive config setting isn't multi-site aware. It sets the entire Craft installation on or off, rather than per site, so you'll need to find a different method to disable domain2.com on the ...
2 votes

Less complicated local development w/Craft 3, is it possible?

I wrote one of the articles about using Local and Craft that @erwinheiser mentioned above. I had enough trouble with Local over the years that I've since switched to Lando, which is an easy to use, ...
2 votes

Less complicated local development w/Craft 3, is it possible?

The advantage of Docker/Vangrant, etc. is they help create a server similar to production so you run into less issues when deploying. However, those setups are often overkill and complex especially if ...
  • 6,502
2 votes

Less complicated local development w/Craft 3, is it possible?

For windows, have you checked out Laragon? For Mac and Linux there is valet that is probably simpler than vagrant. Valet for mac Valet for linux Hope this helps.
  • 21
1 vote

Multiple instances of Craft in same hosting account root

You could have multiple independent Craft CMS installs in separate directories, or have a single Craft instance but use mulit-site to have different domains pointed to a single Craft install. https://...
  • 1,041
1 vote

Exporting site configurations for import to new websites - separate databases

Sounds like a great use-case for Project Config! It's a file-based representation of your site's settings and information architecture without the content. Get your boilerplate Project Config setup, ...
  • 66.5k
1 vote
Accepted

Error using environment variable for email setting

I think you're getting a few conventions mixed up. Using an @ is typically reserved for aliases https://docs.craftcms.com/v3/config/environments.html#using-aliases-in-control-panel-settings What you'...
  • 66.5k
1 vote

Headless mode/ElementAPI: how to set the frontend's baseUrl in the backend endpoint?

Apparently, the answers are the following: Redactor doesn't know how to output slugs/URIs instead of full URLs Possibly a solution comes up with craft in the future My API setup is suboptimal: In ...
  • 589
1 vote

Turning off a site in multi-site/multi-environment config

If you are running Apache, you could set your ENVIRONMENT variable in your <VirtualHost> directive using SetEnv ENVIRONMENT "domain2" then have a section: 'domain2' => [ 'isSystemLive' =&...
  • 7,200
1 vote

Craft "Unsupported DB driver" error after resetting Windows

In my case I was missing the .env file in my Atomic SFTP deploy. 🤦🏼‍♂️ So the DB_DRIVER setting was not there...
  • 111
1 vote

After migrating, I am getting this error for several of my buttons and menus on Craft 2.6

This error indicates that you don't have a matrix block, called header, setup in the CMS, but your template is expecting one. The solution is to create a new matrix field; settings > fields > new ...
1 vote
Accepted

Image Transform Files Path

Not currently, but feel free to make a feature request! https://github.com/craftcms/cms/issues
  • 66.5k
1 vote

Setting system email address and sender name in multi config

Shameless plug: We've written a plugin that automatically updates your email settings depending on your environment. It's not free, but it is cheap :-) Please check out the page on our website for ...
  • 201
1 vote

Is there a way to override locale data?

A further requirement came up to change the Italian output (symbol moved to after the price rather than before) so I opted for a simple Twig extension: /** * Wrapper for Craft's NumberFormatter->...
  • 1,503

Only top scored, non community-wiki answers of a minimum length are eligible