Comments (12)
PS: Tested on Windows 7 64bit, Apache 2.2.21 from the Apache lounge and PHP 5.3.8
from h5ai.
Just to make sure... did you try to clear your browser cache already? The caching rules I set are very.. 'extrem'
from h5ai.
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.
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.
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.
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.
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.
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.
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.
OK, I've been looking into this tonight.
It seems the problems under Windows come from:
-
There are multiple places dealing with paths where '/' is used instead of DIRECTORY_SEPARATOR. [FIXED].
-
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] -
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.
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.
ok, i'm closing this because all the patches are now in issue #32
from h5ai.
Related Issues (20)
- trailing slashes on img tags now cause HTML5 validation failure
- support for sending HTTP "last-modified" header based on directory modification date?
- errors when moving from PHP 7.4 to 8.1 HOT 2
- how can I extern this function? send file to kindle.
- Only displays info page (apache2 behind nginx)
- NGINX permissions? HOT 2
- TS Stream file request
- adding non-compressed-ZIP-Option for downloading directories
- Upgrade Failure on Yunohost HOT 1
- Not working with php local server? HOT 2
- info page - cannot use passhash HOT 1
- Make h5ai stop redirect to root HOT 2
- PHP error if request is received with no user-agent header
- Show text under content menu if text file is named X (Like README.md here on github) HOT 4
- (Request) Add sketchfab's 3d-viewer support for 3D models HOT 1
- Skip root-directory in index listing HOT 3
- Click the download button, unable to download files. The download file has been renamed as: Download.html
- Dead project? HOT 3
- Search API
- utf case sensitive?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h5ai.