Opened 17 years ago

Closed 17 years ago

#2124 closed Bug (fixed)

Path problem under Windows

Reported by: GaborToth Owned by:
Priority: Normal Milestone: FCKeditor 2.6.1
Component: Server : PHP Version:
Keywords: Confirmed HasPatch Cc:

Description

Hello!

I noticed that FCKeditor's PHP Connector doesn't work under Windows. Linux is work as expected.

The problem is in io.php file on line 156: $sRealPath = realpath( './' ) ;

Under windows $sRealPath will be "c:\....\editor\filemanager\connectors\php\".

That last backslash is the problem, it doesn't appear on linux systems. Thats why line 168

if ( $position === false
$position <> strlen( $sRealPath ) - strlen( $sSelfPath ) ) is true.

I suggest to change this:

$sRealPath = realpath( './' ) ;

to

$sRealPath = realpath( '.' ) ;

On linux systems these calls are equivalent, but under windows second one would work as expected.

Attachments (2)

2124.patch (1.1 KB) - added by Wiktor Walc 17 years ago.
2124_1.patch (542 bytes) - added by Wiktor Walc 17 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 17 years ago by Wojciech Olchawa

Keywords: Pending WorksForMe added; php windows path removed
Milestone: FCKeditor 2.6.1

Could you please specify what server on Windows are you using (Apache , IIS , something else)? Have you encountered problems with uploading while using the php connector? In my case it works fine using Apache 1.6.4 on Windows XP.

comment:2 Changed 17 years ago by GaborToth

My Windows system:

Vista business with Zend Core:

Zend Core Version 2.5.0

PHP Version 5.2.4

Zend Engine Version 2.2.0

Server API cgi-fcgi

Server Software Apache/2.2.4 (Win32)

Yes, I tried both uploading files and the provided test.html under /editor/filemanager/connectors/ directory.

It writes "Sorry, can't map "UserFilesPath" to a physical path. You must set the "UserFilesAbsolutePath" value in "editor/filemanager/connectors/php/config.php"

comment:3 Changed 17 years ago by Wiktor Walc

Keywords: Confirmed HasPatch added; Pending WorksForMe removed
Milestone: FCKeditor 2.6.1

Changed 17 years ago by Wiktor Walc

Attachment: 2124.patch added

comment:4 Changed 17 years ago by Wiktor Walc

Resolution: fixed
Status: newclosed

Fixed with [1942].

comment:5 Changed 17 years ago by Alfonso Martínez de Lizarrondo

Resolution: fixed
Status: closedreopened

I've uploaded a nightly to my server at http://martinezdelizarrondo.com/easyupload/ and it did raise an error stating that it couldn't create the folder, removing this change did fix the issue, so I guess that it should be reviewed better as more people might face the same problem.

comment:6 Changed 17 years ago by Wiktor Walc

Interesting... could you create a script with phpinfo() command and post a link to it? What are your settings in config.php? What are the permissions to each directory (to the target directory and all directories above)?

Sorry for all those questions but it works fine on my test servers.

comment:7 Changed 17 years ago by Alfonso Martínez de Lizarrondo

This is the link to phpinfo(): http://www.martinezdelizarrondo.com/wiktor.php

The php connector is just the default, with this patch removed and the patch to fix the quickupload problem applied. And of course a nice $Config['Enabled'] = true ;

The permissions to /html/userfiles is 777 and its parent (root of the public web) /html/ is 750

Changed 17 years ago by Wiktor Walc

Attachment: 2124_1.patch added

comment:8 Changed 17 years ago by Wiktor Walc

Resolution: fixed
Status: reopenedclosed

Fixed with [1998]. During tests I focused on windows servers and completely missed that I used wrong function to strip character only at the end of string. The correct funstion is of course rtrim.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy