36 articles and counting
      

Problems Running PHP with Apache

Upgraded PHP today and had all sorts of issues getting it to work with Apche again.

The main one being “Cannot load C:/php/php5apache2.dll into server

  1. download PHP 5.x from PHP.net you want this file: php-5.x.xx-Win32.zip (where x relates to the latest stable version number)
  2. Extract the contents of this file and move the contents to where you intend to use PHP such as C:\phpNavigate to the PHP folder and edit the php.ini-recommended. FIND the extension_dir directive and change so that it properly locates the EXT folder:

    extension_dir = “C:\php\ext”

    NOTE the backslashes
    Save the file as php.ini 

  3. Edit the PATH ENVIRONMENT (System Properties | Advanced | Environment Variables | System variables | Path or hold the Win key and press Pause key) to add the path to the php install folder:

    Example:

    Variable value: C:\php5;%SystemRoot%\system32;…..

  4. Finally, this should be the last step, edit the Apache CONF file (httpd.conf) with:LoadModule php5_module “c:/php/php5apache2_2.dll”
    AddHandler application/x-httpd-php .php
    # configure the path to php.ini
    PHPIniDir “c:/php

    NOTE the forward slashes
    NOTE we are referencing php5apache2_2.dll:

  5.