Report any technical problems you discover and discuss solutions.

import/ needs to be writeable

  • cgoacher
  • Onderwerp Auteur
  • Offline
  • Junior lid
  • Junior lid
Meer
12 jaren 4 maanden geleden #1393 door cgoacher
import/ needs to be writeable werd gestart door cgoacher
Hi, I've recently had to take over our the responsibility of managing our Xerte installation and we've found an issue when trying to import templates (Previously exported from another installation as .zips) where we receive the message "import/ needs to be writeable" when clicking the 'Upload' button.

Our system runs on a Windows 2008 R2 machine with PHP 5.2.14 and IIS 7.

Looking in Windows, the import folder seems to have write and modify permissions for the Application Pool used by the website in IIS so I'm really not sure why it doesn't think it's writeable.

I was wondering if anybody had any ideas on this?

Thanks

Craig

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
12 jaren 4 maanden geleden #1394 door tom
Beantwoord door tom in topic import/ needs to be writeable
What version of XOT are you using?

I've fixed an issue with PHP on Windows 6 months ago.

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • cgoacher
  • Onderwerp Auteur
  • Offline
  • Junior lid
  • Junior lid
Meer
12 jaren 4 maanden geleden #1395 door cgoacher
Beantwoord door cgoacher in topic import/ needs to be writeable
Hi Tom,

Sorry it would probably help if I'd have included that information too!

It's version 2.0 (svn r895) according to what's on the server.

Thanks

Craig

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
12 jaren 4 maanden geleden #1396 door tom
Beantwoord door tom in topic import/ needs to be writeable
I don't know how knowledgeable you are, but the fact that you are checking the Application Pool suggest that you probably are... :-)

The PHP function is_writable is broken on Windows. I replaced it with a different function, that I can send you. But , you might consider commenting a few lines out in website_code/php/imposrt/import.php near line 736:
Code:
if(!is_writeable($xerte_toolkits_site->import_path)) { _debug("{$xerte_toolkits_site->import_path} needs to be writeable. Cannot perform import"); die("{$xerte_toolkits_site->import_path} needs to be writeable"); }

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • cgoacher
  • Onderwerp Auteur
  • Offline
  • Junior lid
  • Junior lid
Meer
12 jaren 4 maanden geleden #1411 door cgoacher
Beantwoord door cgoacher in topic import/ needs to be writeable
Thanks Tom,

Yeah I'd managed to track the issue down to that part of the code and Google had suggested that certain versions of PHP in the past had issues with that function on Windows but I wasn't sure if this may have been resolved since but I guess not.

If you do have an alternative function that we could replace this with then that would be excellent and I would be very grateful and interested to take a look.

Thanks again

Craig

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
12 jaren 4 maanden geleden #1412 door tom
Beantwoord door tom in topic import/ needs to be writeable
This is what we use (a variant of a function as suggested in the comments of the manual page of is_writable on php.net)
Code:
// Replacement function for the standard php is_writable because of bugs in Windows // // From comments on the manual page of is_writable // // Since looks like the Windows ACLs bug "wont fix" (see http://bugs.php.net/bug.php?id=27609) I propose this alternative function: // function _is_writable($path) { if (is_dir($path) || $path{strlen($path)-1}=='/') return _is_writable($path . ($path{strlen($path)-1}=='/' ? "" : "/") . uniqid(mt_rand()).'.tmp'); if (file_exists($path)) { if (!($f = @fopen($path, 'r+'))) return false; fclose($f); return true; } if (!($f = @fopen($path, 'w'))) return false; fclose($f); unlink($path); return true; }

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Moderators: ronmjultenJohnSmith
Tijd voor maken pagina: 0.138 seconden
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo