PHP Installation on Windows
- Download Apache and PHP Software
- Run the Apache installer and install it in
c:\eng\soft\apache\apache-2.2
- Run the PHP installer and install it in
- Select Apache 2.2.x Module when prompted
- For Apache Configuration Directory, use
c:\eng\soft\apache\apache-2.2\conf\
- Re-start Apache in Windows Service: Control Panel -> View by: Small Icons -> Administrative Tools -> Services -> Apache2.2
- Add a testing PHP file in c:/eng/soft/apache/apache-2.2/htdocs/hello.php
<html>
<head>
<title>hello</title>
</head>
<body>
<?php echo 'Hello!' ?>
</body>
</html>
- Test the PHP installation with a browser
http://127.0.0.1/hello.php
If the browser displays the PHP code instead:
- Apache is not configured with PHP module correctly. (Redo the PHP installation)
- The PHP code is not embedded with <?php ?>
View & Troubleshoot PHP configuration
To view the system and php configuration as well as PHP pre-defined variables, hit a PHP page with
Configure PHP with Xdebug for PHP Debugging in Windows
- Download PHP 5.3 VC6 (32 bit) Windows Binaries from xdebug.org
- Copy Xdebug 2.1.2 to
c:/eng/soft/php/php-5.3/ext
Add to the end of php.ini (Replace my_host_name with your local host name)
zend_extension=c:/eng/soft/php/php-5.3/ext/php_xdebug-2.1.2-5.3-vc6-nts.dll
xdebug.remote_enable=true
xdebug.remote_host=my_host_name
Test Xdebug installation
Use php -m to verify Xdebug is installed
cmd> php -m
...
[Zend Modules]
Xdebug
PHP IDE Tool: Eclipse PHP Installation
- Download All-In-One Windows Eclipse PDT from http://www.eclipse.org/pdt/downloads/
- Create a directory
- Extract the eclipse directory in the zip file to the newly created directory
- The directory should look like
C:\eng\soft\eclipse\eclipse
- Rename it to
C:\eng\soft\eclipse\pdt-3.0
- Run
C:\eng\soft\eclipse\pdt-3.0\eclipse.exe
Install Eclipse Plugin
Create A Eclipse PHP Project
- Click on workbench
- In Eclipse, File -> New -> PHP Project
- Enter
- Project name: MyApp
- Create project from existing source: "C:\eng\dev\apps\myapp\www"
Configure Eclipse's PHP setting
- In Eclipse, Windows -> Preferences
- PHP -> PHP Servers
- New
- name: MyApp Server
- URL: http://your_host_name
- Select Path Mapping
- Path on server: C:\eng\dev\apps\myapp\www
- Path in workspace: /myapp
- Set the newly created server as default
- PHP -> PHP Executables
- Add ...
- Name: XDebug Configuration
- Executable Path: C:\eng\soft\php\php-5.3\php.exe
- PHP debugger: XDebug
- PHP -> Debug
- PHP Debugger: XDebug
- Server: MyApp Server
- PHP Executable: XDebug Configuration
Make sure no other application is using port 9000 and 10000 in the localhost
Testing PHP Eclipse Installation
- Make sure Apache/PHP is running
- Right Click in index.php -> Debug As -> PHP Web Page
- Enter http://your_host/index.php
Install Memcached (Optional)
- Download Windows memcached binary v1.4.4 (Windows 32-bit zip file) from
http://labs.northscale.com/memcached-packages/
- Unzip it to
c:\eng\soft\memcached\memcached-win32-1.4.4-14
- In Windows, Start Menu -> Right Click on Command Prompt -> Run as Administrator
- Install as service
cmd> cd c:\eng\soft\memcached\memcached-win32-1.4.4-14
cmd> memcached.exe -d install
- Go to the control panel -> service and start the newly created service "memcached"
Install Memcached Client
- Download php_memcache-cvs-20090703-5.3-VC6-x86.zip from
http://downloads.php.net/pierre/
- Extract the DLL file inside the zip file to
c:\eng\soft\php\php-5.3\ext
- Add behind PHP_EXIF DLL configuration
[PHP_MEMCACHE]
extension=php_memcache.dll
|