Labels

css (1) jQuery (7) linux (38) mac (70) php (29) python (1) svn/git (9) trac (4) ubuntu (1) virtualbox (6) vista (2) windows (14)

Monday, 30 May 2011

Internet explorer 8 and below, files won't download over https

If you get "unable to download file, unable to connect to site" errors when trying to download via IE < 8 and you're using a secure connection (https) you've probably been bitten by http://support.microsoft.com/kb/323308 if you're a web server/app admin like myself and your site is doing this, add the following headers

Pragma: public;
Cache-Control: 60;
Expires: 60;

Those allow caching for 60 seconds, apparently IE caches files in the temporary internet files and if the headers aren't there it doesn't cache so fails to download.

To be honest you probably only need Pragma: public; 

Sunday, 22 May 2011

Changing drupal tmp path

If you need to change the drupal tmp path, set the TMPDIR environment variable in PHP and update the variables table in your database setting the key named 'file_directory_temp' to the serialized string of your new tmp path.

Alternatively to setting the TMPDIR in PHP you can set it in your web server and restart your web server and PHP.

Tuesday, 17 May 2011

PHP Constructors

Note to self, PHP classes with namespaces before 5.3.3 any method with the same name as the class is considered a constructor (see http://php.net/manual/en/language.oop5.decon.php)

Friday, 6 May 2011

NFS mount no such file or directory

If you get the error
Reason given by server:
No such file or directory
When trying to mount a nfs directory and it does exist, add fsid=0 (or whatever the id of your drive is) to your /etc/exports configuration.

Also remember that the path you mount remotely may not be the same as the one you have in exports i.e.

If your exports contains
/home/user/
/home/user/downloads

Then you would mount / to get /home/user and  /downloads to get /home/user/downloads/