Configuring Virtual Hosts in XAMPP on Mac OS X

Configuring virtual hosts in xampp on mac is not an easy task.  It has some extra work to do as compared to windows or linux. Here is all the steps to configure it on mac.

STEP 1: open terminal and type

            vim /etc/hosts

It will open hosts file in vim editor (of course you can choose nano or others). press  i  and it will be in insert mode. Then add your host entry such as         localhost

STEP 2:   Now you need to open


(xampp installation path) either in vim or in normal editor via finder (file system in mac). Now you have to find this line

# Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf

and need to remove # from starting i.e. uncomment it. save and close this file.

STEP 3: Now you need to open file

and need to add set up your directory and host relation but before that make sure this line

NameVirtualHost *:80

is added before you add your settings. Like this-

NameVirtualHost *:80
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
<VirtualHost *:80>
    DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs"
    ServerName  localhost
    ErrorLog "logs/localhost-error_log"
    CustomLog "logs/localhost-access_log" common

<VirtualHost *:80>
    DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/ci34"
    ErrorLog "logs/"
    CustomLog "logs/" common

STEP 4: You are almost done just need to restart apache from xampp panel. That's it. Your site is now ready to be used as (whatever you added in hosts & httpd-vhosts.conf file).

Responsive File Manager Authentication

In config/config.php file write below code on top of everything-

if (session_id() == '') session_start(); error_reporting(0);
    header('Location: dialog.php');

          $db = 'yourdbname';
            $uname = 'username';
            $pass = 'yourpass';

        $db = new PDO("mysql:host=localhost;dbname=".$db, $uname,$pass);
        $stmt = $db->prepare("SELECT password FROM users WHERE email=?");// AND password=?
        $stmt->bindValue(1, $_POST['username'], PDO::PARAM_STR);
        // $stmt->bindValue(2, password_hash($_POST['password'],CRYPT_BLOWFISH ), PDO::PARAM_STR);
        $rows = $stmt->fetch(PDO::FETCH_ASSOC);
        if (version_compare(PHP_VERSION, '5.5.9') >= 0) {
         //include this library
            require_once 'passwordLib.php';   
        //echo '<pre>';print_r($rows);exit;
        if( password_verify($_POST['password'],$rows['password']) ){
            $_SESSION['authorized'] = true;
            header('Location: dialog.php');
<form action='' method='post' autocomplete='off'>
<p>Email: <input type="text" name="username" value=""></p>
<p>Password: <input type="password" name="password" value=""></p>
<p><input type="submit" name="submit" value="Login"></p>   
<?php exit;}?>

and enclose all of rfm code in else part.