Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [settings.php]

The file that contains the settings necessary for Drupal to connect to the database is the settings.php file.

0
votes
1answer
16 views

Custom database connection

What is the best way to connect to a remote database through drupal? Would the correct method be to use the settings.php with the database in there, and use the built in db_select, db_query() etc ...
1
vote
1answer
14 views

Set max_execution_time for view?

I've got a view that generates a CSV report on user information. However, due to the size of the dataset it's causing the server to timeout. Is there some way that I can set the max_execution_time() ...
0
votes
0answers
24 views

Cannot add a domain to existing drupal 7 site

Sorry in advance if this is a dumb question, I can't seem to figure out how to add a domain name to a D7 site, (currently using an IP). The website is hosted on digitalocean, the new domain is from ...
0
votes
0answers
50 views

Automatically I am logout when I visit the home page

Any logged in user (including Admin) on my Drupal 8 site is directly logged out when he visit a the home page. Say I am on whatever page (/user/1), If I visit the home page by clicking on my website ...
0
votes
0answers
41 views

Proper security for settings.php

I've been developing my Drupal site locally and am planning to migrate it to a proper live host server. When going through the guide to track Drupal with Git, I noticed that it says to put settings....
0
votes
1answer
31 views

Grant permission to current user at runtime in specific environment

Many Drupal contrib modules have inverse "feature flag" implementations vis-a-vis a killswitch variable added to settings.local.php to disable a feature: // Killswitch setting. $settings['...
0
votes
1answer
27 views

Settings.php in read only mode? [closed]

When does drupal settings.php become read-only? I experienced the drupal encountered an error when I was just creating a view. Cannot see the error logs from the admin side. Thought will enable the ...
1
vote
1answer
168 views

basics of settings.php and settings.local.php?

What is the up-to-date basic workflow regarding database credentials when you launch a local version of a site that is already operating remotely? What are the considerations and how is each best ...
0
votes
1answer
62 views

Drush not connecting to site's settings.php

When I run drush --debug status in the docroot of my Drupal site, I get the following message: [user@computer]$ drush --debug status Phar detected. Proceeding to drush_main(). Loading drushrc "/home/...
0
votes
2answers
110 views

Why is it possible to write any string in the hash salt

I have researched a bit, but could'nt find a precise answer to why you can write any string in $settings['hash_salt']. For me it does'nt make sense that the site chashes if no hash salt has been set ...
1
vote
1answer
35 views

Trusted_host_patterns not working with domain

I'm working with a drupal 8 site and trying to get trusted_host_patterns working properly with the domain that I'm using, and no matter what combination of regex I try I can only get it to work with ...
-1
votes
2answers
60 views

Create a setting.*.php file for every stage of the website

I understand that my question could be opition-based and that it depends on the comfort of every drupal developer so please do not flag it as so ! For every Drupal 8 website i start, i use the below ...
0
votes
1answer
268 views

How does Acquia Dev Desktop create the connection to the database?

I am using Acquia Dev Desktop 2 on my windows 10 PC in order to develop Drupal 8 websites. As far as I know, every Drupal website requires a connection between its files and the database which is ...
0
votes
1answer
87 views

Image Styles Not Generating Thumbnails/Previews

I have File Browser installed on my website. The module info can be found here: https://www.drupal.org/project/file_browser When I go to browse for pictures, there are no images. You can see what I ...
0
votes
0answers
38 views

Set dynamic $base_url with Domain Access module to avoid redirects

If you run two URLs with Domain module like e.g. main.site.com sub.site.com main.site.com is main site, so if you go to sub.site.com/user and login, it redirects back to main.site.com. This happens ...
0
votes
1answer
42 views

What core configurations should be used in settings.php for a production site? [closed]

Can someone please share Drupal core configurations that should be included and/or excluded from settings.php to make the site both performant and secure?
0
votes
0answers
214 views

How to create a table in second database with hook_schema

I want to use two databases, that works following: How can I setup multiple database connections in Drupal 8? . I can set the connection in the settings.php file, access it by injecting a different ...
0
votes
1answer
37 views

Two sites, same codebase mystery

Ubunutu Server, two Drupal sites. One dev and one live. Both domain names take you to the same code and database, the ones correct for the live site. Checked apache virtual host files. Both the dev ...
0
votes
0answers
18 views

DATABASE SQLSTATE SQLSTATE[HY000] [duplicate]

Today we tried to check our website but we found this error. I don't know what happened exactly. PDOException: SQLSTATE[HY000] [2002] No such file or directory in Drupal\Component\DependencyInjection\...
-2
votes
2answers
45 views

D7 site does not show well under https

I installed https on my server with certbot and let's encrypt.However site displays garbled under https, which I need for several reason, http requests are not redirected to https for that reason, but ...
0
votes
1answer
411 views

Access violation error on any page or drush

Recently started working with an inherited Drupal 8 website which I am trying to get up and running on my Mac OS X (Sierra) but I am getting this error with a stack trace every time I try run drush or ...
0
votes
0answers
152 views

Error when I'm trying to enable persistent connection

I'm trying to add ATTR_PERSISTENT attribute to my config file. $databases = array ( 'default' => array ( 'default' => array ( 'database' => 'db_name', '...
1
vote
0answers
82 views

How to Add a Default Prefix into the Acquia Dev Desktop Settings

I'm using Acquia Dev Desktop for my local Drupal 7 development. All of the tables in my sites are prefixed with "dr_". Whenever I create or import a site, I have to manually change the settings to ...
0
votes
1answer
704 views

Trusted Host Patterns Settings Not working with IP

So I am trying to get this drupal(drupal845.localhost) site accessible by my VM. But the Trusted Host Settings are not working. Here are the settings in my settings.php $settings['...
0
votes
1answer
1k views

how to change base url in drupal 8 [closed]

I had installed a drupal website inside a folder in web root on an amazon ec2 instance. I used to access it by calling http://xx.xx.xxx.xx/folder .Now that the site is finished i created virtual hosts ...
1
vote
2answers
552 views

Drupal ignoring changes to settings.php

I made a copy of one of my drupal sites and I'm attempting to set it up to use a different database but for some reason it's ignoring changes to my settings.php file. My settings.php file is in sites/...
0
votes
0answers
110 views

connecting to Neo4j on GrapheneDB

I am using Drupal 7 and trying to connect to Neo4J instance on GrapheneDB. I have added the graphaware/neo4j-php module and tried to connect to GrapheneDB using the admin panel in the configuration: ...
1
vote
2answers
1k views

Ajax submission leads to => An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (2 MB) that this server supports

So i'm trying to submit a form using ajax, in my form i have the following: $form['actions']['#type'] = 'actions'; $form['actions']['submit'] = array( '#type' => 'submit', ...
1
vote
1answer
162 views

Where is list of theme features in Drupal 8 that can be exposed on the “Settings” page?

In my theme.info.yml file, I can expose features to show up in the settings of my theme. It's documented here: drupal.org theming features: - comment_user_verification - comment_user_picture - ...
-2
votes
1answer
318 views

In which file is the username/password located? [duplicate]

I did a standard installation of drupal 8 varbase and added this into Aqucia Dev Desktop 2. Where can I find the username/password which is used for the database access from Drupal for the database? ...
1
vote
2answers
2k views

Connecting to a remote database in D8

I have the following params in settings.php to connect to an external database . $databases['d8243']['default'] = array ( 'database' => 'drupal8', 'username' => 'root', 'password' => '...
2
votes
2answers
45 views

What's your trick to document (in the UI?) variables overridden in settings.php?

If you define variable overrides in settings.php, there is no visible change to the admin UI. It's easy when overtired (or just inexperienced) to overlook this when changing some config through the UI,...
5
votes
1answer
485 views

Difference between $this->config and \Drupal::config in ConfigFormBase

I want to override a custom module configuration in the settings.php file. So the configuration in database can be independent from the environment. $config['my_module.settings']['prop'] = 'foo'; I ...
0
votes
2answers
443 views

Error migrating from localhost to server: PHP Unsupported operand types

I'm migrating a Drupal 8 project I developed locally up to the server as a subdirectory in my hosting service that my site domain points to. I've cleared the caches (with drush cr and truncating the ...
1
vote
1answer
66 views

Drupal 7: Local site URLs all point to production site

I've been trying to figure this out for a while on this one particularly large site. Every single URL on every page and menu, even the admin menu as the wrong url. I've tried this with WAMP, MAMP, ...
2
votes
1answer
241 views

How to determine the code for settings.php config override based on .yml?

I am trying to put my API keys in a separate file instead of storing them in config management. For example, I installed the Commerce Stripe module. When I export the config, it looks like this: ...
5
votes
1answer
1k views

Best Way to Handle Variables Per Environment

I have a custom module. It's FormBase to create a form. And on submit, I post values to an API. All this works. But I want to change the base URL variable (which is used in multiple methods) so that ...
0
votes
0answers
50 views

Automating site install from profile - settings.php

I'm trying to automate a site deployment/environment generation using profile installation, but I need to change the trusted_host_patterns key in the $settings variable of settings.php. From what I'...
0
votes
1answer
101 views

Cannot log in site despite having credentials from settings.php

Ubuntu 16.04, Drupal 8 managed through ISPConfig 3.1 I'm trying to log in at mysite.com/index.php/user/login and I get bad username or password. I have copied and pasted from the settings.php file ...
-1
votes
1answer
71 views

Changing the settings on the fly without changing the settings.php

At the moment I'm implementing a module for managing multi-site sites It would be desirable to implement switching a choice of a site in backend and accordingly change settings database connection on ...
1
vote
1answer
203 views

How do I define an external URL in settings.php and call it in a custom module?

In the settings.php file, there are (for example) $base_url, $settings['hash_salt']. I defined $settings['external_url'] = "google.com"; In my custom module, I want to get the $settings['...
1
vote
2answers
251 views

How can I force changes to go to settings.local.php?

I have a settings.php file in git which has the logic to include settings.local.php already uncommented, with settings.local.php in .gitignore for security purposes. I would like to be able to ...
1
vote
0answers
911 views

PHP OPcode caching: Not enabled

I am new to everything Drupal, when trying to start my site under Verify Requirements Drupal 8.2.2 the following error shows: PHP OPcode caching Not enabled PHP OPcode caching can improve your site'...
0
votes
2answers
2k views

How to Clone a production site locally for testing?

Ok so I am kinda new to drupal (I've only been working with it for a few months at work) and I just got my first freelance client who has a drupal site that he wants to modify its layout. I am now ...
0
votes
1answer
61 views

Can view HTML and PHP I wrote but install.php returns error

I installed Drupal8 for the first time to try things out. I used nginx and mySQL on FreeBSD with php-fpm for fastcgi. I have the nginx root set to /usr/local/www/drupal8 cause that's where the install....
3
votes
2answers
759 views

How to use settings.local.php with Drupal 7?

I couldn't find answer from previous questions nor drupal.org/pantheon.io. I don't know that how to get local Drupal to use settings.local.php? There isn't a settings.php if I clone the repo from ...
0
votes
0answers
66 views

Does Drupal strip any HTTP headers?

I'm attempting to implement SSL-offloading using the F5 BIG-IP device. I'm using this article by Nate Haug as a reference: https://www.lullabot.com/articles/setting-up-ssl-offloading-termination-on-...
0
votes
0answers
72 views

why am I unable to install/update modules as an admin?

I have a website created using Drupal-8 within a sub directory as: /var/www/html/drupal so http://example.com/drupal is the path used to access the website. In order to access the website without ...
0
votes
2answers
429 views

How to resolve the problems encountered when moving from local to server? [closed]

Which things do we need to be aware of and change when moving a site (in Drupal 8) from a local environment to a server? In Drupal 7 I would just copy the files, change the database settings in ...
2
votes
1answer
32 views

Drupal 7 sessions wiped after changing settings.php

Yesterday afternoon I had an administrator uncomment and modify the $base_url variable in our production environment. Any changes made in the repository fires off a redeployment which has never been ...