Skip to main content

Php framework Use drupal 🧢

·497 words·3 mins· loading · loading · · ·
SIRPS
Author
SIRPS
SystemSoftdev. Interested in Electronic Devices and Computers
Table of Contents

Why drupal ??
#

I discovered a framework called drupal a few months ago. Currently, I’m using wordpress and gnuboard, which has easy setup. I compared gnuboard and drupal and wordpress.

Features Gnuboard Drupal WordPress
Development language PHP PHP PHP
Purpose Community and bulletin board-focused construction of various websites (blogs, portals, etc.) Wide range of uses from blogs, small websites to large websites
Extensibility Extensibility through plugins and skins Provides high extensibility with a powerful module system Highly expandable with extensive plugin library
Security Provides basic security functions, user-dependent high security, and regular updates Provides basic security features, can be strengthened with plugins
User-friendliness Intuitive admin page Slightly difficult learning curve for beginners User-friendly interface, easy to use even for beginners
Customization Limited, requires core modifications Highly customizable High customizability through themes and plugins
Community Support Active Domestic Community Global Community and Support Active Domestic Community and Global Community and Support
SEO Optimization Supports basic SEO optimization Provides advanced SEO optimization features Powerful SEO features, further optimization possible with plugins
License LGP LGPL GPL
Market Share No Data 2.1% 64.3%
Multilingual Support Limited Supports over 100 languages Multilingual support plugin available
Api Support Limited Strong API Support Built-in powerful REST API

How to use drupal ??
#

install php , composer , nginx
#

10
11
12
13
14
15
16
17
j@jnix:~/D/drupal
» composer -V
Composer version 2.8.1 2024-10-04 11:31:01
PHP version 8.2.25 (/nix/store/wz7b567a9mbqfm6rbxxnv6f8hdbqy8b4-php-with-extensions-8.2.25/bin/php)
Run the "diagnose" command to get more detailed diagnostics output.
j@jnix:~/D/drupal
» mysql -V
mysql  Ver 15.1 Distrib 10.11.10-MariaDB, for Linux (x86_64) using readline 5.1

composer create-project drupal/recommended-project drupal(site_name)

j@jnix:~/D/drupal
» ll
-rw-r--r--      357 B  j  users Nov 21 22:29:11 2024   .editorconfig
-rw-r--r--    4222 KB  j  users Nov 21 22:29:11 2024   .gitattributes
-rw-r--r--    3477 KB  j  users Nov 12 18:49:41 2024   composer.json
-rw-r--r--  170940 KB  j  users Nov 12 18:49:41 2024 󰈡  composer.lock
drwxr-xr-x    4096 KB  j  users Nov 21 22:29:11 2024   vendor
drwxr-xr-x    4096 KB  j  users Nov 21 22:29:11 2024   web

cd drupal
composer install

mysql settings
#

MariaDB [(none)]> create database drupal_db;
Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> create user 'drupaluser'@'localhost' identified by 'm';
Query OK, 0 rows affected (0.016 sec)

MariaDB [(none)]> grant all privileges on drupal_db.* to 'drupaluser'@'localhost';
Query OK, 0 rows affected (0.003 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| drupal_db          |
| information_schema |
| mysql              |
| performance_schema |
| sys                |
| test               |
+--------------------+

sudo apt install php nginx mysql sqlite3 sudo apt install php-gd php-xml php-fpm php8.3-sqlite3

composer create-project drupal/recommended-project drupal
cd drupal
php -d memory_limit=256M web/core/scripts/drupal quick-start demo_umami


	root /var/www/drupal/web;

	# Add index.php to the list if you are using PHP
	index index.php index.html index.htm index.nginx-debian.html;

	location ~ \.php$ {
		include snippets/fastcgi-php.conf;

		# With php-fpm (or other unix sockets):
		fastcgi_pass unix:/run/php/php8.3-fpm.sock;
		# With php-cgi (or other tcp sockets):
		#	fastcgi_pass 127.0.0.1:9000;
	        fastcgi_param SCRIPT_FILENAME
		$document_root$fastcgi_script_name;
        	include fastcgi_params;
	}