How To Make Php

Table of contents:

How To Make Php
How To Make Php

Video: How To Make Php

Video: How To Make Php
Video: Learn PHP in 15 minutes 2024, May
Anonim

Creating a PHP file is straightforward, while setting up an interpreter to run it is not an easy task. To run the file, you need to create a virtual server on your computer with the PHP module installed.

PHP code
PHP code

Necessary

Apache and PHP distributions

Instructions

Step 1

PHP is the most widely used server-side programming language. Scripts written on it are executed when accessing it directly on the server itself. This makes it difficult to run it on a home computer for debugging, because special virtual servers are used.

The most famous and affordable virtual server is Apache. Most users and programmers have it, it is used on many servers. Its installation is simple and various modules can be easily connected to it.

To install Apache, you first need to download it from the official site, and run the downloaded installer. When specifying the installation path, choose "C: /Apache2.2". The name of the server and domain should be specified at your discretion, you can leave the default "test". After installation, the Apache service starts. The server is ready to go. You can control the launch through the "Services" in Windows ("Control Panel" - "Administrative Tools" - "Services"). To check the server operation, the address localhost is typed in the browser address bar. If "It works" is displayed, then everything is installed correctly, and you can start linking the necessary modules.

Step 2

PHP is downloaded from the official site. The downloaded archive is unpacked into the required directory (preferably in "C: / php"). PHP is installed. Now it needs to be linked to Apache.

Step 3

To do this, the Apache configuration file is opened (the "conf" folder, the "httpd.conf" file in the "C: /Apache2.2" folder), and changes are made to the corresponding directive (the comment symbols are removed from the corresponding lines):

AddType application / x-httpd-php phtml php

LoadModule php5_module c: /php/php5apache2.dll

PHP installation is ready, just restart the server and start testing your own scripts.

Recommended: