Configuring Apache 2.2.x with PHP 5.x

Apache side

If you are using PHP version earlier than 5.2.0, you need to obtain a proper PHP Apache Handler for Apache 2.2.x, because the file "php5apache2.dll" is for Apache 2.0.x. PHP 5.2.0 provides php5apache2_2.dll and php5apache2_2_filter.dll to support Apache 2.2.x.

Add following lines in conf/httpd.conf, replace PHP_HOME with your directory.

    LoadModule php5_module "PHP_HOME/php5apache2_2.dll"
    AddType application/x-httpd-php .php
    PHPIniDir "PHP_HOME"

PHP side

  • Edit the following variables in php.ini: doc_root, extension_dir (full path)
  • Uncomment or add the following lines to use MySQL
        extension=php_mysql.dll
        extension=php_mysqli.dll
  • Copy libmysql.dll to APACHE_HOME/bin
1