Alright after installing apache web server, now we can install php and mysql database. By default lubuntu 17.10 has php version 7.1 and mysql 5.7 in the repo, so we are going to install that. In this article i'm going to show you how to install php and mysql on lubuntu 17.10 artful.
How to install PHP 7.1 on Lubuntu 17.10
- open command line/terminal on lubuntu
- run update command
sudo apt-get update
sudo apt-get install php7.1
sudo apt-get install libapache2-mod-php
sudo leafpad /var/www/html/info.php
<?php
phpinfo();
?>
How to install MySQL 5.7 on Lubuntu 17.10
- open command line/terminal on lubuntu
- run update command
sudo apt-get update
sudo apt-get install mysql-server mysql-client
sudo apt-get install php7.0-mysql
sudo leafpad /var/www/html/mysql-test.php
<?php
$mysqli = new mysqli("localhost", "root", "password", "mysql");
$result = $mysqli->query("SELECT 'Hello, dear MySQL user!' AS _message FROM DUAL");
$row = $result->fetch_assoc();
echo htmlentities($row['_message']);
?>
sudo service apache2 restart
This comment has been removed by a blog administrator.
ReplyDeleteplease don't spam on my blog
Delete