Installation guide for Drupal 6.x
The following pages cover the installation of Drupal 6. For information about installing Drupal 5, see the Drupal 5 guide.
Drupal provides an installation script that automatically populates database tables and configures the correct settings in the settings.php file. This section covers preparing for installation, running the installation script itself, and the steps that should be done after running the installation script has completed. It also explains how to do a "multi site" installation, where a number of different Drupal sites run off the same code base.
Before proceeding with your first Drupal installation, you should also review the best practices section. For help with Drupal terms, see the terminology page.
Other tools
Some of the steps in the installation process can be performed with tools such as graphical applications for moving files and managing databases or tools that are provided by your hosting service. This documentation focuses on performing tasks at the command line. For information on using other tools, see the documentation that accompanies the application or is provided by your hosting service.
Creating a test site on a local computer
It is considered a good practice to do all development work on a separate test site before making changes to a production site. A test site allows you to evaluate the impact of upgrades, new modules, modifications to themes etc. without causing disruption to your live site. For information about setting up a web server on a local computer, see the Local Server Setup section of the Developing for Drupal guide.
Alternative methods for installation
Some web hosting companies offer "one-click" installations of Drupal, or specific Drupal support. You may be able to locate one on the Drupal hosting handbook page.
There is also a handbook page listing Drupal distributions, which include installation profiles and pre-packaged distributions of Drupal and modules. These may be of help as well.
System requirements
Note: if you meet these requirements but still have problems with your site, be sure to read through the Webhosting Troubleshooting FAQ.
Resources
Drupal 7 installation has been tested with several operating systems. It is difficult to recommend an absolute memory or runtime amount. A Drupal installation may have none, few, or many contributed modules which drive an increase in memory requirements.
Servers successfully installed Drupal 7 with no errors when memory was a minimum of 32M to 90M. Runtime was successful when the time parameter was at least 30 to 60 seconds.
MAMP memory changes should be made in the main php.ini file usually located in: /Applications/MAMP/conf/php5/php.in
Web Hosting Databases
If your web hosting account is set up with a graphic control panel such as Plesk or CPanel, it is very likely that you do not need to worry about installing a driver for MySQL -- it is probably already installed on your server. You might wish to simply create your database and proceed with installing Drupal, and then refer back to Drupal documentation for specific troubleshooting help if you run into problems.
Web server
Drupal has been deployed successfully on both Apache and IIS.
Apache (Recommended)
- Drupal will work on Apache 1.3 or Apache 2.x hosted on UNIX/Linux, OS X, or Windows. The majority of Drupal development and deployment is done on Apache, so there is more community experience and testing performed on Apache than on other web servers.
- You can use the Apache 'mod_rewrite' extension to allow for clean URLs.
- Drupal core will work using IIS 5, IIS 6, or IIS 7 if PHP is configured correctly.
- To achieve clean URLs you may need to use a third party product. For IIS7 you can use the Microsoft URL Rewrite Module or a third party solution.
- When using Drupal on IIS 7 with fastcgi you must install Hotfix kb954946, or wait until the hotfix appears in a package update (recommended). KB954946 was included in Windows 2008 Server SP2
Drupal is being developed to be web server independent, but we have limited or no reports of successful use on web servers not listed here.
The total file size of your Drupal installation will depend on what you add to your site, but Drupal core files alone will take up approximately 2 to 3 MB uncompressed. The exact size depends on the version of Drupal you have installed.
PHP
Recommended: PHP 5.2.x
Required: PHP version 4.3.5 or higher
- PHP 5.3 is only supported by Drupal 6.14 and above.
- PHP 5.2 or higher will be a requirement for Drupal 7.
- PHP memory requirements can vary significantly depending on your use of modules. While 16 MB may be sufficient for a default Drupal 6 installation and 30 MB may be sufficient for a default Drupal 7 installation, a production site with a number of commonly used modules enabled (CCK, Views etc.) could require 64 MB or more. Some installations may require much more, especially with media-rich implementations. If you are using a hosting service it is important to verify that your host can provide sufficient memory for the set of modules you are deploying or may deploy in the future. (See the Increase PHP memory limit page in the Troubleshooting FAQ for additional information on modifying the PHP memory limit.)
- The PHP extension for connecting to your chosen database must be installed and enabled. Drupal's currently supported database connectors are: mysql (the original MySQL extension), mysqli (an improved connector for newer MySQL installations), and pgsql (for PostgreSQL). Note: PHP 5.x no longer enables the mysql extension by default. Please read the links above for installing and enabling your chosen connector. Additionally, Drupal 6.x does not provide the option to select the mysql connector if mysqli is enabled in your PHP configuration.
- PHP XML extension (for Blog Api, Drupal, and Ping modules). This extension is enabled by default in a standard PHP installation; the Windows version of PHP has built-in support for this extension.
- An image library for PHP such as the GD library is needed for image manipulation (resizing user pictures, image and imagecache modules). GD is included with PHP 4.3 and higher and enabled by default. ImageMagick is also supported for basic image manipulations in Drupal core but there is much less support from contributed modules.
- PHP needs the following configuration directives for Drupal to work (only directives that differ from the default php.ini-dist / php.ini-recommended):
- register_globals: off; this is the default value, but some hosts have it enabled
- session.save_handler: user
- error_reporting set to E_ALL & ~E_NOTICE. Work is ongoing to change this to E_ALL for Drupal 6 and Drupal 7.
- safe_mode: off. Safe mode may interfere with file and image uploads.
- Php Data Objects (PDO) must be activated for Drupal 7 to install and run correctly. Look in your php.ini. Uncomment (remove the leading semicolin) at line extension=php_pdo.dll, extension=php_pdo_mysql.dll. If these lines are not there, you will need to add them. You can also use
pecl install pdo
to install pdo. - In addition, we recommend the following setting: session.cache_limiter: nocache
- Some of these settings are contained in the default .htaccess file that ships with Drupal, so you shouldn't need to set them explicitly. Note, however, that setting PHP configuration options from .htaccess only works under the following conditions:
- With Apache (or a compatible web server)
- If the .htaccess file is actually read, i.e. AllowOverride is not None
- If PHP is installed as an Apache module
- See the PHP manual for how to change configuration settings for other interfaces to PHP.
- In some shared hosting environments, access to these settings is restricted. If you cannot make these changes yourself, please ask your hosting provider to adjust them for you.
Database server
Recommended: MySQL 4.1 or MySQL 5.0
- Drupal 5.x and earlier supports MySQL 3.23.17 or higher. MySQL 4.1 or higher is strongly recommended.
- Drupal 6 supports MySQL 4.1 or higher.
- Drupal 7 will only support MySQL 5.0 or higher.
-
NOTE: Drupal makes use of some features not available on some inexpensive hosting plans so please check that your host allows database accounts with the following rights:
SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER.
These rights are sufficient to run Drupal core 6.x.Some contributed modules, and also Drupal core 5.x (but not Drupal core 6.x), additionally require the following rights:
CREATE TEMPORARY TABLES, LOCK TABLES. - Note: If your system/host is running MySQL 4.1 or newer and you receive the error "Client does not support authentication protocol requested by server", address the problem by following the instructions provided by MySQL AB. There is a minor OS issue with some MySQL 5+ installations primarily on Windows but affecting some versions of Unix/Linux as well.
- Note: When using Drupal 5.x or later, particularly with contributed modules, it may be necessary to set the system variable max_allowed_packet to at least 16M. Some inexpensive hosting plans set this value too low (the MySQL default is only 1M). In that case, you may need to choose a better hosting plan. A value of 1M may be sufficient for 5.x.
- Note: Drupal supports MyISAM and InnoDB table types. NDB tables (MySQL Cluster) are not supported.
PostgreSQL 7.4 or higher
- Note: Some contributed modules are not as abstracted from MySQL-specific code as everyone would like. If you are familiar with PostgreSQL please file issues with those contributed modules as you find them.
- Drupal 7 will only support PostgreSQL 8.3 or higher
- PHP 5.2.6 for Windows has a bug in its pgsql extension. You will need to replace it with the php_pgsql.dll from version 5.2.5.
Currently Microsoft SQL Server and Oracle are not supported, but various efforts are underway to supply schema. Please see discussions in the Enterprise Group if you are interested in working on this.
Browser requirements
Websites built using just Drupal core (i.e. with no additional, contributed modules) are compatible with, and fully functional, in all modern browsers that support CSS and JavaScript. However, browsers have varying levels of compliance with Internet standards such as CSS 2, so there may be minor variations in appearance.
Here is an incomplete list of browsers that are known to work well with Drupal core and support all of its features:
- Internet Explorer 6.x and later
- Firefox 2.x and later
- Opera 7 and later
- Safari 1.x and later
- Camino 1.x and later
- Google Chrome
It is also possible to use a browser that does not support JavaScript with Drupal, although the functionality will of course be slightly different. For instance, in Drupal 6 running in a browser with JavaScript enabled, you can use a drag-and-drop interface to position blocks on the Blocks administration page (admin >> site building >> blocks). If you don't have JavaScript, you will still be able to position blocks, but you will use an interface more like Drupal 5, where you will assign numerical weights to the blocks.
It is also possible to use a browser that does not support CSS with Drupal, but of course the site will not look very similar to how it looks in a browser that does support CSS.
Some contributed modules and themes may not be compatible with all browsers. If you find a problem with browser compatibility in a contributed module or theme, or some functionality in a contributed module that does not work at all without JavaScript enabled, please submit an issue to report it to the module or theme maintainer.
Download Drupal
Run the install scriptTo run the install script point your browser to the base URL of your website.
The base URL is defined in your Web server configuration file and is specific to the document root where you placed your Drupal files. If you have installed Drupal on a Web server this will likely be a domain name such as http://example.com. If you have installed Drupal on your desktop machine this URL might be http://localhost.
You will be guided through several screens to set up the database, create tables,
![2009102509365431.png](https://i-blog.csdnimg.cn/blog_migrate/8b4465e81486b2233919bee714ca246e.png)
add the first user account and provide basic web site settings.
![2009102509374078.png](https://i-blog.csdnimg.cn/blog_migrate/6398e208f0ce83aad3c7702b14e6a5dc.png)
Note
If your site is not configured for clean url's you can troubleshoot this later. The Update notifications box will check for later versions of Drupal and contributed modules. If you are without or have restricted Internet connectivity you may want to uncheck this for now and test and enable it later.
On success, you will see the Drupal installation complete screen. If there are any error message, review and correct them now.
The install script will attempt to create a files storage directory in the default location at sites/default/files (the location of the files directory may be changed after Drupal is installed). In some cases, you may need to create the directory and modify its permissions manually. Use the following commands (from the installation directory) to create the files directory and grant the web server write privileges to it:
mkdir sites/default/files
chmod o+w sites/default/files
The install script will attempt to write-protect the sites/default directory after creating the settings.php file. If you make manual changes to that file later, be sure to protect it again after making your modifications. Failure to remove write permissions to that file is a security risk. Although the default location for the settings.php file is at sites/default/settings.php, it may be in another location if you use the multi-site setup, as explained below.
If installing in subfolder
Instruction says to start web-based install go to http://example.com
Perhaps that's accurate if you're installing in the root.
But if installing in subfolder, for me I had to specifically point to the install.php file:
http://example.com/subfolder/install.php
in order to get the initial installation page to come up. Without pointing to install.php (http://example.com/subfolde) I got a host of errors and no installation page.
Installing Drupal-6.13 on OS X
Thought I'd share what seems to have worked for me to install Drupal-6.13 on OS X (not server), Leopard (10.5.7), Apache2
1) Install Drupal 6.13 as /Users/xxx/Sites/drupal, user xxx is in the "_www" group and make the entire installation is group writable. Create a soft link from /Library/WebServer/Documents/xxx -> /Users/xxx/Sites (This is purely a test installation so I didn't want this in my system document root.).
2) Re-writing seems to be enabled by default in Apache2 on Leopard. Enable PHP5 and virtual hosts in Apache2, i.e. by uncommenting these lines in /etc/apache2/httpd.conf:
#
# Dynamic Shared Object (DSO) Support
#
...
LoadModule libexec/apache2/libphp5.so
...
# Virtual hosts
Include /private/etc/apache2/extra/httpd-vhosts.conf
3) Add a virtual host stanza to the
/private/etc/apache2/extra/httpd-vhosts.conf
file that has at least this in it:<VirtualHost *:80>
DocumentRoot /Library/WebServer/Documents
ServerName localhost
<Directory "/Library/WebServer/Documents">
Options FollowSymLinks Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
4) Add a variant of the
RewriteBase /drupal
line in the stock /Users/xxx/Sites/drupal/.htaccess file:<IfModule mod_rewrite.c>
RewriteEngine on
...
# Modify the RewriteBase if you are using Drupal in a subdirectory or in a
# VirtualDocumentRoot and the rewrite rules are not working properly.
# For example if your site is at http://example.com/drupal uncomment and
# modify the following line:
# RewriteBase /drupal
RewriteBase /xxx/drupal
...
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
5) Make a copy of the /Users/xxx/Sites/drupal/sites/default directory tree as /Users/xxx/Sites/drupal/sites/localhost. Make sure this directory is writable by the
_www
group.6) Manually create the database in MySQL. Make a copy of
/Users/xxx/Sites/drupal/sites/localhost/default.settings.php file as /Users/xxx/Sites/drupal/sites/settings.php and make this file writable by the
_www
group. Configure the database in /Users/xxx/Sites/drupal/sites/settings.php/**
* Database settings:
*
...
*/
#$db_url = 'mysql://username:password@localhost/databasename';
7) Rebuild PHP5 to include the GD tools according to the instructions here.
8) Point a browser manually at http://localhost/xxx/drupal/install.php. The pages came up as shown on the Run the install script.
"files" has to be created first
sites/default/files directory has to be created PRIOR to running the install script. The install script checks for it and gives you an error if "files" is not there.
http://drupal.org/node/394704
Apache2 on Windows problem: Forbidden You don't have permission.
If you installed on windows and are virtually serving you drupal install, you might get this error
Forbidden You don't have permission.
If You get this error,
Edit Apache httpd.conf
Find the following Entry
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
Update it and add index.php as a valid Directory index
i.e. It should look something like this now:
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
Save and restart Apache.