- What's this about?
- Before you start
- Setting up Apache 2.0.46
- Setting up PHP 4.3.2
- Setting up NetPBM
- Setting up JHead
- Setting up Gallery 1.3.3
What's this about?
This guide is meant to help you setup Gallery from scratch on your Windows box.
It is in no way meant to be comprehensive or a replacement to the copius
information on the Gallery website. Caveat emptor! Refer to the Gallery FAQs
and the helpful wizards moderating the discussion
forums if you're totally stuck.
Please email me with
any thoughts you may have for additions / corrections to this page . I'd really appreciate it.
Before you start
There are reported problems with IE6 and PHP, which are fixed in some MS-supplied patches. Now is a good time to install Service Pack 1 for Windows XP if you haven't done so already, bcos it includes all the bug-fixes.Setting up Apache 2.0.46
1) From the Apache http server page, download and run the Win MSI installer for Apache 2.x2) The installation should be straightforward. I chose D:\Program Files\Apache Group as the destination folder. The important folders created at the end of the installation are :
"D:\Program Files\Apache Group\Apache2\htdocs" in which all the stuff on your web site will go, and
"D:\Program Files\Apache Group\Apache2\conf" which contains your httpd.conf configuration file for Apache.
3) Test your installation by starting the Apache server from your Start menu or from the service monitor. Then open a web browser, and type in the URL http://yourmachinenamehere/ or http://localhost/ . You should see a default Apache page with a message saying that your installation was successful. If so, congratulations! You now have a working web server.
Setting up PHP 4.3.2
1) Download the "PHP4.3.2 ZIP package" from here.2) Extract it to D:\PHP . Do NOT install it within the "Program Files" folder or any other folder whose name has a space in it.
3) Make the following changes to your httpd.conf file:
3.1) Find the line:
#LoadModule rewrite_module modules/mod_rewrite.soand remove the "#" at the start of the line
3.2) Now add the following lines at the end of your http.conf file:
4) Make a copy of the php.ini-recommended file in your C:\WinNT folder and rename it as "php.ini" Make a shortcut to this file at "D:\PHP\php.ini". This way you'll be sure to edit just one copy of the file.LoadModule php4_module "d:/php/sapi/php4apache2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps
DirectoryIndex index.html index.php default.php main.php
<Directory "D:\Program Files\Apache Group\Apache2\htdocs\gallery">
AllowOverride Options FileInfo
</Directory>
5) Copy the php4ts.dll into your C:\WinNT\system32 folder
6) Make the following changes to your php.ini file
Find the line corresponding to each entry in the left column and change it to that in the corresponding right column. Be sure to remove the semicolon at the start of the line whenever necessary.
;include_path
= ".;c:\php\includes" |
include_path = ".;D:\php\includes" |
doc_root= |
doc_root = "D:\Program
Files\Apache Group\Apache2\htdocs" |
extension_dir
= "./" |
extension_dir = "D:\PHP\extensions" |
;upload_tmp_dir
= |
upload_tmp_dir =
"C:\WinNT\Temp" |
upload_max_filesize
= 2M |
upload_max_filesize
= 16M |
session.save_path
= /tmp |
session.save_path
= "C:/WinNT/Temp" |
7) Now to test whether PHP works, create a file named info.php in your htdocs folder with the following lines in it:
8) Now restart the Apache server, and browse to http://localhost/info.php<?
phpinfo();
?>
You should see a page filled with information about your PHP installation. The top rows should list the folder where PHP looks for your php.ini file. Make sure it says C:\WinNT\php.ini. Browse right to the bottom of the page, and make sure there are no obvious errors. Refresh the page a couple of times to verify that the page is free of obvious errors like strewn hex-like symbols. If everything looks fine-n-dandy, you've got PHP working with Apache.
Setting up NetPBM
1) Download NetPBM for Win32 from the Gallery download page, and unzip the contents into D:\NetPBM. Again the folder name is not supposed not have any spaces in it.2) Add D:\NetPBM to your windows PATH variable OR copy the dll's that came with the tarball into your C:\WinNT\system32 folder
Setting up JHead
1) Download jhead.exe from here and dump the file in D:\NetPBM .Setting up Gallery 1.3.3
1) Extract the gallery installation files into D:\Program Files\Apache Group\Apache\htdocs\gallery i.e. the gallery installation will reside in your htdocs folder within the Apache installation.2) On the command line, run configure.bat within the D:\Program Files\Apache Group\Apache\htdocs\gallery directory to enter Gallery's configuration mode.
3) Create a directory names albums within the gallery folder (as D:\Program Files\Apache Group\Apache\htdocs\gallery\albums)
4) Browse to http://localhost/gallery/setup and run the diagnostic tests for PHP, NetPBM and Sessions as given in the instructions. Things should work as they should. Make sure you have cookies enabled on your browser for the Sessions test to work.
5) Go back to the configuration wizard and proceed. The wizard will build your config.php file.
On the first form, be sure to enter your path for NetPBM (D:\NetPBM) , the EXIF executable (D:/netpbm/jhead.exe), album directory (D:/Program Files/Apache Group/Apache2/htdocs/gallery/albums), the temp directory (C:/WINNT/Temp).
Also enter the Gallery url (http://yourmachinename/gallery) and Albums url (http://yourmachinename/gallery/albums) and a password that you'll use for your admin account.
6) Proceed through the steps in the wizard, and once you're done, run secure.bat from the command line to exit Gallery's configuration mode.
7) Browse to http://yourmachinename/gallery and make sure you see a functional starting page (with no albums).
8) It is useful to go back to configuration mode and verify that all your executables are detected (except for ImageMagick, which we intentionally did not install). The detector for Apache's mod_rewrite module doesn't work occasionally. If you're sure that you followed step 3.1 while setting up PHP, you can fix this problem and force Gallery into a configuration where mod_rewrite is detected. Do this by entering configuration mode (by running configure.bat) and browsing to http://localhost/gallery/setup/index.php?init_mod_rewrite=1 . Be sure to run secure.bat once you're done.
9) Once you've tried stuff in Gallery (adding albums, pictures etc.) and are sure that everything works, edit the config.php file in your htdocs folder as follows:
Find the lines:
$gallery->app->photoAlbumURL = "http://yourmachinename/gallery";
$gallery->app->albumDirURL = "http://yourmachinename/gallery/albums"
in the file and change the lines to:Save the file, and revisit your gallery page to make sure things are still working.$gallery->app->photoAlbumURL = "/gallery";
$gallery->app->albumDirURL = "/gallery/albums"
10) What step 9 did was allow the page to be visited remotely by the use of relative urls. To verify this, go to an anonymous browsing service here and browse to http://yourmachinename/gallery . You should be able to see the gallery you just created.
And you're done!!
