10 Basic PHP Interview Questions (with Answers)

Find below few basic PHP interview question and answers.

1. What is PHP (Define PHP)?

PHP: (hyper text preprocessor) is used to create basic website with dynamic content, to full feature web application that is used to connect to back end database.

2. Is Php Server Side Or Client Side?

PHP is server side scripting language.

3. What is the difference between JavaScript and PHP?

Javascript runs on client side and PHP is used on sever side. In other words, Javascript runs on client browser whereas PHP runs on the server.

  • PHP can’t run on its own; we need to have a web server
  • PHP can’t be compiled
  • PHP can run along with HTML and embedded in HTML
  • PHP will return HTML to browser
  • PHP code will be our input and web pages are going to be our output
  • HTML is static and PHP is dynamic

4. Why Use PHP?

  • Cross platform which means PHP can run on windows, Linux and MAC.
  • Can be deployed: on any browser
  • It’s web development specific
  • It can be object oriented, especially version 5.

5. What Are Other CMS Used For Developing Websites?

  • WordPress
  • Drupal
  • Joomla
  • Mambo
  • Light CMS
  • ExpressionEngine
  • etc.

6. What are the things you need to run PHP? What are PHP installation requirements?

  • Webserver
  • PHP
  • Database
  • Text editor
  • Web browser

7. What are the configuration files in PHP?

  • Httpd.conf – it’s a configuration file for apache
  • Php.ini – this is the configuration file for PHP
  • My.ini – is configuration file for MySQL

8. How to install PHP on Windows?

For windows based installations, download WAMP. It’s a combination of apache, MySQL and PHP. Download and install. You will find a tab of WAMP on the taskbar; you can click on it and find many options to deal with.

9. Name few text editors for Windows?

Dreamweaver, Zend Studio, Komodo Edit, etc.

10. How to check if the web server is set up correctly?

Type in a browser: http://local host