Viewers: in countries Watching now:
This course teaches web site designers how to take their sites to the next level with a few advanced techniques and the free and open-source Drupal software. Author Tom Geller shows how to configure the most popular add-on modules; use *nix commands and an FTP program to manage a Drupal site on a web server; change its visual appearance using the latest graphical tools; automate and speed through common tasks with Drush; integrate with social media sites; and see how "supermodules" like Panels, Context, Rules, and Features open up new worlds of code-free development.
Drupal 7 Advanced Training was designed as a follow-up to Drupal 7 Essential Training and it also dovetails nicely with our other Drupal courses, such as Drupal 7 Reporting and Visualizing Data and Create Your First Online Store with Drupal Commerce.
This video is fairly short, but that's deceptive, because server configuration is not only a course into itself, it's an entire career on to itself. But it's important that you know a little about two configuration files in particular, because small changes in them are likely to save your bacon from time to time. The first is php.ini, which controls how the server runs Drupal's PHP programs. The second is .htaccess, which can control just about every setting for how the web server delivers Drupal's output. Let's start with php.ini.
On a shared host, such as I use, I can't edit the servers overall php.ini file directly because doing so would affect everybody else with sites on the same server. So I'll show it using my development environment in Acquia Dev Desktop. I already have that up and running here, and I get to that setting by clicking Settings and then Config. In the current version of Acquia Dev Desktop that I'm using, there's actually two PHP files because PHP was in something of a transition. I happen to know that the version that I'm using is 5.2, so I'll highlight that and then click Edit.
The most important setting in this big file is one that starts with mem, so I'll do a search for mem, Command+F and mem, and there it is, memory limit. Probably you won't make any other changes, but this one is crucial, and I'll show you what it does. I'm going to change it from 256 megabytes to 20 kilobytes, something that's completely inadequate for running a Drupal site. I save it. Go back to Acquia Dev Desktop and then stop the server and restart it.
Now when I reload this page that's running on that server, I get this error saying that it doesn't have enough memory to run the program. This is a fairly common error, and here's how you correct it. You just go back to your php.ini file and change that to something larger; 256 K is way more than you need, but of course, bigger in this case is better. You can't have it too big; the only danger is running out of memory on your computer. I'm going to turn it back to 256 meg; 64 meg is usually enough.
I'll save it, close that out, go back and restart my server, and reload my page and cross my fingers. Yup that fixed it. Now I should mention it might actually be possible to make php.ini changes on your web host by putting a php.ini file inside your Drupal sites' directory. I'll give you a resource to help with that later in this video, but now let's move on to the other file called .htaccess. I didn't need htaccess trick on my tgeller.com site. You see, I had a lot of legacy data and subdirectories on tgeller.com.
For example, at tgeller.com/graphics, and that was on an old HTML site before I started using Drupal. Then I created a Drupal site and put it at tgeller.com, but I wanted the web server to go directly to those files in those subdirectories, avoiding Drupal altogether. If I didn't do that, Drupal would look for a page that was named graphics, and it would fail, and any link that I had done to any file stored in that folder called graphics would also die. I'll show you what I did. So here's a sample file that's from way back in 1996 or so.
That's of my old two-legged dog, Chicken Bone, but you'll notice when I went to tgeller.com, it automatically redirected to old.tgeller.com. So any links to that tgeller.com graphics still work, and if I go to just tgeller.com, it doesn't make a redirect. You see this is actually a Drupal site, which I could prove by saying /user, and then of course, you'll get your Drupal login. So, how did I do that? Well, let's go into our Terminal and take a look. I'm in the directory where I have that tgeller site. Take a look at the files there, and there's the .htaccess.
I'm going to just take a look at that by typing more .htaccess. Lots and lots of stuff in. If I scroll down a little bit, I find the rule that I needed to write. See it says Rewrite, if somebody looks at any of these directories; instead go to old.tgeller.com. Otherwise, my site runs as normal. I'll just stop looking at this file by pressing Q. Now as you saw, there is a lot of stuff up here in this Rewrite rule and when we looked at the php.ini file, there was a lot of complicated stuff there.
Here are some resources that will help you learn how to use both the php.ini file and the .htaccess file. For PHP, I like the instructions and links for my own web host's Help pages. As you scroll down here, you'll see there's a lot of stuff and some of it is specific to my particular host, but a lot of it is actually quite useful for all kinds of host, no matter where you're storing your web site. For htaccess files, an article written way back in 2006 is still the best. It has the amusing name, Stupid htaccess Tricks.
There is a lot of great information in here. In fact, I was able to write that Redirect rule you saw earlier, just from the information that I found here. For easy reference, here are those URLs, and of course, searching for .htaccess and php.ini on drupal.org will also lead you to helpful tips. Once there, I recommend you click on the Documentation link; that usually narrows it down to useful stuff. There is one other configuration file you might have to tinker with, it's called settings.php.
I didn't mention it here, because it's specific to Drupal, whereas .htaccess and php.ini files are for the server itself. We'll cover the settings.php file in another video in this course.
There are currently no FAQs about Drupal 7 Advanced Training.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.