WordPress is one of the most famous tool to create web-page. I installed WordPress and I am continuing to configure because I am a newbie in WordPress and PHP. Looking at some sites, I followed them like step below.
Installation
sudo apt install curl git wget unzip zip
sudo apt install php php-fpm php-mbstring php-bcmath php-xml php-mysql php-common php-gd php-cli php-curl php-zip php-imagick php-ldap php-intl
sudo systemctl status php8.1-
sudo unzip latest.zip -d /var/www/html/
sudo chown -R www-data:www-data /var/www/html/wordpress/
sudo find /var/www/html/wordpress -type d -exec chmod 755 {} \;
sudo find /var/www/html/wordpress -type f -exec chmod 644 {} \;
sudo mariadb -u root
CREATE DATABASE db_wordpress;
CREATE USER 'user_wordpress'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON db_wordpress.* TO 'user_wordpress'@'localhost';
FLUSH PRIVILEGES;
quit
Configuration
cd /var/www/html/wordpress/
sudo cp wp-config-sample.php wp-config.php
sudo vi wp-config.php
------------------
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );
/** Database username */
define( 'DB_USER', 'username_here' );
/** Database password */
define( 'DB_PASSWORD', 'password_here' );
/** Database hostname */
define( 'DB_HOST', 'localhost' );
------------------
/** The name of the database for WordPress */
/** define( 'DB_NAME', 'database_name_here' ); */
define( 'DB_NAME', 'db_wordpress' );
/** Database username */
/** define( 'DB_USER', 'username_here' ); */
define( 'DB_USER', 'user_wordpress' );
/** Database password */
/** define( 'DB_PASSWORD', 'password_here' ); */
define( 'DB_PASSWORD', 'password' );
/** Database hostname */
define( 'DB_HOST', 'localhost:11010' );
------------------
add followings.
/** ## Save files direct method ## */
define( 'FS_METHOD', 'direct' );
/** ## Increase memory limit, 256MB is recommended ## */
define('WP_MEMORY_LIMIT', '256M');
get salt.
https://api.wordpress.org/secret-key/1.1/salt/
replace next with salt.
------------------
define( 'AUTH_KEY', 'put your unique phrase here' );
define( 'SECURE_AUTH_KEY', 'put your unique phrase here' );
define( 'LOGGED_IN_KEY', 'put your unique phrase here' );
define( 'NONCE_KEY', 'put your unique phrase here' );
define( 'AUTH_SALT', 'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT', 'put your unique phrase here' );
define( 'NONCE_SALT', 'put your unique phrase here' );
------------------
SALT
------------------
PHP configuration
$ sudo vi /etc/php/8.1/fpm/php.ini
------------------
upload_max_filesize = 2M
post_max_size = 8M
max_execution_time = 30
;max_input_vars = 1000
memory_limit = 128M
------------------
upload_max_filesize = 100MB
post_max_size = 100MB
max_execution_time = 300
max_input_vars = 5000
memory_limit = 256M
------------------
Restarting PHP
sudo systemctl restart php8.1-fpm
In web browser, connect url(IP/wp-admin/install.php)
ex) 129.146.135.224/wp-admin/install.php
Forgetting password for WordPress
In web browser, connect next url. Getting MD5 hash of string, replace MariaDB database db_wordpress, table wp_users, column ‘user_pass’ with MD5 hash.
https://www.miraclesalad.com/webtools/md5.php