apt-get install php wordpress extensions

  1. Open a terminal window.

  2. Update the package list to ensure you have the latest information about available packages.

bash sudo apt-get update

  1. Install the Apache web server to host the WordPress site.

bash sudo apt-get install apache2

  1. Install the MySQL database server to store WordPress data.

bash sudo apt-get install mysql-server

  1. Secure the MySQL installation by running the following command and following the prompts.

bash sudo mysql_secure_installation

  1. Install PHP, a server-side scripting language used by WordPress.

bash sudo apt-get install php libapache2-mod-php php-mysql

  1. 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

  1. Restart the Apache web server to apply the changes.

bash sudo systemctl restart apache2

  1. Download and extract the latest WordPress package from the official website.

bash wget https://wordpress.org/latest.tar.gz tar -zxvf latest.tar.gz

  1. 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;

  2. Move the extracted WordPress files to the Apache web server's root directory.

    bash sudo cp -r wordpress/* /var/www/html/

  3. Set the correct permissions for the WordPress files.

    bash sudo chown -R www-data:www-data /var/www/html/

  4. Configure WordPress by copying the sample configuration file.

    bash sudo cp /var/www/html/wp-config-sample.php /var/www/html/wp-config.php

  5. Open the WordPress configuration file in a text editor and update the database connection details.

    bash sudo nano /var/www/html/wp-config.php

  6. Access your WordPress site through a web browser and complete the installation process by providing necessary information.