Done the correct installation of XAMPP in our distribution, now we will take the opportunity to install WordPress on our computers to be able to carry out our pertinent tests, whether for the creation or modification of themes or plugins for this CMS.
With WordPress we have the possibility of being able to create almost any type of web page thanks to its flexibility and the large number of plugins that exist for it.
Installing WordPress on Linux
The first step is to download WordPress from its official website, for this we just have to go to the following link.
Made the download of the latest version of Wodpress available, lIt is recommended to place the downloaded file in the XAMPP folder before unzipping it.
mv latest.zip /opt/lampp/htdocs/
Unzip the file:
Si You want wordpress to be the main one on localhost, we just have to move all the files as follows.
We position ourselves inside the unzipped folder:
And we move all the files to the main XAMPP path:
mv wordpress/* …/
Getting started with installing WordPress on Linux
At this point we must verify that all XAMPP processes run without problems, must be running, php, apache and mariadb.
We can perform the installation graphically from the browser, we just have to go to localhost.
The WordPress installation and configuration wizard will appear, as a first step it will ask us to create a database.
Or we can carry out the process from the terminal. For it on the terminal we execute:
mysql -u root -p CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; GRANT ALL ON wordpress.* TO 'wordpressuser'@'localhost' IDENTIFIED BY 'password'; FLUSH PRIVILEGES; EXIT;
Where the database is wordpress and the user is wodpressuser and the password is password.
Now we may or may not perform the installation of the private keys that WordPress offers us to have a more secure installation, this depends on each one. To do this we type:
curl -s https://api.wordpress.org/secret-key/1.1/salt/
It will give us some values which we will copy as is in a separate notes blog.
We rename the following file found inside the WordPress folder:
cp wp-config-sample.php wp-config.php
Done this We must edit the following file and place the information of the DB:
sudo nano wp-config.php
Find the following lines and replace the corresponding ones, it should be as follows:
define('DB_NAME', 'wordpress'); /** MySQL database username */ define('DB_USER', 'wordpressuser'); /** MySQL database password */ define('DB_PASSWORD', 'password'); . . . define('FS_METHOD', 'direct');
They should also look for the section of:
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');
Where They will place the previously obtained private keys.
Save and close the file.
Now we just have to go to our browser and write and go to localhost, we will be asked to finish the installation process. It will ask us to select a language, as well as assign a username and password which will help us to enter the WordPress dashboard.
The username and password will be created as administrator, and if they want to use some other type of user they create in the options offered by WordPress.
Sometimes it asks for the data of the database configuration, you can put it back. This happens due to cache issues, you can clean it and reload your browser to avoid this.
With this, you have WordPress installed on your system so that you can perform your tests.
The installation is quite simple, I did not want to go deeper since the configurations of this CMS are many and also depend on the user.
You can play around with the PHP.ini values to adjust them to your WordPress usage needs as well as add settings to the .htaccess file found inside the main WordPress folder.
As I comment, this already depends on your needs and there is too much information on the network about these, you can rely on the WordPress codex to know more about it.