I have tried to set this to enabled. But this causes my site to lose all css formating and just white screens with links on the left side are left. I set it to disabled and the site comes back.

I am running a multi site and under the sites/mydomain.com directory I have the files directory with the proper permissions set and I also have the permissions det for the tmp directory

For the files dir setting I have the current path set to:
c:\inetpub\wwwroot\sites\mydomain.com\files

For the tmp dir setting I have the current path set to:
c:\inetpub\wwwroot\sites\mydomain.com\tmp

I am using a dedicated windows2003 IIS server.

What could be causing this? This happpens using ANY theme.

I really need this setting as the theme I want to use absolutley requires it since formating issues happen without it when using IE6,7.

P.S... I have been through every search and post about this subject and the issues others had were related to permissions on either their files directory or their tmp directory. So I am out of answers.

Please help, :)

Thanks,

Dave

Comments

tm’s picture

remember seeing something about caching and css aggregation, especially when making theming changes. maybe clearing the database cache? or possibly the browser cache. i am assuming the remaining blocks are from a block cache of some sort. not sure though.

sorry.

linulo’s picture

I experienced the same problem. I could reproduce the problem after changing anything in the global site settings (like site logo) using the Zen theme on drupal 5.2. Pages do not contain links to CSS files anymore afterwards.

I have a database dump before and after but I did not yet find the time to pinpoint the problem by analyzing the diff. On first glance it seems to be cache related.

ldway’s picture

Still same problem. But I am not changing any global settings, logo's etc.

When I enable it I notice it is not writing any files to the files/css directory. I have checked and all write permissions on the directories are there so cannot figure this problem out. arrrg

Just praying someone has the answer.

tm’s picture

because i don't normally use this feature, i am unsure of the intended behavior.

on a local install, i enabled css aggregate. a css folder appears in the /files folder with a random-named css file. looking at the page source confirms that this is the css file being called. i also tried it with "normal" caching enabled, and i am okay, so far.

good luck!

ldway’s picture

-------------------------------------------------------------------
This is what is generated in the source when I have it DISABLED...
-------------------------------------------------------------------

 <style type="text/css" media="screen">
  <!--
   @import url(/sites/all/themes/spreadfirefox/modules.css);
   @import url(/sites/all/themes/spreadfirefox/nav.css);
   @import url(/sites/all/themes/spreadfirefox/layout.css);
  -->
 </style>
  <style type="text/css" media="all">@import "/modules/aggregator/aggregator.css";</style>
<style type="text/css" media="all">@import "/modules/book/book.css";</style>
<style type="text/css" media="all">@import "/modules/node/node.css";</style>
<style type="text/css" media="all">@import "/modules/system/admin.css";</style>
<style type="text/css" media="all">@import "/modules/system/defaults.css";</style>
<style type="text/css" media="all">@import "/modules/system/system.css";</style>
<style type="text/css" media="all">@import "/modules/user/user.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/cck/content.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/logintoboggan/logintoboggan.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/og/og.css";</style>
<style type="text/css" media="all">@import "/sites/all/modules/cck/fieldgroup.css";</style>
<style type="text/css" media="all">@import "/sites/all/themes/spreadfirefox/style.css";</style>

-------------------------------------------------------------------
This is what is generated in the source when I have it ENABLED...
-------------------------------------------------------------------

 <style type="text/css" media="screen">
  <!--
   @import url(/sites/all/themes/spreadfirefox/modules.css);
   @import url(/sites/all/themes/spreadfirefox/nav.css);
   @import url(/sites/all/themes/spreadfirefox/layout.css);
  -->
 </style>
  <style type="text/css" media="all">@import "/c:\inetpub\wwwroot\sites\mydomain.com\files/css/2620cb76e4b9c6c5d899ceafe3a0be00.css";</style>

NOTICE the last line above and see that it is using the machine path and it is puting the forward and backward slashes intermixed!

What in the world could be causing this?

tm’s picture

so the section that is supposed to be "/" (for base_path) is getting corrupted, somehow?

took a peek into api.drupal.org looking for the css aggregate function; search for "css" and a list comes up. i looked into the includes/common.inc, and promptly got lost. i suppose the same would happen if i tried to look at files.inc...

wondering if refreshing the includes folder would help? usual backup precautions... dunno, your call.

ldway’s picture

Well thanks TM for taking a peek into those files. I do know about getting lost in those things because I have been there and done that many a time.

I did try refreshing the include directory but no help there. (I am using 5.3). I also made a test site with no modules installed and had the same results. Very strange thing indeed.

After re-looking at that output source I tried a few crazy things like changing the files setting to have a path without the drive letter, also just a relitive path and finally using all forward unix style slashes. Funny thing is, even doing all that it still writes the compressed file to the files/css directory but the html output is still the same problem.

Oh well, guess I will have to live without that feature until I can finally get it solved. :)

thanks again for looking around on this! :)

-- Dave

tm’s picture

the aggregate css file does not seem to be the problem, just the path referencing it. usually only see the local paths in the error logs. wonder if it is related. an interesting test would be to change page.tpl.php and hard-code the import call to the css file

i am wondering if it has to do with iis isapi/rewrites. you seem to have clean urls going (that is a good thing! could never get it going on iis). i was wondering what would happen if you tried copying this installation to an apache-based solution? sounds like you have the chops to roll your own WAMP server; you might have to change ports.

i have some experience with iis, but not related to php/drupal. i think i need to build myself such an installation, just because it is now annoying.

ldway’s picture

Well I finally got the chance to completely uninstall my ISAPI_REWRITE and take away clean URL's. Nothing changed, still same problem with the weird output in html.

This is for sure a strange thing. I am completely out of ideas.

tm’s picture

there is always irc... surely someone there has seen or heard of it. i am mystified. i am sure it will be something simple but seemingly unconnected.

good luck, and best wishes.

ldway’s picture

Finally, solved this one! Here is the key:

Originally I had set the following in the file system settings:

For the files dir setting path set to:
c:\inetpub\wwwroot\sites\mydomain.com\files

For the tmp dir setting the path set to:
c:\inetpub\wwwroot\sites\mydomain.com\tmp

The Fix:

Since this is a windows server, the temporary directory must be set to using a full path to the desired temp directory. So this was left as it was.

However, the file system path must instead use a relative path AND it must be formated in nix style with using slashes instead of windows back slashes. So, the new setting ended up being:

sites/mydomain.com/files

Would be nice and would help others that are running windows if they added a small tid bit on the screen that the file system path must use forward slashes. (The instructions for making the path Relative to the drupal install directory [if directory is public] is actually already there right under the field entry. (I simply ignored reading that part)

Hopefully this may help someone else someday if they run into the same problem I had.

- Dave

vkr11’s picture

goose2000’s picture

I know this an old post...

Doood, thank you for the QA in this windows / drupal crunch the CSS stuff. I ran into it today. The day before I turned it on and all looked good. Of course it did, cause most everything was cached on my client and I walk away.

Then I got a call, um you know. And looked at it and was like oh man what the hell? Then I remembered the switch I threw and undid the CSS compress. Problem went away but I was still very puzzled about why it was not working.

Thanks.

xjessie007’s picture

I would like to turn the Aggregate and compress css files feature on in my installation, but it is disabled by default. I can't check the Enabled radio button because it is grayed out with the Disabled checked. Would anyone know why it is so in my case, and what am I missing, please?

Thanks much.

---------
www.Maxi-Pedia.com Maxi-Pedia: Your resource for finance and IT!
www.Maxi-Pedia.com/forum Maxi-Pedia Forum: Your place to discuss finance and IT!
www.finance-management.cz Central European Center for Finance and Management

xjessie007’s picture

Ooops, I found the answer.

Download method is set to private

Just on the side for those following in my foot steps :) -- It looks like changing the download method from private to public can become a major hassle, see this post: http://drupal.org/node/319334
(just posting it here for complete documentation purpose)

---------
www.Maxi-Pedia.com Maxi-Pedia: Your resource for finance and IT!
www.Maxi-Pedia.com/forum Maxi-Pedia Forum: Your place to discuss finance and IT!
www.finance-management.cz Central European Center for Finance and Management

gafir777’s picture

Same problem here. I've tried what seems to be everything. Caching works, page compression works, block caching works. Everything except css and js compression because, as it seems, IIS can't generate these files... I always get the white screen of death and have to import a database backup to have it working again... Another thing that seems not to work on IIS 6 is the globalredirect module. It gives redirect loops.

petarb’s picture

After much trial and error, and testing on multiple hosting platforms, I now just leave CSS and JS compression alone on WINDOWS hosting. Linux seems never to give any issues, but any of my clients Drupal sites on Windows are headaches when it comes to CSS and JS compression. Just leave it alone if you're on a Windows platform!

deveismax’s picture

After spending nights of debugging my installation on the live system ( windows server 2003 with IIS 6 ) I found out that the root of all evil is the php function tempnam()
within the file.inc function drupal_tempnam

if ($filename = tempnam($wrapper->getDirectoryPath(), $prefix)) {
      return $scheme . '://' . basename($filename);
    }

tempnam according to php.net notes:

Prior to PHP 4.0.6, the behaviour of the tempnam() function was system dependent. On Windows the TMP environment variable will override the dir parameter, on Linux the TMPDIR environment variable has precedence, while SVR4 will always use your dir parameter if the directory it points to exists. Consult your system documentation on the tempnam(3) function if in doubt.

In the end drupal always uses your TMP environment variable regardless of what you may have configured on your temporary directory path within drupal configuration filesystem.

My configuration is TMP = C:\Temp and my Drupal is configured to use D:\Temp which will never work out by default and throws the "File could not be saved" error.

What is also kind of confusing is the fact that generating the .htaccess file uses a different approach than the StreamWrapper... Would be nice to see the StreamWrapper class used constantly throughout the whole distribution.