Interview Questions


What is the difference between $var and $$var?


$$var sets the value of $var as a variable.

            $$day='first day of week';
            echo $monday; //outputs 'first day of week'


What is .htaccess in PHP?

.htaccess is a configuration file for use on web servers running the Apache Web Server software. When a .htaccess file is placed in a directory which is in turn ‘loaded via the Apache Web Server’, then the .htaccess file is detected and executed by the Apache Web Server software.

What is Nginx and what is it used for?

NGINX (Pronounced as Engine-X) is an open source, lightweight, high-performance web server or proxy server. Nginx used as reverse proxy server for HTTP, HTTPS, SMTP, IMAP, POP3 protocols, on the other hand, it is also used for servers load balancing and HTTP Cache

Set the PHP default timezone :
echo date('d-m-Y H:i:s'); //Returns IST 

Default Mysql Port No, Host and Protocol :

mysql –port = 3306 –host=
mysql --port = 3306 --protocol=TCP

Index in SQL :


   Indexes allow the database application to find data fast; 
   without reading the whole table.


An index can be created in a table to find data more quickly and efficiently.

The users cannot see the indexes, they are just used to speed up searches/queries.

Note: Updating a table with indexes takes more time than updating a table without

(because the indexes also need an update). So you should only create indexes on columns (and tables)

that will be frequently searched against.


Creates an index on a table. Duplicate values are allowed:

CREATE INDEX index_name
ON table_name (column_name)

 Virtual Hosting :


   Ex :1 Virtual hosting is a method for hosting multiple domain names 
       (with separate handling of each name) on a single server (or pool of servers).
       This allows one server to share its resources, such as memory and processor cycles, 
       without requiring all services provided to use the same host name.

   Ex : 2 The term Virtual Host refers to the practice of running more than one web site 
          (such as and on a single machine. Virtual hosts can be "IP-based", meaning that you have a different IP address for every web site, or "name-based", meaning that you have multiple names running 
          on each IP address. The fact that they are running on the same physical server is 
          not apparent to the end user.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s