apt-get install php wordpress extensions
Open a terminal window.
Update the package list to ensure you have the latest information about available packages.
bash
sudo apt-get update
- Install the Apache web server to host the WordPress site.
bash
sudo apt-get install apache2
- Install the MySQL database server to store WordPress data.
bash
sudo apt-get install mysql-server
- Secure the MySQL installation by running the following command and following the prompts.
bash
sudo mysql_secure_installation
- Install PHP, a server-side scripting language used by WordPress.
bash
sudo apt-get install php libapache2-mod-php php-mysql
- Install additional PHP extensions required by WordPress.
bash
sudo apt-get install php-curl php-gd php-mbstring php-xml php-xmlrpc php-soap php-intl php-zip
- Restart the Apache web server to apply the changes.
bash
sudo systemctl restart apache2
- Download and extract the latest WordPress package from the official website.
bash
wget https://wordpress.org/latest.tar.gz
tar -zxvf latest.tar.gz
Create a MySQL database and user for WordPress.
bash sudo mysql -u root -p
sql CREATE DATABASE wordpress; CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost'; FLUSH PRIVILEGES; EXIT;
Move the extracted WordPress files to the Apache web server's root directory.
bash sudo cp -r wordpress/* /var/www/html/
Set the correct permissions for the WordPress files.
bash sudo chown -R www-data:www-data /var/www/html/
Configure WordPress by copying the sample configuration file.
bash sudo cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php
Open the WordPress configuration file in a text editor and update the database connection details.
bash sudo nano /var/www/html/wp-config.php
Access your WordPress site through a web browser and complete the installation process by providing necessary information.