Page 17 - Open Soource Technologies 304.indd
P. 17
Unit 1: Introduction to PHP
Notes
1. [mail function]
2. For Win32 only.
3. SMTP = mail.myisp.com
4. smtp_port = 25
5. For Win32 only.
6. sendmail_from = my@emailaddress.com
Step 3: Add C:\php to the path environment variable
To ensure Windows can find PHP, you need to change the path environment variable. From the
Control Panel, choose System, (then “Advanced system settings” in Vista), select the “Advanced”
tab, and click the “Environment Variables” button.
Scroll down the System variables list and click on “Path” followed by the “Edit” button. Enter
“C:\php” to the end of the Variable value line (remember the semicolon).
Figure 1.5: Path Environment Variables
Now OK your way out. You might need to reboot at this stage.
Step 4: Configure PHP as an Apache module
Ensure Apache is not running (use “net stop Apache 2.23” from the command line) and open its
\conf\httpd.conf configuration files in an editor.
The following lines should be changed:
add index.php as a default file name:
1. DirectoryIndex index.php index.html
At the bottom of the file, add the following lines (change the PHP file locations if necessary):
l # PHP5 module
l LoadModule php5_module “c:/php/php5apache2_2.dll”
l AddType application/x-httpd-php .php
l PHPIniDir “C:/php”
LOVELY PROFESSIONAL UNIVERSITY 11