Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Failure - "couldn't write to some directories" #5622

Closed
lucanos opened this issue Apr 28, 2008 · 6 comments
Closed

Installation Failure - "couldn't write to some directories" #5622

lucanos opened this issue Apr 28, 2008 · 6 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@lucanos
Copy link

lucanos commented Apr 28, 2008

Installed v0.1.5 on SunFire V240 running Solaris 10, Apache v2.2.6, MySQL v5.0.45 (Standard) & PHP v5.2.4 .

Initial visit returns message:

```
Piwik couldn’t write to some directories.

Try to Execute the following commands on your Linux server:
chmod 777 /var/www/html/tools/piwik/config

If this doesn’t work, you can try to create the directories with your FTP
```

Directory Listing within /var/www/html/tools/piwik/:

```
minerva:/var/www/html/tools/piwik# ls lash
total 52
2 drwxr-sr-x 10 root root 512 Apr 23 14:02 .
2 drwxr-xr-x 5 501 webservd 512 Apr 28 08:26 ..
2 drwxr-sr-x 2 501 webservd 512 Apr 23 14:01 config
4 -rwxr-xr-x 1 501 webservd 1.5K Apr 2 07:05 index.php
2 drwxr-sr-x 2 501 webservd 512 Apr 23 14:01 lang
2 drwxr-sr-x 12 501 webservd 512 Apr 23 14:02 libs
2 -rw-r
-r— 1 501 webservd 42 Mar 15 08:55 LICENSE
2 drwxr-sr-x 5 501 webservd 1.0K Apr 23 14:01 misc
2 drwxr-sr-x 13 501 webservd 1.0K Apr 23 14:01 modules
14 rw-r-r— 1 501 webservd 6.9K Mar 28 23:42 piwik.js
6 rw-r-r— 1 501 webservd 2.1K Apr 11 23:38 piwik.php
2 drwxr-sr-x 23 501 webservd 512 Apr 23 14:01 plugins
4 rw-r-r— 1 501 webservd 1.2K Jan 14 15:40 README
2 drwxr-sr-x 4 501 webservd 512 Apr 23 14:01 tests
2 drwxr-sr-x 3 501 webservd 512 Apr 23 14:01 themes
2 rw-r-r— 1 501 webservd 806 Mar 28 12:12 TODO
```

Executed CHMOD as per instructions:

```

2 drwxrwsrwx 2 501 webservd 512 Apr 23 14:01 config

```

Refreshed webpage:

```
Piwik couldn’t write to some directories.

Try to Execute the following commands on your Linux server:

If this doesn’t work, you can try to create the directories with your FTP
```

(NOTE: Line which detailed suggested CHMOD command now absent. All other details identical.)

I have also retested after removing the “Sticky” permission from the Group set, but with same results.

Keywords: install chmod config

@anonymous-matomo-user
Copy link

Had the exact same issue. I think the problem was, that the piwik-directory itself had not the necessary rights.

try
chmod 777 /var/www/html/tools/piwik

@anonymous-matomo-user
Copy link

I am getting the same message after installing on Windows Server 2003 R2 with Apache 2.2 and PHP 5.2.5.
There are NO directories displayed whose protection should be modified!

is there a list of directories and files which piwik is trying to create/read/update/delet?

@lucanos
Copy link
Author

lucanos commented May 8, 2008

Alright, having taken "freedimension"s advice, and chmodding the whole Piwik directory to 777 – NOT RECOMMENDED IN THE WILD, I now have a list of folders which Piwik wants to write to.

So, the folder list is:

```
/var/www/html/tools/piwik/config
/var/www/html/tools/piwik/tmp
/var/www/html/tools/piwik/tmp/templates_c
/var/www/html/tools/piwik/tmp/cache
```

And therefore the amended Unix CHMOD commands should be:

```
chmod 777 config
chmod -R 777 tmp
```

When both commands are run from within the PIWIK directory.

The installation script still needs to be fixed so that these commands are appropriately displayed to installing users.

@mattab
Copy link
Member

mattab commented May 8, 2008

(In 467) – fix #5622 it seems this fix does the trick or suggesting the right directories at installation. Please apply the diff and report any problem.

@anonymous-matomo-user
Copy link

I’ve still have this problem.

I’ve made some search about why it doesn’t work. Here it is.

Piwik doesn’t have the right to create directories inside it’s installation dir. So Piwik::mkdir (in modules/Piwik.php:101) doesn’t create any directory.
Then, line 104,

```
$directory = realpath($directoryToCheck);
```

realpath return false since the directory doesn’t exists, as the PHP doc say:
realpath() returns FALSE on failure, e.g. if the file does not exist.

``

`
$directory
is now false. So when trying to set true or false in the $resultCheck array, thing like
``````

$resultCheck[$directory] = false;

```
is just doing something like
```

$resultCheck0 = false;

```
```

@mattab
Copy link
Member

mattab commented Oct 8, 2008

Thanks for your investigation! that’s very helpful :) Check bug fix in 634

@lucanos lucanos added this to the RobotRock milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

3 participants