Heim  >  Fragen und Antworten  >  Hauptteil

Wie kann ich die Ausführung dieses Befehls „sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2“ vermeiden?

Ich folge diesem Tutorial: https://aws.amazon.com/getting-started/hands-on/deploy-wordpress-with-amazon-rds/?refid=dd707452-50b0-4e41-9f2b-d84c7ca273d4 Ich probiere es aus in AWS meinen eigenen WordPress-Server auf ec2/rds erstellen.

Allerdings möchte ich diese Zeile nicht ausführen

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

Weil WordPress PHP7.2 nicht mag. Dies ist mein zweites Mal und das erste, was mir auffällt, ist, dass ich PHP aktualisieren muss, was nach der Installation unmöglich erscheint. Ich kann auch keine Möglichkeit finden, dieses Paket nach der Installation zu entfernen. Ich kann jedoch keine "neuere" Möglichkeit finden, dies zu tun. Am Ende musste ich alles wegwerfen und von vorne beginnen.

Wie bringe ich httpd dazu, WordPress ohne dies auszuführen?

EDIT: Das angezeigte Paket zeigt nach der Installation, dass es den Support-Lebenszyklus erreicht hat.

P粉938936304P粉938936304285 Tage vor444

Antworte allen(1)Ich werde antworten

  • P粉662089521

    P粉6620895212023-12-14 13:55:26

    在亚马逊AWS ec2上启动wordpress:

    1. 启动实例(ubuntu),生成密钥对
    2. 打开 ssh 终端并运行以下命令
    //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. 假设您的域名是 sarojsshrestha.com 接下来,您需要运行以下命令将域映射到 /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. 接下来,启用此功能。
    sudo a2ensite sarojshrestha.com

    现在,在浏览器上点击 sarojshrestha.com,您应该会看到 Wordpress 设置视图。将 sarojsrestha.com 替换为您的实际域名。

    顺便说一下,安装时,您可能需要更改 /var/www/html 文件夹的权限。如果您发现任何问题,可以告诉我。

    Antwort
    0
  • StornierenAntwort