CiviCRM Community Forums (archive)

Old sections (read-only, deprecated) => Installing CiviCRM => Support => Drupal Installations => Topic started by: SemperFi on October 02, 2008, 08:13:51 am

Title: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: SemperFi on October 02, 2008, 08:13:51 am
Hy
I'm under XP Pro, using XamppLite with PHP 5.2.6 and MySQL 5.0.51b-community-nt.
I'm trying to install CIVICRM v2.1 stable with the automatized install and I get :    
"The user account used by your web-server needs to be granted write access to the following directory in order to configure the CiviCRM settings file:
C:/xampplite/htdocs/ifpcrm\sites\default"
How can I do do change the permission and how do you proceed if using unxutils ?
Tks !!
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Piotr Szotkowski on October 02, 2008, 10:30:29 am
I don’t have any Windows experience, but it seems it should be possible to download unxutils (http://sourceforge.net/project/showfiles.php?group_id=9328) and then open the command prompt, and after installing them run

Code: [Select]
chmod 777 C:/xampplite/htdocs/ifpcrm/sites/default

Let us know if this doesn’t work.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: patroclas on October 02, 2008, 02:59:47 pm
I don’t have any Windows experience, but it seems it should be possible to download unxutils (http://sourceforge.net/project/showfiles.php?group_id=9328) and then open the command prompt, and after installing them run

I have the same problem. Have done everything possible to make that folder writeable in windows.
I can't see how to use UnixUtils and can't find any help on this - can anyone explain please?
On a local installation (using Wampp) it seems to me that the folder should be writeable anyway. Is there another way round this problem? Some way of bypassing this stage in the installer maybe? Or is there a setting in wampp that could be used?
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Piotr Szotkowski on October 03, 2008, 12:13:50 am
Well, it *should* work. :|

Can you put the attached file in your install directory (as index.php) and check whether this fixes the issue? (I switched some hard-coded /s to DIRECTORY_SEPARATORs.)
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: patroclas on October 03, 2008, 01:58:54 am
Thanks for your reply but Nope... :(
   
Code: [Select]
The user account used by your web-server needs to be granted write access to the following directory in order to configure the CiviCRM settings file:
C:/wamp/www/drupal-6.4\sites\default

with your index.php at  C:/wamp/www/drupal-6.4\sites\all\modules\civicrm\install\

This is using the root account in localhost, so all files should be accessible?
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: SemperFi on October 03, 2008, 10:17:13 am
Hy!
Thanks for your answer but both solutions didn't work:

With unxutils  and the command : chmod 777 C:/xampplite/htdocs/ifpcrm/sites/default => I got this message : zsh: command not found :chmod
Could you please describe precisely the way to proceed

With the index.php file I replace my genuine one, but it doesn't work.
Need help

Thanks
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: ari on October 04, 2008, 12:29:52 am
I'm having the same problem. I've tried installation of 2.1 on Wampserver, XAMPP, and Uniform Server. All 3 packages have the error about sites/default permissions.

I also tried unixutils and got the same error mentioned above. Any ideas?
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Deepak Srivastava on October 04, 2008, 04:58:45 am
chmod will not work if it's a FAT32 partition since it does not provide any security (while NTFS should work).

Even windows procedure to set/change permission applies only if its a NTFS partition - http://technet.microsoft.com/en-us/library/bb456988.aspx (read the note below - "You can set file and folder permissions only on drives formatted to use NTFS").
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: patroclas on October 04, 2008, 05:35:05 am
Thanks , but file system is NTFS
The problem must be in the install script - the file permissions are OK.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Deepak Srivastava on October 04, 2008, 06:19:34 am
If you suspect its a code issue try commenting the line 266 to 270 (shown below) in the file - civicrm/install/index.php, which is actually responsible for verifying the permission and check.
Code: [Select]
            foreach ( $writableDirectories as $dir ) {
                $this->requireWriteable( $cmsPath . DIRECTORY_SEPARATOR . $dir,
                                         array("File permissions", "Is the $dir folder writeable?", null ),
                                         true );
            }
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: patroclas on October 04, 2008, 06:28:19 am
Thanks very much Deepak - that has worked!  :) :) :)
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Piotr Szotkowski on October 04, 2008, 06:59:54 am
Deepak: this might be because the getBaseDir() function in install/index.php is creating a path with a forward slash in the end of it. If you have a Windows machine, please try backporting r17373 (http://fisheye.civicrm.org/changelog/CiviCRM/trunk?cs=17373) to 2.1 and check whether this fixes this problem.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Deepak Srivastava on October 04, 2008, 07:33:39 am
Right now i don't but we 'll try to setup one and check.

patroclas, since you already on windows could you help us on it. All you need to do is replace civicrm/install/index.php with latest file - http://svn.civicrm.org/civicrm/trunk/install/index.php and try reinstall and check if you get that same error again.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: patroclas on October 04, 2008, 11:21:10 am
Right now i don't but we 'll try to setup one and check.

patroclas, since you already on windows could you help us on it. All you need to do is replace civicrm/install/index.php with latest file - http://svn.civicrm.org/civicrm/trunk/install/index.php and try reinstall and check if you get that same error again.

I tried this but same error

   
Code: [Select]
The user account used by your web-server needs to be granted write access to the following directory in order to configure the CiviCRM settings file:
C:/wamp/www/drupal-6.4\sites\default
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: patroclas on October 04, 2008, 02:03:32 pm
I am getting more errors now and I guess it is not able to create or write to the /files, /temp and /upload directories after attempting to enable the civiCRM module in drupal?
Code: [Select]
Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\drupal-6.4\includes\file.inc on line 889
I have created those directories manually but no change.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Deepak Srivastava on October 05, 2008, 12:07:12 am
Can you check if the file sites/default/civicrm.settings.php exists. If not then its a permission issue otherwise it could be memory limit issue.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Eileen on October 05, 2008, 12:21:26 am
Is your civicrm path defined correctly in your crm.settings.php file?

$civicrm_root = 'C:\\wamp\\www\\html\\sites\\all\\modules\\civicrm\\';

Have you used double \'s?
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: patroclas on October 05, 2008, 09:59:03 am
Deepak - File exists

Eileen - path is:

Code: [Select]
$civicrm_root = 'C:/wamp/www/drupal-6.4/sites/all/modules/civicrm';
(it would not include the '/html/' part in wampp)

I have freed up some webspace on a unix server so am not pursuing the local install - but it would be good to get this sorted as there seem to be others with the same problem. (The unix install has been faultless!  :))
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Eileen on October 05, 2008, 10:54:29 am
no - the /html/ is specific to my install but it didn't work for me until I traded unix direction slashes for windows direction slashes & doubled them
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Eileen on October 05, 2008, 11:02:49 am
nb - having to double slashes in paths is fairly common in windows land as the slash works as an escape character - telling it to take whatever character is after it literally.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: patroclas on October 05, 2008, 12:27:48 pm
I have edited the settings file but it does not seem to have had any effect - when attempting to enable the civicrm module in Drupal, the previous error is generated and/or a timeout is reported.
I regret that I must leave this problem now as I am fully committed setting up my on-line installation, although I would be interested to see if a solution is found by others - thanks for the help on this.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: SemperFi on October 05, 2008, 03:02:32 pm
If you suspect its a code issue try commenting the line 266 to 270 (shown below) in the file - civicrm/install/index.php, which is actually responsible for verifying the permission and check.
Code: [Select]
            foreach ( $writableDirectories as $dir ) {
                $this->requireWriteable( $cmsPath . DIRECTORY_SEPARATOR . $dir,
                                         array("File permissions", "Is the $dir folder writeable?", null ),
                                         true );
            }


THANK YOU IT WORKS
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: ob on October 31, 2008, 05:49:27 am
Hi guys.....

No need to edit files or anything, simply need to change remove the Read-Only status from the directory.
Though not using the Explorer way!!

Here we go:
The method that worked for me was to go to start/run cmd  and go to the /sites folder. (or if you have cmdhere installed, in explorer right click folder cmdhere). Once in this folder apply the following command to solve the problem:
attrib -r default /s /d


Problem solved,

Let me know if it worked
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Eileen on October 31, 2008, 01:42:17 pm
Yes, but I'm wondering if the real answer isn't to amend the install script.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: patroclas on October 31, 2008, 03:45:41 pm
Thanks Eileen - that's the most sensible reply yet. I abandoned attempts to install locally - which should be easy out of the box IMO.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Donald Lobo on October 31, 2008, 08:08:52 pm

Probably, but considering that the development team does not have any windows expertise (and i suspect most of us are not interested in gaining this expertise either), its up to our windows community to come up with patches to do so :)

lobo
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: patroclas on November 01, 2008, 08:29:39 am
In the mean time, perhaps a note in the installation instructions could save some time for people like myself. Or perhaps a link to this topic?
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Donald Lobo on November 01, 2008, 12:45:19 pm

The wiki is community editable. Please edit the wiki and do the needful. The core team does check and monitor the changes made to the documentation

lobo
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Eileen on November 01, 2008, 02:27:20 pm
I've done a little poking around and the 'is_writable' test is not useful on folders in a windows environment. It tests for the Read-Only attribute not permission. Read-only is used on Folders in Windows to achieve things other than what it says - and should be ignored.

I would suggest that this test should be circumvented for windows - e.g. add an if the environment is windows return true, else do the existing function.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: joachim on November 12, 2008, 09:25:00 am
Another problem you might encounter with Xampp on Windows is that CiviCRM needs innodb support enabled.

Instructions here: http://www.mydigitallife.info/2006/10/21/enable-mysql-innodb-storage-engine-support-in-xampp-installation/
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: thankyoucivicrm on November 30, 2008, 02:16:19 pm
Thank you! it worked for me! ;D ;D ;D ;

Hi guys.....

No need to edit files or anything, simply need to change remove the Read-Only status from the directory.
Though not using the Explorer way!!

Here we go:
The method that worked for me was to go to start/run cmd  and go to the /sites folder. (or if you have cmdhere installed, in explorer right click folder cmdhere). Once in this folder apply the following command to solve the problem:
attrib -r default /s /d


Problem solved,

Let me know if it worked
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Kurund Jalmi on November 30, 2008, 09:39:24 pm
patroclas:

You need to increase max execution time in your php.ini.

Kurund
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: patroclas on December 01, 2008, 04:47:05 am
Thanks Kurund, but that is not possible on most shared hosting services.
I abandoned civi-crm some weeks ago as a result of these problems. I found the interface with Drupal to be poor and the problems with testing locally to be a barrier that prevented the progress of my project. I have been able to do all I needed with Drupal and a few other modules.
The replies to the original question have been useful, so thanks.
Unsubscribing
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Kurund Jalmi on December 01, 2008, 04:53:24 am
patroclas:

I guess you can use .htaccess to max execution time, if you search forum you will find few options :)

Kurund
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: blythe on December 15, 2008, 12:53:17 am
Thank you for this thread, as I was having the exact same problem.  I agree with Eileen, though, that the install script should be fixed for this issue.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: blueskiwi on December 24, 2008, 03:24:29 am
Thanks so much, this worked.

Previously I was finding that in Windows right-click properties for the Default folder by 'Read Only' I was getting the 'green square' tick box, which is sort of half ticked and usually means that there are files below with a mix of permissions. But I couldn't work out why I couldn't get Default or any of the folders below to stay unticked, ie writeable.  Windows Explorer helpfully doesn't tell you what it means or why it's failing to untick that box.

Anyway, great, that attrib -r command worked perfectly.

It suggests maybe there's nothing the install script can do about weird Windows behaviour, but that this fix should be mentioned in the install instructions?

Hi guys.....

No need to edit files or anything, simply need to change remove the Read-Only status from the directory.
Though not using the Explorer way!!

Here we go:
The method that worked for me was to go to start/run cmd  and go to the /sites folder. (or if you have cmdhere installed, in explorer right click folder cmdhere). Once in this folder apply the following command to solve the problem:
attrib -r default /s /d


Problem solved,

Let me know if it worked
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: obiuquido144 on October 27, 2009, 03:30:07 pm
Updated the insturctions in http://wiki.civicrm.org/confluence/display/CRMDOC/Drupal+Installation+Guide (just metioned the message and pointed to the relevant msg here)
Feel free to correct my non-native English wording etc...
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: thinkpadius on May 03, 2010, 02:53:46 pm
Hi guys.....

No need to edit files or anything, simply need to change remove the Read-Only status from the directory.
Though not using the Explorer way!!

Here we go:
The method that worked for me was to go to start/run cmd  and go to the /sites folder. (or if you have cmdhere installed, in explorer right click folder cmdhere). Once in this folder apply the following command to solve the problem:
attrib -r default /s /d


Okay let me just point out I'm a little bit of a noob at windows and I've never used the cmd function from the start menu before.  But I figured it out.

I run a wamp server (I'm making an internal website) on windows xp.  I run cmd from the start menu and to get this to work you need to paste in the address for your /sites folder, followed by a space followed by pasting the command above.  The mistake is to think it is two steps/lines!

so it will look something like this:

C:\wamp\www\YourDrupalWebsite\sites attrib -r default /s /d

any other way didn't work for me.  and google was not my friend on this one!  hope this add some clarity.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Sky on December 30, 2011, 10:30:11 pm
I went through the same story, on Windows 7 and neither explorer nor "attrib -R default /S /D" or files did it for me

At the end, based on Eileen's remark that is_writable doesn't work the same way on Windows, I ended up patching the installer to skip the test and it worked fine.

Specifically, I went into the function requireWriteable in index.php in the install director, and commented out the if logic within the function only to get through the install (in 4.1 beta, this corresponds to lines 557-570) and reverted it back after the install was done.

Adding one more option/idea for comments



Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: Rajesh on January 03, 2012, 03:44:41 am
I had this same issue(WAMP on Windows XP). It worked after i patched the installer (sites\all\modules\civicrm\install\index.php)

Code: [Select]
    function requireWriteable($filename, $testDetails, $absolute = false) {
        $this->testing($testDetails);
        if ( ! $absolute ) {
            $filename = $this->getBaseDir() . $filename;
        }
        // Check if Windows OS. Under Windows, 'is_writeable' only returns the read-only attribute status, not the actual permissions (ACL), So forcing chmod 777 if Windows 
        if (strtolower((substr(PHP_OS, 0, 3))) == 'win') {
            chmod($filename, 0777);   
        }
        if(!is_writeable($filename)) {
            $name = null;
            if ( function_exists( 'posix_getpwuid' ) ) {
                $user = posix_getpwuid(posix_geteuid());
                $name = '- ' . $user['name'] . ' -';
            }

            if ( ! isset( $testDetails[2] ) ) {
                $testDetails[2] = null;
            }
            $testDetails[2] .= "The user account used by your web-server $name needs to be granted write access to the following directory in order to configure the CiviCRM settings file:\n$filename";
            $this->error($testDetails);
        }
    }

Hope it helps some one else.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: awennerlind on January 06, 2012, 01:19:55 pm
Commented this out of the install.php file and all is well:       

    foreach ( $writableDirectories as $dir ) {
                $this->requireWriteable( $cmsPath . DIRECTORY_SEPARATOR . $dir,
                                         array("File permissions", "Is the $dir folder writeable?", null ),
                                         true );
       

THANK YOU Semper Fi. This is the only thing that worked for me. A savvy nonprofit chic, working off a mac, who doesn't know a ton of this crazy code stuff figured it out thanks to your help. :-)

And thank you CiviCRM for your hard work on this. Can't wait to get things up and running.

Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: arawlings on February 03, 2012, 07:23:38 am
Does anyone else have the problem with error messages at the top of the page after installing CiviCRM 4.0.8 on Drupal 7.12 running on Xampp 1.7.4?

I was only able to get through the install process by commenting out the check-logic.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: BatRosko on March 08, 2012, 06:51:47 am
Resolution for Windows 7 64 bit

1. Install SciTe (if you don’t have it) to open .php file
2. Navigate to: C:\xampp\htdocs\drupal\sites\all\modules\civicrm\install
3. Right click on index.php end choose Edit with SciTE
4. Scroll down to 572 and type /** and on 585 type */
5. Restart Apache Service
6. Hit Check Requirements and Install CiviCRM

Once the installation completed remove /** and  */
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: DerekL on April 03, 2012, 12:46:28 pm
Same issue here. Fresh local install of Drupal 7.12, Civi 4.1.1 on Z-WAMP.

Attrib command didn't do the trick, had to hack install.php as well.
Title: Re: Install / XAMPP / XP Pro - How to grant write access to "sites/default"
Post by: redking on May 18, 2012, 02:26:45 am
If you suspect its a code issue try commenting the line 266 to 270 (shown below) in the file - civicrm/install/index.php, which is actually responsible for verifying the permission and check.
Code: [Select]
            foreach ( $writableDirectories as $dir ) {
                $this->requireWriteable( $cmsPath . DIRECTORY_SEPARATOR . $dir,
                                         array("File permissions", "Is the $dir folder writeable?", null ),
                                         true );
            }

Thank you this was a perfect solution for WAMP on Windows for DURPAL