Freitag, 21. August 2009

Schritt eins :-) Ein AMP-System aufsetzen. Hier unter Windows:


Software Versions:
Apache - 2.2.11
Mysql - 5.1.34-community
Php - PHP Version 5.2.9-2 (Win32)

Step 1: Default Apache Installation with these settings:
Network domain: localhost
Server Name: localhost
Admin Email: [your Email]
- Install for All Users
- Typical

Step 2: Default installation of mysql
Port: 3306 (default!)
Standard Character Set (Latin1)
Include Bin Directory in Windows Path

Step 3: Download php zip file (, extract it to your C: drive under c:\php

Step 4: Add these paths to your Windows PATH environment variable, "C:\php", "C:\php\ext",
incase your installation directory is php. Ifn not, replace it with your directory.
Use the System Path variable, as you installer Apache for all users!
Be shure not to use empty spaces in your directory names as some Webservers don't like it.

Step 5: Open httpd.conf, that is located in Apache web server installation folder,
under conf directory i.e., Apache Installation folder > conf > httpd.conf
Add these line at the en of the LoadModule section...
>LoadModule php5_module "c:/php/php5apache2_2.dll"
(Hint!: This module is for Apache Version 2.2)

You can ignore the Hint (alt least unter Windows ;-):
# Add to the end of the AddModule section (in httpd.conf)
AddModule mod_php5.c

Add these lines in the structure...
>AddType application/x-httpd-php .php .php3 .php4 .phtml
>AddType application/x-httpd-php-source .phps

And these line...
Be shure not to place them in some sub structure!
Be shure to use forward shlashes ("/"). Apache want it that way!
A trailing slash may also be necessary for directories.
PHPIniDir "C:/PHP/"

Another way to tell Apache where to find your PHP install directory is to set the
windows environment variable PHPRC (i user both ;-):

Step 6: Goto php installation directory, there u'll find a file named php-ini-recommended.
Rename it to, php.ini
Create an subdirectory C:\PHP\includes for your php include files.

Step 7: Now it's time to modify your php.ini file...
Open the file in notepad.
If you use MySQL, look for "extension=php_mysql.dll" and un comment it,
i.e., delete the ";" at the start of the line.
If you also use PDO (with MySQL), un comment thiese lines to:
And these line if you use mbstrings and sockest...
...and so on...
Also look for "extension_dir=", where you place your extension directory ("C:\php\ext" ).
That's the directory where the extensions are, that you just enadled above (php_pdo.dll e.g.)
Also look for "include_path =", where you place your include directory (".;C:\PHP\includes")
(Don't forget to un comment the line! i.e. remove the ";")

Step 8: Reboot the computer - logoff isn't enough!

Step 9: Create a file test.php containing this line and place it in the
Apache document root directory (that's where apache default is looking files to show.
(When using the default installation: C:\Programme\Apache Software Foundation\Apache2.2\htdocs)
Test ist by calling: http://localhost//test.php
Important is the hint at "Loaded Configuration File".
There You shold find the path (with file) to yout php.ini (e.g. "C:\PHP\php.ini ")

Step10: Some PHP based Software need PEAR. You install it with the Bath C:\PHP\go-pear.bat

done :-)

Keine Kommentare:

Kommentar veröffentlichen