Your best source of information and news about secrets, windows and windows on the internet

June 6th, 2007

You are currently browsing the articles from MS Windows Vista Compatible Software written on June 6th, 2007.

Install PHP under Apache and Vista

I initially tried the msi installer for PHP 5. Unfortunately, it installs only PHP under CGI, which although it has some performance and security issues, might be ok for a quick and dirty development environment.

But the installer is badly broken. You’ll get an error something like

PHP Fatal error:  require_once()[function.require]: Failed opening
required 'SAM/php_sam.php' (include_path='.;C:php5pear') in
sam_factory on line 1

After fighting this for a couple of hours, I ended up installing manually anyway. I used this procedure to get PHP 5 running under Vista:

  1. Install the Apache webserver.
  2. Get the current version of PHP 5 from http://www.php.net/downloads.php#v5. (It’s 5.2.3 at this time). Get both the zip file and the PECL zip file (which includes extensions).
  3. Uninstall any previous installations of PHP 5 (Start > Control Panel > Programs and Features). You may have to reboot your machine.
  4. Disconnect from the Internet. Turn off your firewall. Turn off your virus checker.
  5. Turn off User Account Control (UAC).
  6. Get an administrator prompt by going to All Programs > Accessories. Right-Click “Command Prompt” and choose “Run as Administrator”
  7. Use the command prompt to manually remove directories containing previous PHP installations (like C:\Program Files\PHP…)
  8. Go to the directory where you’ve downloaded the PHP5 and PECL zipfiles. Extract the PHP zipfile. Rename the extracted php directory (which has a name something like php-5.2.3-Win32) to c:\php. Extract the PECL zipfile into c:\php\ext.
  9. In the command prompt, type:
    cd c:\php
    mkdir upload
    mkdir session
    copy php.ini-recommended php.ini
  10. Open php.ini in Notepad:
    1. There are many variables… the following are important. Notice that starting a line with a semicolon in the ini file comments it out.
      upload_tmp_dir="C:\php\upload"
      session.save_path="C:\php\session"
      cgi.force_redirect=0
      extension_dir ="C:\php\ext"
      display_errors = Off
      log_errors = On
      error_log = "C:\php\error_log"
    2. You might want to look at upload_max_filesize. I’ve set mine to 16M. I also set post_max_size = 16M.
    3. Enable the extensions you need by deleting the semicolon at the beginning of the line. These will depend on your application… I’m going to be using MySQL (which I’ve already installed) and Moodle (which I’ll install later). My list looks like the following:
      extension=php_bz2.dll
      extension=php_curl.dll
      extension=php_dba.dll
      extension=php_dbase.dll
      ;extension=php_exif.dll
      extension=php_fdf.dll
      extension=php_gd2.dll
      extension=php_gettext.dll
      ;extension=php_gmp.dll
      ;extension=php_ifx.dll
      ;extension=php_imap.dll
      ;extension=php_interbase.dll
      extension=php_ldap.dll
      extension=php_mbstring.dll
      extension=php_mcrypt.dll
      extension=php_mhash.dll
      extension=php_mime_magic.dll
      ;extension=php_ming.dll
      ;extension=php_msql.dll
      ;extension=php_mssql.dll
      extension=php_mysql.dll
      extension=php_mysqli.dll
      ;extension=php_oci8.dll
      extension=php_openssl.dll
      ;extension=php_pdo.dll
      ;extension=php_pdo_firebird.dll
      ;extension=php_pdo_mssql.dll
      ;extension=php_pdo_mysql.dll
      ;extension=php_pdo_oci.dll
      ;extension=php_pdo_oci8.dll
      ;extension=php_pdo_odbc.dll
      ;extension=php_pdo_pgsql.dll
      ;extension=php_pdo_sqlite.dll
      ;extension=php_pgsql.dll
      ;extension=php_pspell.dll
      extension=php_shmop.dll
      ;extension=php_snmp.dll
      extension=php_soap.dll
      extension=php_sockets.dll
      ;extension=php_sqlite.dll
      ;extension=php_sybase_ct.dll
      extension=php_tidy.dll
      extension=php_xmlrpc.dll
      extension=php_xsl.dll
      extension=php_zip.dll
  11. Right-Click on Start > Computer. Choose “Properties”, then “Advanced”. Click on “Environment Variables”. Click on PATH, then Edit… and add “;C:\php;c:\php\ext” (without quotes) to the end of the variable.
  12. Open your Apache configuration file (All Programs > Apache HTTP Server 2.2.x > Configure Apache Server > Edit the Apache httpd.conf Configuration File). Add the following lines:
    LoadModule php5_module "C:\php\php5apache2_2.dll"
    AddType application/x-httpd-php .php
    AcceptPathInfo on
    PHPIniDir "C:\php"

    Look for the DirectoryIndex line. Add ” index.php” (no quotes) to the end of that line.

    Save the file.

  13. Create a file named test.php in your Apache htdocs directory, containing this text: <?php phpinfo(); ?>
  14. Reboot your machine.
  15. Browse to http://localhost/test.php. You should see tabulated information about your working PHP installation.

Written by senese on June 6th, 2007 with no comments.
Read more articles on php and how to and apache and installation and vista.

Stop User Account Control under Vista

Vista constantly asks for confirmation of actions when you’re installing software. This is designed to prevent worms and trojans from doing their thing, but some installations that worked under XP will fail under Vista because of this behavior. You can fix it (and stop the constant nagging) by stopping “User Account Control” as follows:

  1. Go to Start > Control Panel > User Accounts.
  2. Click on “Turn user account control on or off”.
  3. Uncheck “Use user account control (UAC) to protect your computer”.
  4. Click “OK”.
  5. Reboot.

Written by senese on June 6th, 2007 with no comments.
Read more articles on how to and installation and vista.

Install Apache on Windows Vista

Installing Apache under Windows XP was trivial. Not so, under Vista. Creation of the Apache service fails. The conf directory can’t be set up by the installer, probably due to permission problems.

I finally got it working with the following procedure. I used the latest version of Apache (2.2.4) and Windows Vista Home Premium.

  1. Uninstall any previous installations of Apache Web server (Start > Control Panel > Programs and Features).
  2. Turn off your firewall (Control Panel).
  3. Stop User Account Control (UAC).
  4. Get the most recent version of apache from http://httpd.apache.org/download.cgi and put it on your desktop. Rename it to apache.msi
  5. Start > All Programs > Accessories
  6. Right-Click “Command Prompt” and choose “Run as Administrator”
  7. Manually remove directories containing previous apache installations (like C:\Program Files\Apache Software Foundation…)
  8. Change to your desktop folder (At prompt type cd desktop)
  9. Type “msiexec /i apache.msi” on the command prompt.
  10. Run through the Apache installer. I’m running a development server, so I left the domain and computer name blank. Choose the default server on port 80 for all users option. Change the installation directory to c:\apache.
  11. Reboot.
  12. The little Apache feather won’t appear on the task bar under Vista with the present version of Apache (2.2.4). To remove the “error” box that says ‘the operation completed successfully” on startup, go to  All Programs > Startup,  and remove the Apache item there.
  13. Browse to http://localhost. It should say “It works!” If it doesn’t, check your httpd.conf file by going to All Programs > Apache HTTP Server 2.2.x > Configure Apache Server > Test Configuration. Follow the directions for fixing the configuration file.
  14. Turn your firewall back on. You can turn UAC back on too, if you like (mine is off, and it’s staying off!)

Written by senese on June 6th, 2007 with no comments.
Read more articles on how to and apache and installation and vista.