Git Product home page Git Product logo

Comments (12)

jorgeyanesdiez avatar jorgeyanesdiez commented on May 18, 2024

PS: Tested on Windows 7 64bit, Apache 2.2.21 from the Apache lounge and PHP 5.3.8

from h5ai.

lrsjng avatar lrsjng commented on May 18, 2024

Just to make sure... did you try to clear your browser cache already? The caching rules I set are very.. 'extrem'

from h5ai.

jorgeyanesdiez avatar jorgeyanesdiez commented on May 18, 2024

I just re-downloaded h5ai 0.17 (just in case). re-cleared the cache. No go. So time to get extreme too!
I created a new virtual machine. Installed the latest firefox, opera and chrome. Installed apache 2.2.21/php 5.3.8 from scratch. It still happens. I can send you all my config files if it helps. Here's a screenshot (http://i.imgur.com/tlFkW.png)

from h5ai.

lrsjng avatar lrsjng commented on May 18, 2024

To fix the javascript folder issue please add the following line to your directory's .htaccess file.. this should solve the problem..

AddIcon /icons/folder.gif ^^DIRECTORY^^

As for the PHP issue please have a look at file /_h5ai/.htaccess in your installation maybe you'll find a hint there...

from h5ai.

jorgeyanesdiez avatar jorgeyanesdiez commented on May 18, 2024

Thanks, the JS version works great with the AddIcon line. The folder even moved to the top.

As for the PHP version: Forgot to mention I had already seen the hint. Enabling any one, or all, or any other combination of the AddHandler lines isn't fixing it for me.

In case it matters: my original config maps php with the lines (as per the official PHP readme):
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

The weird thing is that 0.16 doesn't seem to have a problem with this.

from h5ai.

jorgeyanesdiez avatar jorgeyanesdiez commented on May 18, 2024

Actually, For the JS version: I had forgotten to include httpd-autoindex.conf which includes your fix. h5ai 0,16 was doing AddIcon for all the types I was using and that's why I hadn't noticed. Good to know.

from h5ai.

jorgeyanesdiez avatar jorgeyanesdiez commented on May 18, 2024

I just checked my logs. Apparently, Crumb.php is running out of memory with 8M, so i decided to increase max_mem. Here's the result (looks like a loop-of-death):

PHP Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 24 bytes) in C:\Apache2\htdocs\000-default_h5ai\php\inc\Crumb.php on line 14
PHP Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 24 bytes) in C:\Apache2\htdocs\000-default_h5ai\php\inc\Crumb.php on line 14
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 35 bytes) in C:\Apache2\htdocs\000-default_h5ai\php\inc\Crumb.php on line 13
PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 35 bytes) in C:\Apache2\htdocs\000-default_h5ai\php\inc\Crumb.php on line 13
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 24 bytes) in C:\Apache2\htdocs\000-default_h5ai\php\inc\Crumb.php on line 14

from h5ai.

jorgeyanesdiez avatar jorgeyanesdiez commented on May 18, 2024

Yes, here's the issue:

    while ($href !== "/" && $href !== "//") {
        $this->parts[] = $href;
        $href = dirname($href) . "/";
    }

But on windows, dirname($href) returns "".

How about

    while ($href !== "/") {
        $this->parts[] = $href;
        $href = preg_replace('%^(.*/)(.*/)$%', '\1', $href);
    }

from h5ai.

jorgeyanesdiez avatar jorgeyanesdiez commented on May 18, 2024

Also, on tree.php line 12, the is_dir will flood with PHP warnings if open_basedir is set.
Worth changing to:
$this->isFolder = @is_dir($this->absPath);

With those two fixes, now h5ai is hanging somewhere until the php timeout is reached, and the logs show nothing :| I will xdebug it tomorrow.

EDIT: This was no longer necessary after I fixed the way Tree.php was looping using abspaths.

from h5ai.

jorgeyanesdiez avatar jorgeyanesdiez commented on May 18, 2024

OK, I've been looking into this tonight.
It seems the problems under Windows come from:

  1. There are multiple places dealing with paths where '/' is used instead of DIRECTORY_SEPARATOR. [FIXED].

  2. There's a need for separate normalizeHref() and normalizePath() functions. When normalizing paths, the regex needs to be different to account for DIRECTORY_SEPARATOR. $regexExpr = DIRECTORY_SEPARATOR === '/' ? '#/$#' : '#\\$#;
    Plus the method is always being called with the second argument === false when it's a path anyway. [FIXED]

  3. There are a few dirname() calls that need to be replaced. The h5ai class needs new methods getParentHref() and getParentPath() to replace the other calls everywhere. [TODO this week if i have time].

When it works on Windows I'll try to send you the patches :)

EDIT: Check this out, it's funny. A single backslash '' needs to be escaped in PHP so it ends up as '\'. Inside the preg() call, it needs to be doubled, so it ends up as '\\'. The github flavored markdown parser on this comment needs them doubled too. So to write the above, i had to write the backslash 8 times: '\\\\'. <- and to write this i had to do it 16 times. LOL! The marvels of Windows vs Unix and its side-effects ;)

from h5ai.

jorgeyanesdiez avatar jorgeyanesdiez commented on May 18, 2024

Ok, got it working on windows now :D I will fork ,and request a pull as soon as i can, i don't even have tortoisegit installed.

from h5ai.

jorgeyanesdiez avatar jorgeyanesdiez commented on May 18, 2024

ok, i'm closing this because all the patches are now in issue #32

from h5ai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.