Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » fopen ... failed to open stream: No error

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 5748 Views
  • Scorpiankh
    Avatar
    Community Member
    60 Posts

    fopen ... failed to open stream: No error Link to this post

    Hi I've got a website thats all but done, all I need to do is the image gallery, I'm looking at using this one ... this is my first website using SilverStripe so still figuring things out.
    I downloaded the DataobjectManager and SWFUploadField Modules and unpacked them into the root folder as instructed, ran dev/build (tried db/build too with the same result) and i'm getting the following:

    Warning] fopen(C:\Windows\TEMP\/silverstripe-cacheC--Users-Krissy-Work-Web-wamp-www-Kenpo-silverstripe-v2.3.4/manifestClassParse-C__Users_Krissy_Work_Web_wamp_www_Kenpo_silverstripe-v2.3.4_modules-dataobject_manager-r371_code_simple_html_editor_field_SimpleHTMLEditorField.php) [function.fopen]: failed to open stream: No error
    GET /Kenpo/silverstripe-v2.3.4/dev/build

    Line 398 in C:\Users\Krissy\Work\Web\wamp\www\Kenpo\silverstripe-v2.3.4\sapphire\core\ManifestBuilder.php
    Source

    389       $parseCacheFile = TEMP_FOLDER . "/manifestClassParse-" . str_replace(array("/",":", "\\"),"_", realpath($filename));
    390       if(!file_exists($parseCacheFile) || filemtime($parseCacheFile) < filemtime($filename)) {
    391          $tokens = token_get_all($file);
    392          $classes = self::getClassDefParser()->findAll($tokens);
    393          $interfaces = self::getInterfaceDefParser()->findAll($tokens);
    394          
    395          $cacheContent = '<?php
    396             $classes = ' . var_export($classes,true) . ';
    397             $interfaces = ' . var_export($interfaces,true) . ';';
    398          if($fh = fopen($parseCacheFile,'w')) {
    399             fwrite($fh, $cacheContent);
    400             fclose($fh);
    401          }
    402          
    403       } else {
    404          include($parseCacheFile);

    Trace

    * fopen(C:\Windows\TEMP\/silverstripe-cacheC--Users-Krissy-Work-Web-wamp-www-Kenpo-silverstripe-v2.3.4/manifestClassParse-C__Users_Krissy_Work_Web_wamp_www_Kenpo_silverstripe-v2.3.4_modules-dataobject_manager-r371_code_simple_html_editor_field_SimpleHTMLEditorField.php,w)
    Line 398 of ManifestBuilder.php
    * ManifestBuilder::parse_file(C:/Users/Krissy/Work/Web/wamp/www/Kenpo/silverstripe-v2.3.4/modules-dataobject_manager-r371/code/simple_html_editor_field/SimpleHTMLEditorField.php)
    Line 348 of ManifestBuilder.php
    * ManifestBuilder::allClasses(Array)
    Line 213 of ManifestBuilder.php
    * ManifestBuilder::get_manifest_info(C:/Users/Krissy/Work/Web/wamp/www/Kenpo/silverstripe-v2.3.4,Array)
    Line 98 of ManifestBuilder.php
    * ManifestBuilder::create_manifest_file()
    Line 89 of DatabaseAdmin.php
    * DatabaseAdmin->build()
    Line 135 of DevelopmentAdmin.php
    * DevelopmentAdmin->build(HTTPRequest)
    Line 129 of RequestHandler.php
    * RequestHandler->handleRequest(HTTPRequest)
    Line 119 of Controller.php
    * Controller->handleRequest(HTTPRequest)
    Line 277 of Director.php
    * Director::handleRequest(HTTPRequest,Session)
    Line 121 of Director.php
    * Director::direct(/dev/build)
    Line 118 of main.php

    Can anyone point me in the right direction of what the problem is and how to fix it ?
    I'm using Silverstripe version 2.3.4 running on WAMP server version 2.0.

    Thanks

  • UncleCheese
    Avatar
    4085 Posts

    Re: fopen ... failed to open stream: No error Link to this post

    Looks like a permissions issue to me. fopen() needs that file to be writable. Also, I would just do a sanity check and make sure the file exists, as well.

  • Scorpiankh
    Avatar
    Community Member
    60 Posts

    Re: fopen ... failed to open stream: No error Link to this post

    Hey thanks for the reply. How do I check permissions? And what exactly am I checking permissions on?
    I had a look for the file C:\Windows\TEMP\/silverstripe-cacheC--Users-Krissy-Work-Web-wamp-www-Kenpo-silverstripe-v2.3.4/manifestClassParse-C__Users_Krissy_Work_Web_wamp_www_Kenpo_silverstripe-v2.3.4_modules-dataobject_manager-r371_code_simple_html_editor_field_SimpleHTMLEditorField.php that comes up in the error and it appears it does not exist.
    As far as I can gather the manifestbuilder.php file is supposed to create that file when you dev/build .. am I right?

  • UncleCheese
    Avatar
    4085 Posts

    Re: fopen ... failed to open stream: No error Link to this post

    Well just for testing, you can open up your whole web root to 777. That should eliminate any questions.

  • Scorpiankh
    Avatar
    Community Member
    60 Posts

    Re: fopen ... failed to open stream: No error Link to this post

    Using wamp server on localhost so I can't use chmod permissions, have made sure all the 'read-only' boxes are unchecked in the file properties but that didn't help. Are there any other permission settings hidden somewhere?

  • Scorpiankh
    Avatar
    Community Member
    60 Posts

    Re: fopen ... failed to open stream: No error Link to this post

    I just noticed the filepath in the error has a combination of forward and back slashes in it, could that be the problem? and if so how would i go about fixing that?

  • Scorpiankh
    Avatar
    Community Member
    60 Posts

    Re: fopen ... failed to open stream: No error Link to this post

    All the permissions seem to be fine, and have looked through the cache files and it's written half the files there for the dataobjectmanager so permissions don't seem to be the issue. Still getting the exact same error tho.
    Any help would be apprecated.

  • UncleCheese
    Avatar
    4085 Posts

    Re: fopen ... failed to open stream: No error Link to this post

    Yeah, I had a client report this issue, and I tracked it down to the failed write to the /tmp/ dir. You can test it by putting SWFUpload in debug mode, and editing /sapphire/filesystem/Upload.php:

    Line 85 (in 2.3.6)

          if(!$tmpFile['size']) {
    die(print_r($tmpFile));
             $this->errors[] = _t('File.NOFILESIZE', 'Filesize is zero bytes.');
             return false;
          }

    After an upload, you'll see the alert message come up with the output of the $tmpFile resource, including error #7, which is UPLOAD_ERR_CANT_WRITE.

    5748 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.