Configuring Apache:
() ?>
() ?>
127.0.0.1 localhost
127.0.0.1 testsite1
- Open the httpd.conf file. (/conf sub-directory)
- Use slashes / for paths.
- Change the DocumentRoot to point to the location of the root document folder. In the default httpd.conf file, point to "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs".
- Change the Directory path to match the one used in the previous step.
- Add to index.php to the DirectoryIndex.
- Append the following lines to the end of the httpd.conf file:
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"
AddType application/x-httpd-php .php
PHPIniDir "C:/php"
Configuring PHP:
- Rename php-ini-recommended.ini to php.ini.
- Uncomment the Windows include_path.
Note: In the PHP.ini file, semicolons are used to denote that something is commented out. To uncomment a line, simply remove the semicolon. - Update the doc_root to match the one that was set up in the httpd.conf file.
- Update the extension_dir to "C:\php\ext".
- Uncomment php_gd2.dll extension.
- Uncomment mysql.dll extension.
- Update the sessions.save_path to the Windows temporary files directory (i.e. C:\Temp).
- The PHP directory needs to be added to the Path Environment Variables.
- Restart Apache and test PHP on Apache.
() ?>
() ?>
Change localhost:
- Open the 'hosts' file with notepad. It can usually be found in c:/windows/system32/drivers/etc.
- Edit the end of the file to read:
127.0.0.1 testsite1
No comments:
Post a Comment