How can I avoid running this command 'sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2'?
P粉938936304
P粉938936304 2023-12-13 19:01:43
0
1
439

I'm following this tutorial: https://aws.amazon.com/getting-started/hands-on/deploy-wordpress-with-amazon-rds/?refid=dd707452-50b0-4e41-9f2b-d84c7ca273d4 Try it Create my own wordpress server on AWS ec2/rds.

However, I don't want to run this line

sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2

Because WordPress doesn’t like php7.2. This is my second pass and the first thing I discovered is that I need to upgrade php, which seems impossible once installed. I also can't find any way to remove this package after installation. However, I can't find any "newer" way to do this. I ended up having to throw everything away and start over.

How do I get httpd to run wordpress without this?

EDIT: The package shown shows after installation that it has reached the support lifecycle.

P粉938936304
P粉938936304

reply all(1)
P粉662089521

Start wordpress on Amazon AWS ec2:

  1. Start the instance (ubuntu) and generate a key pair
  2. Open ssh terminal and run the following command
//just update and upgrade apt repositories
sudo apt update
sudo apt upgrade

//install apache2
sudo apt install apache2 -y
sudo systemctl start apache2

//install PHP
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get update

sudo apt-get install php -y

//i suppose above it installed php8.1 
//so installing all other related tophp8.1

sudo apt-get install php8.1-cli php8.1-common

//actually these extensions were used for laravel,
//so not all might needed for WordPress but you can install all of these

sudo apt-get install apache2 php8.1 libapache2-mod-php8.1 php8.1-curl php-pear php8.1-gd php8.1-dev php8.1-zip php8.1-mbstring php8.1-mysql php8.1-xml curl -y
sudo apt install -y php8.1-bcmath  php8.1-ctype
sudo apt-get install zip unzip php8.1-zip

sudo systemctl restart apache2

//enter ipaddress on browser, it should show localhost, if installed successfully

//install MySQL
sudo apt install mysql-server
sudo mysql 

//inside mysql tab
==============
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewPassword';
create database database_name;
exit;
=================

//install Wordpress 
//go to default HTML directory

cd /var/www/html

//now push file to on this directory from git, if you have it on local
// or install a new from repo
// you can consider /var/www/ as your htdocs folder in xampp

//now need to set up your DNS
// for this you can view some tutorial on `route 53` DNS hosting, you have to  allocate elastic IP address, and map your domain to this IP
  1. Assume your domain name is sarojsshrestha.com Next, you need to run the following command to map the domain to /var/www/html
cd /etc/apache2/sites-available

//disable default conf
sudo a2dissite 000-default.conf 

//create new conf for your domain
sudo nano sarojshrestha.com.conf

//and paste this following:


    ServerName sarojshrestha.com
    ServerAlias www.sarojshrestha.com
    ServerAdmin admin@sarojshrestha.com

    DocumentRoot /var/www/html
    
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted
    

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined



//save and exit by ctrl+s and ctrl+x
  1. Next, enable this feature.
sudo a2ensite sarojshrestha.com

Now, click on sarojshrestha.com on your browser and you should see the Wordpress settings view. Replace sarojsrestha.com with your actual domain name.

By the way, when installing, you may need to change the permissions of the /var/www/html folder. If you find any issues you can let me know.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!