Warning: mkdir() [function.mkdir]: Permission denied ... while installing new

Dafoe

Joined: 2006-01-03
Posts: 8
Posted: Tue, 2006-01-03 00:57

Hi all,

Im having a lot of trouble backing up my gallery2 site. I´ve followed these instructions (http://codex.gallery2.org/index.php/Gallery2:faq#How_can_I_move_my_gallery_installation_from_one_server_to_another.3F) to the letter but on step 4 in the new install I keep getting the following error:

Warning: mkdir() [function.mkdir]: Permission denied in /mnt/alpha/home/siggih/www/gallery/install/index.php on line 263

chmod 777 of course and path correct

I suspect this to be a php issue, do you guys know a quick fix ?

regards,
Ari Björnsson


Gallery version: 2.0.2
PHP version: 5.0.4
PHPInfo Link (see FAQ): http://www.ari.is/phpinfo.php
Webserver (e.g. Apache 1.3.33): 2.0.51
Database (e.g. MySql 4.0.11): 4.1.12
Operating system: CentOs kernel 2.6.9-22

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Tue, 2006-01-03 01:34

You should chmod -R a+rw g2data on the new install (or even better chown -R apache:apache g2data if you got root)

 
Dafoe

Joined: 2006-01-03
Posts: 8
Posted: Tue, 2006-01-03 09:05

Pelle: neighter of your suggestions worked. I´m getting worried ! :s

regards,
Ari Bjornsson

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2006-01-03 09:51

did you use the -R in your chmod call?
-R is for recursive.

also, if you're mounting windows drives in linux and the like, there could be other permission issues.

 
Dafoe

Joined: 2006-01-03
Posts: 8
Posted: Tue, 2006-01-03 10:24

Yes I´ve used:

#chmod -R 777 g2data
#chown -R apache:apache g2data

but it doesnt work. Im not mounting windoze drives :)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2006-01-03 10:29

@php config:
memory_limit 8M
is too low (but it's unrelated to your problem).
FAQ: PHP memory_limit - Why do I get the error Allowed memory size of Xxx bytes exhausted?

are you sure you enter the correct path?
have you actually checked if g2data/locks/ g2data/cache/ , ... all are 777 ?

 
Dafoe

Joined: 2006-01-03
Posts: 8
Posted: Tue, 2006-01-03 10:47

I fixed the memory limit, everything in g2data is chmod 777 like you can see in the screenshot attached. I´m also positive that I´m using a correct path.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2006-01-03 11:45

what's the path you enter?
there's no screenshot attached.

 
Dafoe

Joined: 2006-01-03
Posts: 8
Posted: Tue, 2006-01-03 12:07

Sorry, the file attachment must have failed. Here are two screenshots, one showing the permissions and the other the lines in /install/index.php where the error occurs. You can see the path in the first screenshot.

[img]http://www.hi.is/~arib/clipboard.gif[/img]
[img]http://www.hi.is/~arib/clipboard2.gif[/img]

This must be because of Gallery2 and PHP 5.0.4 incompatability.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2006-01-03 12:30

i don't think this has anything to do with php 5.0.4 in general.

what path do you enter in the installer step 4 (storage step).

it should be:

/mnt/alpha/home/siggih/www/gallery/g2data/

 
Dafoe

Joined: 2006-01-03
Posts: 8
Posted: Tue, 2006-01-03 12:46

Yes, thats exactly the path I´m using.

I changed the code in /install/index.php so it wont throw the mkdir error and then I got stuck at writing the config.php file in step 7 although:

#chmod 777 config.php
#chown apache:apache config.php

whats going on ?

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Tue, 2006-01-03 12:48

Yeah, Gallery works fine with php 5.0.4. As you can see the code is trying to create a dir that doesnt exist, this should give you a hint something along the line of check your path agian. If your path is correct then a mkdir call wouldn't be neccisary.

chmod -R 777 might not be a good idea (you're making all files executable with this, just the directories needs to be).

 
Dafoe

Joined: 2006-01-03
Posts: 8
Posted: Tue, 2006-01-03 12:57

Im going to take another shot at it tonight, I´ll keep you posted.

thx guys

regards,
Ari Björnsson

 
miz_t

Joined: 2006-01-17
Posts: 3
Posted: Wed, 2006-01-18 05:21

hi,

Having the same error in installation step 4,
although my situation is remote installing under the same router,

so 192.168.0.101 -> the linux box that has the gallery2
and my xp laptop 192.168.0.102 -> using putty and firefox it to 192.168.0.101 to do the install

and stuck on the same line
Warning: mkdir() [function.mkdir]: Permission denied in /mnt/alpha/home/siggih/www/gallery/install/index.php on line 263

have tried all methods above, none working..

 
Dafoe

Joined: 2006-01-03
Posts: 8
Posted: Wed, 2006-01-18 09:28

Hi miz_t,

I found a solution to my error by copy-ing the whole gallery directory from my webserver to my backup webserver:

user@web# cd /var/www/html/gallery
user@web# mysqldump -u root -p --opt gallery2_g2 > gallery2_g2_backup.sql
user@web# scp -r ../gallery/ user@backupserver:/var/www/html/
user@backupserver# ssh user@backupserver
user@backupserver# cd /var/www/html/
user@backupserver# chmod -R 777 gallery/
user@backupserver# cd gallery
---
created a new database called gallery2_g2
---
user@backupserver# mysql -u root -p gallery2_g2 < gallery2_g2_backup.sql
---
changed the config.php file in the gallery directory so it had my new mysql user/pw parameters
also patched my gallery2 to the latest version
---

This was my workaround for taking backup of gallery2 because I kept getting this error you talk about when I tried a fresh install on the backupserver and copied the g2data folder from webserver to backupserver like it says you should do in the FAQ.

hope it helps (unless you're talking about just afresh install) :)

best of luck!

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Wed, 2006-01-18 15:50

You should run the installer and point it to the old g2data/db. You shold not do a fresh (clean g2data/db) install.

 
evil_nick

Joined: 2006-03-22
Posts: 1
Posted: Wed, 2006-03-22 13:32

Hi there

I had a similar problem - "Warning: mkdir() [function.mkdir]: Permission denied" while installing Gallery. The gallery data directory I specified had the permissions set correctly and it was owned by the apache user so the web server had rights to it, but the Gallery installation still couldn't create directories where I wanted it to.

The problem in my case was that I had the SELinux's security features enabled in my Fedora Core 4 setup. I switched SELinux to permissive mode by editing /etc/sysconfig/selinux - putting SELINUX=permissive. Then the Gallery installation process worked fine. There's probably a nicer way than just disabling the security but I was after a simple solution. SELinux FAQ is <A HREF="http://www.crypt.gen.nz/selinux/faq.html">here</A>.

Another thing I checked before I found that was to make sure PHP is set up with safe mode off (it already was in my case). To do this look in your php.ini file (mine is at /etc/php.ini, to find yours you can type "php -i | grep php.ini"). There is a line in there for safe_mode - make it set to Off or whatever. PHP safe mode manual is <A HREF="http://us2.php.net/features.safe-mode">here</A>.

 
mbd2

Joined: 2006-11-16
Posts: 18
Posted: Fri, 2006-11-17 22:58

Wow I'm fighting this battle too. Not sure how to correct it. I now I have a Linux box, but not sure what the webhost security is set to.

Balloon Entertainment at its best! http://www.mbd2.com

 
mbd2

Joined: 2006-11-16
Posts: 18
Posted: Fri, 2006-11-17 22:58

Balloon Entertainment at its best! http://www.mbd2.com