READ THE INSTALLATION STEPS: https://www.drupal.org/docs/getting-started/installing-drupal
USE PHP VERSION > 8.1.0 FOR THE TERMINAL AND THE APACHE
|
1 |
satria@teddy:~/Documents/projects/drupal-10$ sudo update-alternatives --config php |
USE PHP8.2
|
1 2 3 4 5 6 |
satria@teddy:~/Documents/projects/drupal-10$ php -v PHP 8.2.14 (cli) (built: Dec 21 2023 20:19:23) (NTS) Copyright (c) The PHP Group Zend Engine v4.2.14, Copyright (c) Zend Technologies with Zend OPcache v8.2.14, Copyright (c), by Zend Technologies with Xdebug v3.3.0, Copyright (c) 2002-2023, by Derick Rethans |
ALSO
|
1 2 3 4 5 6 7 |
satria@teddy:~/Documents/projects/drupal-10$ sudo a2dismod php7.4 satria@teddy:~/Documents/projects/drupal-10$ sudo systemctl restart apache2 satria@teddy:~/Documents/projects/drupal-10$ sudo a2enmod php8.2 satria@teddy:~/Documents/projects/drupal-10$ sudo systemctl restart apache2 |
CHECK THE CURRENT PHP VERSION ON http://localhost/phpinfo.php. IT SHOULD SHOW PHP 8.2.4
INSTALL VIA COMPOSER
|
1 2 3 4 5 6 7 8 9 |
satria@teddy:~/Documents/projects$ composer create-project drupal/recommended-project drupal-10 PHP Warning: Module 'imagick' already loaded in Unknown on line 0 Xdebug: [Step Debug] Could not connect to debugging client. Tried: localhost:9003 (fallback through xdebug.client_host/xdebug.client_port) :-( PHP Warning: Module 'imagick' already loaded in Unknown on line 0 Creating a "drupal/recommended-project" project at "./drupal-10" Installing drupal/recommended-project (10.2.3) - Downloading drupal/recommended-project (10.2.3) - Installing drupal/recommended-project (10.2.3): Extracting archive ... |
CREATE LOCAL SETUP
CREATE A CONF
|
1 |
sudo gedit /etc/apache2/sites-available/drupal-10.test.conf |
CONTENT
|
1 2 3 4 5 6 7 8 9 10 11 12 |
<VirtualHost drupal-10.test:80> ServerName www.drupal-10.test DocumentRoot "/home/satria/Documents/projects/drupal-10/web" DirectoryIndex index.php <Directory "/home/satria/Documents/projects/drupal-10/web"> AllowOverride All Allow from All Require all granted </Directory> ErrorLog /var/log/apache2/drupal-10.error.log CustomLog /var/log/apache2/drupal-10.access.log combined </VirtualHost> |
ENABLE THE VIRTUALHOST
|
1 |
sudo a2ensite drupal-10.test.conf |
RELOAD APACHE2
|
1 |
sudo systemctl reload apache2 |
CREATE THE HOST
|
1 2 3 |
sudo gedit /etc/hosts 127.0.0.1 drupal-10.test |
RELOAD APACHE2
BUT DO THESE FIRST
1. CREATE A NEW DIRECTORY ‘sites/default/files’
THEN SET THE PERMISSION
|
1 |
satria@teddy:~/Documents/projects/drupal-10$ sudo chmod -R 777 web/sites/default/files/ |
2. COPY /web/sites/default/default.settings.php TO /web/sites/default/settings.php THEN ADD
|
1 2 3 4 5 6 7 8 9 10 11 |
$databases = []; $databases['default']['default'] = [ 'database' => 'drupal10', 'username' => 'root', 'password' => 'teddy', 'host' => 'localhost', 'port' => '3306', 'driver' => 'mysql', 'prefix' => '', 'collation' => 'utf8mb4_general_ci', ]; |
THEN SET THE PERMISSION
|
1 |
satria@teddy:~/Documents/projects/drupal-10$ sudo chmod 777 web/sites/default/settings.php |
REMEMBER. AFTER THE INSTALL IS FINISHED, CHANGE IT BACK TO 775
|
1 |
satria@teddy:~/Documents/projects/drupal-10$ sudo chmod 775 web/sites/default/settings.php |
THEN CREATE A NEW DATABASE ‘drupal10’
OPEN: http://drupal-10.test/
THEN INSTALL THE DEMO ‘UMAMI FOOD MAGAZINE’
THE ADMIN user login
user: admin
pass: Teddy@123#890
INSTALL DRUSH
GO TO THE DRUPAL 10 ROOT
|
1 |
satria@teddy:~$ cd Documents/projects/drupal-10 |
THEN RUN COMPOSER
|
1 |
satria@teddy:~/Documents/projects/drupal-10$ composer require drush/drush |
TO CHECK THE DRUSH VERSION, CAN’T USE ‘drush –version’ BUT USE THIS
|
1 |
satria@teddy:~/Documents/projects/drupal-10$ ./vendor/bin/drush --version |
IFÂ YOU GOT THIS ERROR
|
1 |
[preflight] The alias references a Drupal site that does not contain its own copy of Drush. Please add Drush to this site to use it. |
SOMEHOW MODIFY composer.json AND REMOVE
|
1 2 3 4 5 6 7 8 |
... "extra": { ..., "installer-paths": { ..., "core": ["type:drupal-core"] <-- REMOVE!!! }, ... |
HERE IS THE DRUSH VERSION CHECK (IGNORE XDEBUG MESSAGE)
|
1 2 3 4 |
satria@teddy:~/Documents/projects/drupal-10$ ./vendor/bin/drush --version Xdebug: ... Drush Commandline Tool 12.4.3.0 Xdebug: ... |
CHECK DRUPAL STATUS (IGNORE XDEBUG MESSAGE)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
satria@teddy:~/Documents/projects/drupal-10$ ./vendor/bin/drush status Xdebug: ... Drupal version : 10.2.3 Site URI : http://default DB driver : mysql DB hostname : localhost DB port : 3306 DB username : root DB name : drupal10 Database : Connected Drupal bootstrap : Successful Default theme : umami Admin theme : claro PHP binary : /usr/bin/php8.2 PHP config : /etc/php/8.2/cli/php.ini PHP OS : Linux PHP version : 8.2.14 Drush script : /home/satria/Documents/projects/drupal-10/vendor/bin/drus h Drush version : 12.4.3.0 Drush temp : /tmp Drush configs : /home/satria/Documents/projects/drupal-10/vendor/drush/dr ush/drush.yml Install profile : demo_umami Drupal root : /home/satria/Documents/projects/drupal-10/web Site path : sites/default Files, Public : sites/default/files Files, Temp : /tmp Xdebug: ... |