Hi,
I'm trying to install Gallery on a Win32 IIS server and the Galler configuration script keeps giving me the following error:
Unable to write to /config.php.
You are missing either config.php or .htaccess.
How do I work around this? Or, where should these files be?
Thanks,
zzyzx
Posts: 13451
zzyzx, i split this from the thread you originaly posted in.
You need to create an empty config.php in the main Gallery directory. Read the IIS section on http://gallery.sf.net/docs.php and note that IIS really isn't supported.
Posts: 7
Thanks. I created an empty config.php in the /gallery directory and I still get the following error:
Unable to write to /config.php.
You are missing either config.php or .htaccess.
I know IIS isn't really supported, but do you have any other advice?
Thanks,
zzyzx :-?
Posts: 13451
zzyzx, then you probably need to make the IUSR_MACHINENAME account able to write to the files using Windows system permissions.
Check the notes on http://gallery.menalto.com/modules.php?op=modload&name=GalleryDocs&file=index&page=gallery1-install.windows-iis.php
Posts: 7
Thank you for the assistance.
I got a little further. Now I'm at the following screen:
"If you've finished your configuration but you're still seeing this page, that's because for safety's sake we don't let you run Gallery in an insecure mode.You need to switch to secure mode before you can use it."
I'm trying to configure the script on a remotely-hosted server, so I'll have to contact the provider to get the permissions set back.
Thanks again,
zzyzx
Posts: 3473
You should be able to use ftp to secure your gallery. See http://gallery.menalto.com/modules.php?op=modload&name=GalleryDocs&file=index&page=gallery1-install.unix-ftp.php
Posts: 8194
If it's Windows, just create a file called SECURE (no extension) in your setup/ directory.
Posts: 7
You people are awesome. I really appreciate the support.
I was finally able to configure and secure the gallery. I did have to make some slight modifications to get the gallery working on the Windows / IIS server that I am "leasing" space on, however. The server provider allows me to set or remove "write" permissions only on directories that are one level below the root for my userid. The /cgi-bin directory is permanetly set to allow executibles. Here's what I had to do:
* Create my own blank config.php (per someone's advice here) and place it in the /gallery dir (which is one level off of root for my userid.
* Modify the line "if ($fd = @fs_fopen("$GALLERY_BASEDIR/$outfile", "a")) {" in confirm.inc to read "/*if ($fd = @fs_fopen("$../$outfile", "a")) {".
* Modify the line "$outfile = "$GALLERY_DIR/config.php";" in write.inc to read "$outfile = "$../config.php";"
* Set write permissions (using a web page GUI provided by my host) on /gallery, /temp, and /albums.
* Use the Gallery web forms to create and save the config file.
* Inserted a blank "secure" file in the /setup directory (as directed by a previous poster here)
Now, I'd just appreciate some help cleaning up a few Warnings on the main page:
--
Warning: open(/tmp\sess_97e51f12484c95c6cc16c81e67f66cda, O_RDWR) failed: m (2) in ./session.php on line 59
Warning: Cannot add header information - headers already sent by (output started at ./session.php:59) in ./util.php on line 1942
Gallery
Search:
No albums, no image [login]
Powered by Gallery v1.4-pl2
Warning: open(/tmp\sess_97e51f12484c95c6cc16c81e67f66cda, O_RDWR) failed: m (2) in Unknown on line 0
Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
--
I'm an ASP and Perl developer, and this is my very first experience with PHP. Could somebody please help me to fix what is causing the above Warnings?
Thank you!
zzyzx
Posts: 7
Ahhh...it looks like I need to change the session.save_path in php.ini. I don't have the ability to do so since my host doesn't give me administrator access. Is there a workaround I can use?
Thanks!
Posts: 3474
Yes, assuming your .htaccess files are being obeyed (see page 1 of the Gallery Config. Wizard to establish this).
In the .htaccess file in your Gallery directory, add:
php_value session.save_path 'C:\My\Path'
-Beckett (
)
Posts: 7
Thanks. The web server is IIS and it was, unfortunately, not obeying the .htaccess file. I figured out that I needed to add the following line to session.php in order to change the session.save_path:
ini_set('session.save_path', 'd:/home/<my_domain>.com/temp')
It works now!!! Yes!!!!!!!!!!!!!!