I try to setup my .gitignore file. My local repo is a clone from my Drupal 8 distro from Acquia Cloud.  (I want to theme my template locally and then, step by step I want to push it to Dev on Acquia Cloud.)  So regarding handeling settings.php, whether or not to ignore settings.php and whether or not use settings.local.php:  If I look in my current settings.php is see this:  // On Acquia Cloud, this include file configures Drupal to use the correct // database in each site environment (Dev, Stage, or Prod). To use this // settings.php for development on your local workstation, set $db_url // (Drupal 5 or 6) or $databases (Drupal 7 or 8) as described in comments above.   I am confused and don't know anymore how to setup my .gitignore file with all this information and whether or not use settings.local.php. Please can somebody advice my what I have to do exactly, so it's setup correctly from the beginning.
124263
I want to add .gitignore file to my local repo. My local repo is a clone from my Drupal 8 distro from Acquia Cloud.  What are best practices for my .gitignore file for Acquia Cloud hosted sites? I followed .   For example: do i have to ignore settings.php and not settings*.php? Regarding this quote from :      Drupal 8 You can modify .gitignore so that it ignores settings.php   (not settings*.php). Then, you can update the standard settings.php   with the Drupal 8 local settings file checker:    Where is settings.local.php for, mentioned in the Quote above from ?   Currently my .gitignore file looks like this:  # This file contains default .gitignore rules. To use it, copy it to .gitignore, # and it will cause files like your settings.php and user-uploaded files to be # excluded from Git version control. This is a common strategy to avoid # accidentally including private information in public repositories and patch # files. # # Because .gitignore can be specific to your site, this file has a different # name; updating Drupal core will not override your custom .gitignore file.  # Ignore core and vendor when managing dependencies with Composer. # core # vendor  # Ignore configuration files that may contain sensitive information. sites/*/settings*.php sites/*/services*.yml  # Ignore paths that contain user-generated content. sites/*/files sites/*/private sites/*/files-private  cache/ files/  # Ignore SimpleTest multi-site environment. sites/simpletest  # If you prefer to store your .gitignore file in the sites/ folder, comment # or delete the previous settings and uncomment the following ones, instead.  # Ignore configuration files that may contain sensitive information. # */settings*.php  # Ignore paths that contain user-generated content. # */files # */private  # Ignore SimpleTest multi-site environment. # simpletest  # Ignore default text files /CHANGELOG.txt /COPYRIGHT.txt /INSTALL*.txt /LICENSE.txt /MAINTAINERS.txt /UPGRADE.txt /README.txt sites/all/README.txt sites/all/modules/README.txt sites/all/themes/README.txt  # ------------------------------------------------------------------------------ # SublimeText files # ------------------------------------------------------------------------------  # Workspace settings. *.sublime-workspace  # Project settings. *.sublime-project  # ------------------------------------------------------------------------------ # OSX # ------------------------------------------------------------------------------  # Common OSX files. .AppleDouble .DS_Store .LSOverride  # Thumbnails. ._*  # Files that might appear in the root of a volume. .DocumentRevisions-V100 .fseventsd .Spotlight-V100 .TemporaryItems .Trashes .VolumeIcon.icns  # Directories potentially created on remote AFP share. .apdisk .AppleDB .AppleDesktop Network Trash Folder Temporary Items  # ------------------------------------------------------------------------------ # Windows # ------------------------------------------------------------------------------  # Windows image file caches. ehthumbs.db Thumbs.db  # Folder config file. Desktop.ini  # Recycle Bin used on file shares. $RECYCLE.BIN/  # Windows Installer files. *.cab *.msi *.msm *.msp  # Windows shortcuts. *.lnk  # ------------------------------------------------------------------------------ # Linux # ------------------------------------------------------------------------------  # Tilde files. *~  # KDE directory preferences. .directory  # Linux trash folder which might appear on any partition or disk. .Trash-*   What do i have to change to make it perfect?
3767
I created a module through Drupal Console, unfortunately it wasn't placed in a folder of its own, rather straight into /modules/custom. Before I noticed where it had gone, I enabled the module.   In Drupal 6/7, this was easy to fix - I could literally just put the files into the correct path, clear the cache (maybe rebuild the registry, it wasn't an exact science), and all was well.  The same isn't true for Drupal 8; I moved the files into a subfolder, rebuilt cache, and all requests tell me that Drupal is failing to include a required file. The particular file is a block class, and the path Drupal is trying to find it is where it used to be, not where I've moved it to.  The bit of code objecting is in Symfony's ApcClassLoader, so I guess I need to clear something that's slightly above Drupal's head to get this path reference updated.  How can I do that?  Uninstalling and re-installing the module does work, but once there's important data stored that's not going to be an option.  I was wrong, uninstalling and re-installing is not a viable option. After uninstalling and reinstalling, Drupal can no longer pick up the custom blocks the module defines. I'm guessing that reference is cached somewhere that isn't cleared when the module is uninstalled. Just need to find out where that is and how to clear it...
106916
I need to automatically install a package with its config file already present on the server.  I'm looking for something like:  apt-get install --yes --force-yes --keep-current-confs mysql-server  Probably a dumb question but I can't find such an option.
57387
I am attempting to upgrade my Drupal 8.9.2 multi-site installation to D9. I was hoping to work this all out on a development installation, that is located in a subdirectory of my home directory on my NameCheap Shared Hosting plan. When I first installed this installation, I did so using the tarball method from years ago. I then followed the instructions given here (). I was able to get the current running prod version converted to use composer with out an issue. Before I go and start messing with the files, and attempting to upgrade to D9 through composer on a prod installation, I wanted to copy these files over to another installation where I can use it as a sandbox. To do this I:  copied the files on my server to a new directory made clone databases for the new installation truncated all the cache tables in the cloned DB changed all the database settings in the settings files to point to the cloned databases  I've done this before without any issues, and now I seem to be getting a WSOD error on all the sites running from the new installation. The error I'm getting is  PHP Fatal error:  Uncaught Error: Class 'Drupal\Core\Cache\DatabaseBackend' not found in ~/{new installation dir}/public_html/index.php:16.  If anyone has any thoughts what's going on I am all ears. Thank you in advance
113019
Here's my setup. I have a Multisite instance running at , and I want to do development and staging. Moving an existing Multisite instance of WP onto localhost is a nightmare, so I'm going to do dev on a staging location instead.  I set up  to point to the /public_html/staging/ directory of the hosting account, and copied all of the WP files from my root into the /staging/ directory. I also copied the database files (SQL dump, imported the tables into a new database), and changed the wp-config.php file to point to the new database.  After running SQL to change the database records, I also change this one line in the wp-config.php file:   /** Turning on WordPress MU, new in 3.0 */ define( 'MULTISITE', true ); define( 'SUBDOMAIN_INSTALL', false ); $base = '/'; define( 'DOMAIN_CURRENT_SITE', 'example.com' ); // &lt;- I change this line define( 'PATH_CURRENT_SITE', '/' ); define( 'SITE_ID_CURRENT_SITE', 1 ); define( 'BLOG_ID_CURRENT_SITE', 1 );   Changed to:  define( 'DOMAIN_CURRENT_SITE', 'staging.example.com' ); // &lt;- now changed   When I load up , I get... Error establishing database connection!  I've checked and triple checked the username and password, made sure that the user has all privileges on the new staging database, and I've left the DBHOST as 'localhost' (although changing it to staging.example.com didn't help, either).  Why would the database connection fail? Anyone? (Thanks for your help in advance.)  NB:  is working fine running on very similar db connection settings, just with a different database, so it's not an issue with the database server being down.
77938
I have a drupal site running currently on bluehost. The site is big and I want to test every thing I change on local host before doing it on production site.  Unfortunately, I can not move it to from the remote server to local host.  Can someone give me the basic steps needed to move site from remote server to my local host (aquia dev desktop)?
66981
This is excerpt from my composer.json file (trimmed for readability). It was created by running composer create-project drupal/drupal my_site_name 8.0.* as described on :  {   "name": "drupal/drupal",   "type": "project",   "require": {     "composer/installers": "^1.0.21",     "wikimedia/composer-merge-plugin": "^1.3.0"   },   "replace": {     "drupal/core": "~8.0"   },   "minimum-stability": "dev",   "prefer-stable": true,   "extra": {     "merge-plugin": {       "include": [         "core/composer.json"       ],       "recurse": false,       "replace": false,       "merge-extra": false     }   } }    If I just do composer update - core is not updated, only packages inside vendor dir. If in addition to the above, I update my composer.json file and replace core version with ~8.1 - still core not affected.   The only thing that worked for me was to:   Remove core dir, vendor and composer.lock. Edit composer.json and:   Remove replace section. Add "drupal/core": "~8.1" to require section.  Run composer install.   That worked however every installed package complained that:     Class Drupal\Core\Composer\Composer is not autoloadable, can not call post-package-install script   So I'm not sure if the whole process completed flawlessly. Also removing core directory seems like a desperate move.  What is the recommended procedure of updating core to the next minor version with composer (for example 8.0 => 8.1)? Note that I am not using  as suggested in .  Update 1  After trying to use composer require --update-with-dependencies "drupal/core:8.1.*" I got no results:  $ composer create-project drupal/drupal my_site_name 8.0.* Installing drupal/drupal (8.0.6)   - Installing drupal/drupal (8.0.6)     Cloning c5afca05cde0c94ef4d7aff5b078be27024670d2  Created project in my_site_name Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Nothing to install or update Generating autoload files &gt; Drupal\Core\Composer\Composer::preAutoloadDump &gt; Drupal\Core\Composer\Composer::ensureHtaccess Do you want to remove the existing VCS (.git, .svn..) history? [Y,n]? Y $ cd my_site_name/ $ composer require --update-with-dependencies "drupal/core:8.1.*" ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Writing lock file Generating autoload files &gt; Drupal\Core\Composer\Composer::preAutoloadDump &gt; Drupal\Core\Composer\Composer::ensureHtaccess   I'm using composer version 1.1-dev.
90468
I have postgresql 8.4 installed on my desktop. It keeps starting on bootup because I think I used default settings.   so I issue /etc/init.d/postgresql stop everytime and sometimes i keep forgetting  It has folder paths as,  /etc/postgresql/8.4/main /usr/lib/postgresql/8.4   There are a lot of configuration files and if someone can tell me where to look and what to change, that will be great.   Thanks.
110412
I'm doing a Laravel project and I need to set up a virtual host example.dev in my system. For that I've created a copy of 000-default.conf and named it as example.dev.conf and placed in /etc/apache2/sites-available. The contents of the file is given below (comments removed):  &lt;VirtualHost *:80&gt;     &lt;Directory /var/www/html/example/public/&gt;         Options Indexes FollowSymLinks MultiViews         AllowOverride All         Require all granted     &lt;/Directory&gt;      ServerName example.dev     ServerAlias www.example.dev      ServerAdmin admin@example.dev     DocumentRoot /var/www/html/example/public      ErrorLog ${APACHE_LOG_DIR}/error.log     CustomLog ${APACHE_LOG_DIR}/access.log combined &lt;/VirtualHost&gt;   Then I've enabled the site using a2ensite command and disabled 000-default.conf using a2dissite command. Then it will open my project when I try localhost (/var/www/html) in my browser and not example.dev. The virtual host example.dev always produce "The site can't be reached" error in browsers.  Any suggestions?
37469
I am looking at using  , but I am not sure how easy it is to update a distribution when a new version comes out.  Also, can I use drush to do it, or do I have to manually download and unpack the distribution?
123782
I tried installing Drush with both methods listed in the drush.org documentation. I think they might be conflicting with each other if that's possible.   When I run composer global require drush/drush all the components appear to install correctly. However when I change to a Drupal site (Using XAMPP, /opt/lampp/htdocs/sitefolder) and run drush status I get the following error:      PHP Fatal error:  Undefined class constant 'MYSQL_ATTR_SSL_CA' in   phar:///usr/local/bin/drush/lib/Drush/Sql/Sqlmysql.php on line 56   Drush command terminated abnormally due to an unrecoverable error.   [error] Error: Undefined class constant 'MYSQL_ATTR_SSL_CA' in   phar:///usr/local/bin/drush/lib/Drush/Sql/Sqlmysql.php, line 56   I do have the following line in my ~/.bashrc:  export PATH="$HOME/.composer/vendor/bin:$PATH"  Unfortunately I don't know how to troubleshoot from here, as there doesn't seem to be an easy way to uninstall Drush via the main method (), which didn't seem to work for me. composer global remove drush/drush does appear to run successfully.  Thanks in advance.
26367
Which files should I include in .gitignore when using Git in conjunction with Xcode?
113678
I've tried other solutions, but none of them are specific to my setup. I just started using the new Linux subsystem featured in the recent Windows 10 update. I'm using WAMP x64 v3.0.6, and have successfully cloned my website and got it up and running. At the root of the Linux subsystem, I installed Drush globally with Composer, using the directions given on the .  Typing drush status returns the following when I run it in my default directory:  Drupal version         :  7.50  Site URI               :  http://default  Database driver        :  mysql  Database hostname      :  localhost  Database port          :  Database username      :  root  Database name          :  aerosphere  PHP executable         :  /usr/bin/php  PHP configuration      :  /etc/php5/cli/php.ini  PHP OS                 :  Linux  Drush script           :  /home/bob/.composer/vendor/drush/drush/drush.php  Drush version          :  7.1.0  Drush temp directory   :  /tmp  Drush configuration    :  Drush alias files      :  Drupal root            :  /mnt/c/wamp64/www/drupal-7.50  Site path              :  sites/default   But, as mentioned in the title, drush cc all returns No Drupal site found, only 'drush' cache was cleared.[warning] I assume it has something to do with adding a path to the .bashrc, but I don't know what to add. Any tips would be greatly appreciated!  My question is different from "", they're on a Mac and using MAMP, and I'm using WAMP on Windows. I've tried the solutions offered on that post, but the issue has not been resolved.  I'm obviously having issues connecting to MySQL as I get this when I run mysql command:     The program 'mysql' can be found in the following packages: * mysql-client-core-5.5 * mariadb-client-core-5.5 * mysql-client-core-5.6 * percona-xtradb-cluster-client-5.5      Try: sudo apt-get install .   So I've added these lines to my .bashrc file:  PATH="$HOME/.composer/vendor/bin:$PATH" export PATH="/mnt/c/wamp64/mysql/mysql5.7.14/bin:$PATH"   The top line was added to get drush working. I've checked multiple times, and I have the path correctly set, but it's still not working.
64792
In Drupal 7, if we wanted to push code to our environments enabling modules, we would call  in hook_update_N(). We no longer have that in Drupal 8, so how do we programmatically enable modules? Do we use Drupal 8's Configuration Manager or hook_update_N()?  A diff on the exported configuration yields this:  +++ b/cim/sync/core.extension.yml @@ -10,6 +10,9 @@ module:    config: 0    contact: 0    contextual: 0 +  ctools: 0   So it seems the module is enabled via code using Configuration Manager. We're also working with the idea of this:  function mymodule_update_8003() {   $modules = array(     'ctools',   );   \Drupal::service('module_installer')-&gt;install($modules); }   What is the correct method?
76790
I've looked at dozens of other questions and references on the web - and by all my calculations, my setup should work, but it doesn't.  I have nginx installation with php-fpm.  If I try to access a .php file, it runs correctly and I get the correct results.  I got this in my config file:  location ~ \.php$ {     try_files $uri =404;     fastcgi_pass unix:/var/run/php5-fpm.sock;     include fastcgi_params;     fastcgi_param SCRIPT_FILENAME  $document_root$fastcgi_script_name; }   Now, I want to setup my web app so that /somedir/file automatically executes /somdir/file.php while still displaying /somdir/file in the browser's address bar.  So I modified my config to contain the following:  location / {     try_files $uri $uri/ $uri.php?query_string }   This kind of works, that is, the server does access the .php file.  Yet, instead of executing it using the existing location ~ \.php$ block above, it simply spits the php source code as the download into the browser.  If I append the .php manually to the requested URL, then the php is executed.  It feels as if once the server matches try_files to $uri.php, it then does not do another pass at locations to see that what it needs to do with the php files.  I tried putting the php block above and below the location /, but it makes no difference.  How can I get the php to be executed?
45688
I've been using git to track changes in the plugins and themes I've developed for different sites. Each plugin or theme has their own repository in whichever local install of WordPress I happen to be using for that project. This works fine when I'm just working on one solitary plugin or theme.  But when I have a local version of an entire site which is a collection of different plugins, themes, WordPress core, etc. Should I be keeping that entire directory under version control?  Is there a best practice to always have a collection of repositories for each theme/plugin, or for each client site to have one monolithic repository that includes all the code used in the project (including the latest copy of WordPress via svn.)
44568
I've been away from drupal for 2-3 years. I just came back around and installed drush via composer () and now every time I try to use drush I get a message telling me that I should be using composer:  ~/sites/d7 $ drush version  Drush version : 9.0-dev-gd4a3872 ~/sites/d7 $ drush dl drupal-7.x  [notice] dl has been deprecated. Please build your site using Composer. Add new projects with composer require drupal/[project-name]. Use https://www.drupal.org/project/composer_generate to build a composer.json which represents the the enabled modules on your site.   I downloaded drupal 8 following these , but when I try to use drush in that project I get this message:  ~/sites/cfbtv/web $ drush dl devel This codebase is assembled with Composer instead of Drush. Use `composer update` and `composer require` instead of `drush pm-updatecode` and `drush pm-download`. You may override this error by [error] using the --pm-force option.   Is there something wrong with my local env, or is drush a thing of the past now?