News of the world

This blog is in the first case meant for myself so I don't forget interesting stuff. So you will find lots of useless topics, but there will certainly be also readings that might interest you. Lots of the items will go about my family, things we do or don't do but also about software, cars, gadgets, music, etc ... .

12 mei 2005

PHP for windows

This post just reminds me of how I installed PHP 5.0.4 on my WIN2K machine. So don't look for something mind breaking, it's just a reminder for myself.

Download PHP from the php.net website.
These are the steps I followed to unpack/install and configure PHP :

  1. I took the zip file from the windows binaries and unpacked it under c:\php
  2. Located php.ini-dist and renamed it to php.ini
  3. I've set the doc_root in this ini-file to the DocumentRoot in my httpd.conf from my Apache2 web server.
  4. I pointed the extension_dir to the path where I installed PHP, i.e. c:\php
  5. Moved the php.ini file to the WIN2K directory c:\winnt
  6. Added the following two lines to the httpd.conf file : LoadModule php5_module c:/php/php5apache2.dll and AddType application/x-httpd-php .php
  7. Copied all *.dll files from the ext-directory into the php root directory.
  8. Added the php directory to the PATH variable.
Now I want to access a Mysql database from within a php-script :
  1. Copied libmySQL.dll from MySQL into the php directory.
  2. Uncommented the php_mysql.dll extension in php.ini
  3. Wasn't able to use mysql_create_db(), but on the php web site they said it was recommended to use mysql_query() instead which worked.