Terminal
#Connect to a Linux virtual machine first, if you don't remember this, look at the previous one
$ ssh -i ~/.ssh/FirstKey.pem ec2-user@(Public IP)
#Change to administrator privileges
$$ sudo su
#Install PHP
$$ yum install -y php
#Make a backup before changing PHP settings
$$ cp /etc/php.ini /etc/php.bak
#Change PHP settings with vi
$$ vi /etc/php.ini
--Display line numbers with : set number
--Move to line 520 with : 520
--Set to description mode with ʻi and change the line ʻerror_reporting = E_ALL & ~ E_DEPRECATED
to ʻerror_reporting = E_ALL & ~ E_DEPRECATED & ~ E_NOTICE --Return to command mode with ʻesc
--Go to line 537 with : 537
--Changed display_errors = Off
from ʻi to ʻOn
, ʻesc --End saving with
: wq`
Terminal
#Restart Apache and apply
$$ service httpd restart
# [OK]*2 If it comes out, maybe it's okay
--Assuming that you are logged in with administrator privileges as you did last time
Terminal
#MySQL installation
$$ yum install -y mysql-server
#Put something that makes MySQL work nicely with PHP
$$ yum install -y php-mysqlnd
#It feels good in Python
$$ yum install mysql-connector-python
#Start MySQL
$$ service mysqld start
#This and that of MySQL settings
$$ mysql_secure_installation
#Enter as it is when you are asked for the first root password
#You will be asked if you want to change the root password, so yes
#Enter your favorite password
#Anonymous user will ask if you want to delete it, so yes
#After that, all y is fine
#Set the character code in MySQL
$$ vi /etc/my.cnf
# `:set number`Display the number of lines with and the 10th blank line
$$ character-set-server = utf8
#Enter, but repeat`i`After inputting with`esc`In command mode
# `:wq`End of saving with
#Restart MySQL
$$ service mysqld restart
#[OK]If it comes out`OK`
--Continued from the previous time, it is assumed that you are in the administrator authority of the virtual environment
Terminal
#Create installation destination for phpMyAdmin
$$ yum-config-manager --enable epel
#Install phpMyAdmin
$$ yum install -y phpmyadmin
#Open phpMyAdmin settings
$$ vi /etc/httpd/conf.d/phpMyAdmin.conf
#Here 127.0.0.If you change the place where 1 is written to global IP, only your local machine can change the connection.
#I don't have to do it
#If you want to change`:%s/127.0.0.1/My global IP/g`Change with
#Restart apache
$$ service httpd restart
--http: // When you connect to the AWS public IP / phpmyadmin /
set earlier, the phpMyAdmin
page will appear.
--Enter the user name root
and the password set in the MySQL installation
--Continued from before In virtual environment (not administrator privileges)
Terminal
#One Linux environment update
$$ sudo yum -y update
#Python installation
$$ sudo yum install python36-devel python36-libs python36-setuptools
#I already have the one that makes MySQL look good in Python
#Restart apache
$$ service httpd restart
――The worst environment construction is the most boring
Recommended Posts