Your step by step guide for installing Drupal 11 with PHP 8.3:
Prerequisites
- PHP 8.3: Ensure PHP 8.3 is installed and configured.
- Composer: Ensure Composer is installed.
- Database: Latest version of MySQL, MariaDB, PostgreSQL, or SQLite.
- Web Server: Apache, Nginx, or another compatible web server.
Step 1: Install PHP 8.3
If PHP 8.3 is not installed, you can install it depending on your OS:
On Ubuntu/Debian:
- Add the PHP repository:
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
- Install PHP 8.3:
sudo apt-get install php8.3 php8.3-cli php8.3-fpm php8.3-mysql php8.3-xml php8.3-gd php8.3-mbstring php8.3-curl php8.3-zip php8.3-soap php8.3-intl php8.3-bcmath
On CentOS/RHEL:
- Enable the EPEL and REMI repositories:
sudo dnf install epel-release
sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
- Install PHP 8.3:
sudo dnf module reset php
sudo dnf module install php:remi-8.3
sudo dnf install php php-cli php-fpm php-mysqlnd php-xml php-gd php-mbstring php-curl php-zip php-soap php-intl php-bcmath
Verify the installation:
php -v
Step 2: Create a Project Directory
- Open your terminal.
- Navigate to the directory where you want to install Drupal:
cd /path/to/your/webroot
- Create a new directory for your Drupal project:
mkdir drupal11-project
cd drupal11-project
Step 3: Install Drupal 11 with Composer
- Run the following Composer command to create a new Drupal 11 project:
composer create-project drupal/recommended-project .
This command will:
- Create a new Drupal project in the current directory.
- Download Drupal core and all required dependencies.
- Set up a
web
directory where Drupal's web-accessible files will be stored.
Step 4: Set Up the Web Server
-
Apache: Create a virtual host for your Drupal site, pointing the document root to the
web
directory:
<VirtualHost *:80>
ServerName yoursite.local
DocumentRoot /path/to/your/drupal11-project/web
<Directory /path/to/your/drupal11-project/web>
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Then, enable the site and restart Apache:
sudo a2ensite yoursite.local.conf
sudo systemctl restart apache2
-
Nginx: Configure your server block to point to the
web
directory:
server {
listen 80;
server_name yoursite.local;
root /path/to/your/drupal11-project/web;
index index.php index.html index.htm;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Then, restart Nginx:
sudo systemctl restart nginx
Step 5: Set Up the Database
- Create a new database for Drupal. For MySQL or MariaDB:
CREATE DATABASE drupal11;
CREATE USER 'drupaluser'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON drupal11.* TO 'drupaluser'@'localhost';
FLUSH PRIVILEGES;
Step 6: Run the Drupal Installation
- Open your web browser and navigate to
http://yoursite.local
. - Follow the installation wizard:
- Select the installation language.
- Choose an installation profile (Standard is recommended for most users).
- Configure the database settings with the details you created in Step 5.
- Complete the installation by entering your site details and admin account information.
Step 7: Finalize Configuration
- Set the appropriate file permissions:
chmod -R 755 /path/to/your/drupal11-project
chmod -R 644 /path/to/your/drupal11-project/web/sites/default/files
- (Optional) Enable clean URLs by adding the following to your
.htaccess
file if using Apache:
RewriteEngine on
RewriteBase /
Step 8: Secure Your Installation
- Remove the
install.php
file after installation. - Regularly update your Drupal installation and modules.
Your Drupal 11 installation with PHP 8.3 is now complete and ready to use!
Install Drupal 11 on Windows 10
To install drupal 11 with composer on your operating system, simply watch this video for practical step by step guide.
Top comments (0)