Download and decompress the file of PHP. We can decompress for example in the “C: \ PHP4 \”. Once unpacked, we are going to that directory and edit the file php.ini-dist.
Inside this section we look for Roads and Directories. We found that the “extension_dir” have the courage. “/” This indicates the current directory of PHP and will be located where the PHP extensions.
In the next section we have the PHP extensions, which provide us with extra features to our interpretation of PHP (many of these extensions will not work correctly under Windows98).
We selected those that need it, we do this by removing the “;” at the top of the line. We must verify that the file referred to this in our directory of PHP ( “C: \ PHP4 \”).
In this file can configure many more options, including options for supporting different systems managers of databases, but for the moment not change anything, only if needed. Once we have amended the above, save the file with the following name “php.ini”.
Then we go to the directory where Apache was installed in the directory “/ config /” edit the file “httpd.conf” where we make the following configuration directives.
Come to the “ScriptAlias”. This section will list the aliases that the path where you will find the PHP interpreter. We must have the following line.
ScriptAlias / cgi-bin / “C: / Program Files / Apache Group / Apache / cgi-bin /”
The above line is a directory that has a default Apache to run scripts. Below this line we must introduce:
ScriptAlias / PHP4 / “C: \ PHP4 \”
AddType The section is the configuration file that tells the interpreter must process. Add:
AddType application / x-httpd-php. Php4
AddType application / x-httpd-php. Phtml
Under Action, which we list is the file serves as interpreter for PHP. Add:
Action application / x-httpd-php “/ PHP4/php.exe”
Once I keep this file and create a test page. Save the file as plain text. We opened a new file and write the code below:
echo “Hi, my first PHP page”;
After writing the code above what we save in the directory “/ htdocs /” directory of Apache with the name “info.php4.” Run back a Web browser and typing the following address: “http://127.0.0.1/info.php4.” The result is a screen with information about the PHP we use, in addition to information on the value of the variables that PHP handles. If we do not see that screen should check the steps above and check we have done everything correctly. However, we can find more information in the reference manual for PHP.