- Drupal 7 First Look
- Mark Noble
- 389字
- 2021-04-13 16:46:23
Administrators who manage lots of sites or who prefer to work from the command line will be thrilled with the change to make Drupal installable from the command line. If you want to run the installation from the command line, you will need to use the following procedure:
- Download Drupal from Drupal.org and copy the files to your server.
- Create a PHP script to run the Drupal command line using the following procedure:
i. Create a file called
install.site.php
wheresite
is the name of your site. This file should be located in the same directory where yourinstall.php
file is located (the root directory for your site).ii. Open the
install.site.php
file in your favorite file editor.iii. Enter the following script:
<?php include_once 'install.php'; $settings = array( 'parameters' => array( 'profile' => 'default', 'locale' => 'en', ), 'forms' => array( 'install_settings_form' => array( 'driver' => 'mysql', 'database' => 'my_db_name', 'username' => 'my_db_username', 'password' => 'my_db_password', ), 'install_configure_form' => array( 'site_name' => 'My site', 'site_mail' => 'admin@example.com', 'account' => array( 'name' => 'admin', 'mail' => 'admin@example.com', 'pass' => array( 'pass1' => 'my_site_password', 'pass2' => 'my_site_password', ), ), 'update_status_module' => array(1 => TRUE), 'clean_url' => TRUE, ), ), ); install_drupal($settings); ?>
This code is used to configure the installation so Drupal knows what values to use during the installation process to properly configure your site as it is created.
iv. Modify the values in the above code snippet to match the needs of the site you want to install. You will need to pay special attention to the database information including the database name, username, and password. You should also modify the administrator's password, site name, and so on to match the desired values for your site.
v. Save the file with all of your changes.
- Run the
install.site.php
file from the command line using the syntax:php install.site.php
- After the installation completes, you can verify your site and begin configuring it as usual.
- After completing the installation, you should back up the install file and either remove it from your site completely or remove access to the file for all users since it contains the login information for User 1.
Although this setup is a little more complicated to run initially, it can be a big time saver if you are installing a large number of sites or want to run an unattended installation.
- 數碼攝影后期零基礎入門教程
- AJAX and PHP: Building Modern Web Applications 2nd Edition
- Photoshop后期強:數碼攝影后期完全寶典
- 剪映AI視頻剪輯:AI腳本+AI繪畫+圖文生成+數字人制作
- Swing Extreme Testing
- 鍵盤錄入技術(第2版)
- Adobe創意大學Illustrator產品專家認證標準教材(CS6修訂版)
- 畫筆圣經 Photoshop專業繪畫技法
- RESTful PHP Web Services
- Capture One 22 Pro高級實戰教程
- 新編AutoCAD制圖快捷命令速查一冊通
- 用Multisim玩轉電路仿真
- Autodesk Ecotect Analysis綠色建筑分析應用
- SharePoint Designer Tutorial: Working with SharePoint Websites
- 剪映:從零開始精通短視頻剪輯(電腦版)