Ticket #2124 (closed Bug: fixed)

Opened 6 months ago

Last modified 5 months ago

Path problem under Windows

Reported by: tgabi333 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

2124.patch (1.1 kB) - added by wwalc 6 months ago.
2124_1.patch (0.5 kB) - added by wwalc 5 months ago.

Change History

Changed 6 months ago by w.olchawa

  • keywords Pending WorksForMe added; php windows path removed
  • milestone deleted

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.

Changed 6 months ago by tgabi333

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"

Changed 6 months ago by wwalc

  • keywords Confirmed HasPatch added; Pending WorksForMe removed
  • milestone set to FCKeditor 2.6.1

Changed 6 months ago by wwalc

Changed 6 months ago by wwalc

  • status changed from new to closed
  • resolution set to fixed

Fixed with [1942].

Changed 5 months ago by alfonsoml

  • status changed from closed to reopened
  • resolution deleted

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.

Changed 5 months ago by wwalc

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.

Changed 5 months ago by alfonsoml

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 5 months ago by wwalc

Changed 5 months ago by wwalc

  • status changed from reopened to closed
  • resolution set to fixed

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.