Install NgineX

start nginx

Configure NgineX PHP CGI section like here: https://devwl.pl/nginx-php-on-windows-10/

Install PHP-CGI

Navigate to PHP directory and run:

php-cgi.exe -b 127.0.0.1:9999

Install MariaDB

Run MariaDB

Change default port number 3036 to 3333 at MariaDBDir/data/my.ini

Use CLI to login to mariadb with custom port set to 3333

mysql -h localhost -P 3333 –skip-ssl -u root -p

Start mariadb from CLI
start mysql

Or start MariaDB navigating to DIR and double-click on mariadbd.exe file.

List all tasks with:

tasklist | grep db

Kill the task with gven PID (np.: 1916):

taskkill /pid 1916 /f

Run PHP PDO

<?php
// phpinfo();

$servername = "localhost:3333";
$username = "root";
$password = "root";

try {
  $conn = new PDO("mysql:host=$servername;dbname=demo", $username, $password);
  // set the PDO error mode to exception
  $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  echo "Connected successfully";
} catch(PDOException $e) {
  echo "Connection failed: " . $e->getMessage();
}

$query = $conn->prepare("SELECT * FROM personel");

$results = $query->execute();
var_dump($query->fetchAll());
0
Would love your thoughts, please comment.x
()
x