Having problems enabling new modules on local Drupal 7 site - drupal

I have created a local version of my Drupal website to do dev work on. But when I add new modules to the local version they do install but they do not enable correctly. For example I added the legal module, enabled it, but when I go to site configuration to edit it, the legal section does not appear. Any help please?

The problem is that not enough memory will be allocated to the service to allow for new modules which require more memory to be ran, try putting
ini_set('memory_limit', '256M');
in the sites/default/settings.php file.

This is a really old thread but thought it was worth adding the following.
I had this problem recently on a local dev install (using Acquia Dev Desktop, by the way). Turning off the Memcache module resolved my issue.

Related

Symfony / Sylius site on Vagrant / Puphpet is slow. Same site not on a Virtualbox is not slow

We have one particular site that is Symfony and uses the e-commerce bundle Sylius.
Our developers are trying to use Vagrant so we can have similar dev environments. We use Puphpet to generate the Vagrant instance and share the config file.
If we are working on the site/repo natively or on a staging server, all runs fine. Pages load in around 2-3 seconds.
When we are using Vagrant / Virtualbox, it's 30-35 seconds per page load.
So far we've tried
Allocating up to 6GB to the box
Giving up to 4 processors to the box
Turning on NFS for file sync
Turning off all other programs on computers running Vagrant / Virtualbox (chat, other browsers, etc)
None of those things made an impact on page load time.
I can provide 2 things. One is the load trace from Symfony: https://nimbus.everhelper.me/client/notes/share/708707/mvw707mckzm2wq4rlkzc
Since there is so much code to the puphpet config, I put it in a pastebin here: http://pastebin.com/7ciVA5FL
What is OS on a host machine?
My guess would be that file system is slow. Try to run an app outside of shared folder on the guest machine. If it will be fast, then you'll spot a problem at least.
NFS on *nix or mac should be fast enough, are you sure you've succeed to turn it on?
I had this pain once, and finally started to use unison instead of native vagrant's file sharing system (https://www.cis.upenn.edu/~bcpierce/unison/)
Have your tried:
http://www.whitewashing.de/2013/08/19/speedup_symfony2_on_vagrant_boxes.html
or http://jeremybarthe.com/2015/02/02/speed-up-vagrant-environment-symfony2/
I think the first one is already included in Sylius, but not sure.
Also, dynamic image resize/crop may be reading/writing in the host file system and maybe there's a way to also change that (using symlinks or similar)?
vagrant-winnfsd works fine for me for getting NFS to work on Windows.

DotNetNuke Module keeps converting itself into Application in IIS7

Bit of a weird one. For some reason one of my DNN modules keeps being converted into an Application in IIS7 in my development environment. Meaning when I try to view a page that contains that module it can't find the module correctly. It's ok if I go into IIS and delete the application, then restart the site but is a bit of a pain and am little worried it might do this when uploaded to the live server and disable the whole site.
Anyone encountered anything like this before? Any thoughts?
This is a common problem with my VS templates, though not for everyone, and it doesn't happen all the time. It stems from Visual Studio, so it shouldn't ever be a problem on your production servers, unless you upload source and try to compile there, than it might be an issue.
HuwD,
A good resource might be my module template installation video which gives good information on setting up your development environment and debugging issues (regardless of the template you use). Check out between 1:30 and 5:00 minutes for the environment setup, and after 19 minutes some of the troubleshooting.
A couple common problems I see Visual Studio doing is creating an unwanted virtual directory on the DesktopModules folder and/or creating an unwanted web.config in the module's root.
Another good resource is Dnnhero.com. In the development section there is a series on DNN7 environment and template setup.
You may want to give a try a free module called Users Importer - A bit old but worth a try.
Here is a paid alternative: Bulk User Manager

Memcache or Memcached installation for Drupal?

I've been floating around the Google and everything's getting more confusing now. What i want to know is how to install Memcache or Memcached. Even which one to install, i'm still not sure. It is super confusing.
I'm on Redhat RHEL. Actually i have installed Memcached (with 'd`) on my Web Server. Then according to the articles, i enabled Php Extension, etc. Then what is supposed to happen? Totally no improvement in performance.
Then i feel thats not enough and i googled again. Some say to install on MySQL Server. So what about PHP Extension and Drupal Module which are supposed to be configured, if i install it on MySQL Server? I'm really not getting it.
So i have Drupal 7 and please let me know in simple way for which is the right one to follow :(
Memcache or Memcached ? (Why this two so confusing?)
Where to put at?
Does it really need Drupal Module to work?
Please simply give me a straight dummy guide :(
"Memcache vs Memcached" - first one is a module (extension), second one is the daemon. See "Memcache Vs. Memcached" for full explanation
"Where to put at?" - you said you had it already installed on your server, it should be installed easily with some package manager e.g.:
pecl install memcache
"Does it really need Drupal Module to work?" - Yes, Drupal needs to know that you want to use memcache. The Drupal module will move cache, sessions and lock tables into memory (see https://drupal.org/project/memcache).
To make memcache module work, you need to put the following into settings.php (change you module path respectively):
# Memcache
$conf['cache_backends'][] = 'sites/all/modules/contrib/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
To see whether it works, go to "admin/config/system/memcache" (this is Drupal 7 path) and turn on "Show memcache statistics at the bottom of each page" - if everything works well, you should see something similar at the bottom of the page:
OPERATION BIN KEY HIT
get cache_bootstrap cache_bootstrap-variables 1

Drupal Module Development : Uninstall/Reinstall/Repeat?

I'm developing a custom module for Drupal on my local machine.
When I edit my code, the changes are never applied right away. So, I go to Administer Modules, and uninstall, and then reinstall my module. This is cycle of uninstall-install-develop-repeat is slow and tedious.
Is there a better way to do it?
My module makes extensive use of Drupal framework so I'm not sure developing it exclusively in PHP first is an option.
I would highly recommend installing the Devel module. It is very useful while developing for Drupal. Once installed, you can enable the Devel block which is extremely useful. It has a list of links to perform somewhat tedious tasks faster, such as emptying the cache, reinstalling modules, rebuilding the menus, etc.
Many of the changes to your module should not require visiting the modules page. You mostly see the need to do this when you are changing the menu with hook_menu() in your module, as the menus are only rebuilt when visiting that page (or using Devel block "Rebuild Menus" link ;) )
When uninstall/install, the only things that is executed is what is in .install file.
If you don't change this file, you don't have to uninstall/install the module.
Maybe your problem is just a cache issue. Drupal strongly cache a lot a things. And when you enable a module, the cache is cleared. You can clear you cache manually.
On an other hand, I recommand to look on Drush that allow you to do those things faster. (clear cache, enable/disable a module/...)
The Drupal admin menu (http://drupal.org/project/admin_menu) along with devel comes in very handy if you have to flush caches.
Just drop cache on each time when you edit your code
Administer->Site perfomance
How can re-install module using Drush commands ?
Run command
drush dre cars_api
For details visit
https://drushcommands.com/drush-9x/devel/devel:reinstall/
======================== Drush For Drupal ========================
What is Drush ?
Ans : Drush is a command line shell and scripting interface for Drupal, and it is work like
Laravel-Artisan, and Angular CLi etc.
It is very Help-full for fast development on Drupal.
Official Website -> http://www.drush.org/
Official composer repository -> https://packagist.org/packages/drush/drush#dev-master
Official Drupal Repository -> https://www.drupal.org/project/drush
What is the Installation Process ?
Ans : There is following steps.
1.Step
Install new and latest version of composer
2. Step
Run in vscode Terminal
composer global require drush/drush:9.x-dev
check the installation in terminal via following command
drush version
For more details visit
https://packagist.org/packages/drush/drush#dev-master
And also helpful
http://docs.drush.org/en/master/
3. Step
Visite following link and see Drush All conads details and documentation
https://drushcommands.com/drush-9x/
https://www.drupal.org/docs/user_guide/en/prevent-cache-clear.html
How can resolve Drush Errors ?
Run command in vscode terminal
Composer require drush/drush
How can see drush commands list in terminal ?
Just type in vscode terminal in project dir
Drush
and enter
So all commands will be listed with summary
Uninstallation process for Drush ?
Just change in command ‘require’ to ‘remove’
composer global remove drush/drush:9.x-dev

New to SVN, How to Setup?

I have a Windows 2003 Server with IIS, I installed VisualSVN Server on it.
I have two developers, who are going to use TortoiseSVN.
Since this is my first time ever setting up a SVN server I am kind of confused on how this will all work. The way I see it, each developer would have a copy of the repository on his or her local pc, would each person be required to have IIS installed on their PC as well to test their copies before checking out?
Should I create a testing folder on the server and then a production ready? It seems as if that would cause more issues with copies?
What would you do?
EDIT
I dont know what I was thinking, I forgot that VS has a built in IIS when you debug so the issue about setting up IIS on either client or server is now a non-issue. But I am confused, I imported the site into the repo, it said it was on revision 2 but I dont see any of the files in the repo folder. Do I create a virtual folder in IIS pointing to the repo that I created?
No, each developer uses your repository, and checks out their own copies to do their work. They do not need IIS or svn, etc, installed on their systems.
I recommend reading up on the Subversion FAQ.
Your devs don't have a local repository, they have a Working Copy on their PC. Typically, this is the most recent version of the app with whatever changes have been made by the developers but not committed yet.
As this is a web app, then your developers will need some kind of web server locally to test it - this could be IIS, or Visual Studio's built in web server (although that does behave differently to IIS in subtle ways).
You said in a comment: "My problem is I dont want the devs to commit to the live site in case there was a bug.".
The devs commit to the SVN repository on the server: at some point you will want to export (aka 'publish') a copy from the latest version in your repository to your live site. In order to make sure this works, you can check out a specific version from the server, test it, and if it passes the tests upload it: devs will always check in code with bugs (even though it builds) as it's better to check code in frequently than build up lots of changes locally then commit them, as there are bound to be conflicts with work other developers have done.
Branching and Tagging are useful concepts here: when you have a version which is almost right, you 'branch' it away from the main 'trunk' of the source code tree, fix any issues in the branch (back-porting to the main trunk as required), then when you have a working version you 'tag' it (as version x.y.z) and upload it. This way you can always refer to the particular version of the code you have uploaded, which makes it a lot easier to identify bugs which turn up in production. As others have suggested, read the SVN documentation for more info.
It depends on how you work. There are other discussions about folder structure and such which play directly into how you use version control.
Uh, no, no local repositories. Setting up SVN is easy, well almost. You'll want to look for the svn windows installer and set it up on the server. You'll want to install Apache and then you'll have a little hurdle setting up the http.conf file to expose svn over http. There's a little complexity with setting up security so go with Windows Authentication, you'll need WebDav, google it.
Once that's done, any svn client can hit it and checkout a copy and work with SVN normally. If you get really stuck, comment here and I'll go get a copy of our install and config for you.
The good news is that it's rock solid, once you get it setup it'll run forever.
"Pragmatic Version Control Using Subversion" and the SVN red-bean are the two sources you need to see.
Set up SVN on a single server and have all your developers point to it.
I've installed tortoise on the server and do Updates / Checkouts of the release website. Some people don't like checking in compiled code, but I like having the production compiled site in SVN.
If you use tortoise on the server, Do the initial checkout to the inetpub/website directory and then on rollouts you just need to update the directory using tortoise->update
Of course checkin to rollout is considered bad practice without first rolling out and testing on staging servers, but depends on your team size.
I have used the following resources for learning SVN:
http://www.polymorphicpodcast.com/shows/subversion/
http://www.dimecasts.net/Casts/ByTag/SVN
Found both quite good, and learning by watching can be easier especially for getting started.
No - your central server will maintain the repository. Your developers will get copies of the repository, make changes, and then commit them to your repository.
You actually have quite a few things to figure out if you want to do a successful deployment of subversion.
One really good article about setting up subversion on Windows - https://blog.codinghorror.com/setting-up-subversion-on-windows/
No, SVN server must be installed on a single computer. Each developer point at this computer and get locally (and eventually) a full copy or a partial copy of the repository.
You may also buy a book from O'Reilly about Subversion. Don't remember the title, sorry, but it helps me a lot.
All the best ! Sylvain.

Resources