This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | ftp upload of PHP script or other text files creates control M or char(13) characters when uploaded to UNIX or LINUX target | ||
---|---|---|---|
Product: | php | Reporter: | fcastro7 |
Component: | FTP Support | Assignee: | Tomas Mysik <tmysik> |
Status: | REOPENED --- | ||
Severity: | normal | CC: | fzamboj, JerryWho, tmysik |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Attachments: |
PHP file
php-File with shebang and Windows line-endings |
Description
fcastro7
2010-06-03 14:03:16 UTC
Created attachment 99789 [details]
PHP file
Well, NetBeans transfers all files using BINARY mode. I would create perhaps a new PHP Options panel (in Tools > Options > PHP) where one could specify which file extensions should be transfered in ASCII mode (candidates are php, phtml, js, css, html). Any objections? BTW it means that the settings will be common for all the PHP projects - maybe we could create such panel for every PHP project so one can specify different file extensions for different PHP projects. Would this makes sense? (In reply to comment #3) > BTW it means that the settings will be common for all the PHP projects - maybe > we could create such panel for every PHP project so one can specify different > file extensions for different PHP projects. > > Would this makes sense? would make sense IMO (trying to reproduce but having troubles after ubuntu upgrade :(( ) (In reply to comment #4) > (trying to reproduce but having troubles after ubuntu upgrade :(( ) Before any changes, we need to be sure that it is really broken otherwise there won't be any benefit from the change; so please, try to reproduce, I will try as well (on Monday). Thanks. (In reply to comment #5) > (In reply to comment #4) > > (trying to reproduce but having troubles after ubuntu upgrade :(( ) > > Before any changes, we need to be sure that it is really broken otherwise there > won't be any benefit from the change; so please, try to reproduce, I will try > as well (on Monday). > > Thanks. understood. Product Version: NetBeans IDE Dev (Build 2010-06-06_03-03-36 ) Java: 1.6.0_14-ea; Java HotSpot(TM) Client VM 14.0-b12 System: Windows Vista version 6.0 running on x86; Cp1250; cs_CZ (nb) Userdir: C:\Users\felipee\.netbeans\dev I cannot reproduce reported problem. Configuration: source: WIN Vista Target: Ubuntu - Karmic Koala Files with windows endings were successfully run and uploaded from WIN to LIN. There was no problem with files endings. I'd say it's a problem in ftp configuration of reporter's target server. I doubt apache can't parse files with windows endings when running on linux machine and I didn't find any unusual netbeans ftp client behaviour. I'm closing as worksforme. However, reporter, could you upload file that becomes corrupted on server (in some compressed form)? Thanks a lot. Created attachment 102010 [details] php-File with shebang and Windows line-endings The attached file gives the following error on a linux machine when invoked (as a shell skript): > ./test.php -bash: ./test.php: /usr/local/bin/php^M: bad interpreter: Datei oder Verzeichnis nicht gefunden As you can see it's relevant to change line endings via ftp. Therefor I would like to reopen the bug. batch reassigning Batch reassigning. (In reply to comment #8) > > ./test.php > -bash: ./test.php: /usr/local/bin/php^M: bad interpreter: Datei oder > Verzeichnis nicht gefunden > > As you can see it's relevant to change line endings via ftp. Therefor I would > like to reopen the bug. Well, not exactly - this is not a problem of a PHP script, it is a problem of shell interpreter (I mean that php-cli would run this file without any error, the problem is that operating system cannot find the interpreter); anyway, if NetBeans would change line endings, it would cause more serious errors (for all binary files like ZIP, PDF, images etc.). BTW in your particular case, the error is already in your file on your computer and it is likely caused by the changed line-ending (at least I guess so since the file was likely created on *nix or is definitely supposed to run on it but contains Windows line-ending, moreover in the line where the shell interpreter is defined). So, I don't think we should change the current behavior (the same from NetBeans 6.5), feel free to reopen if you disagree. Thanks for reporting. Yes, you can blame the different line endings for the error they are causing. But I think the solution exists in the ftp-protocol: There is the posibility to switch between binary and ascii mode. The first one won't change anything in the transferred file. So this would be the correct mode for images and so on. The latter mode will change line endings so you can use always the native line endings on both sides of the transfer. So my preferred solution would contain the possibility to choose file-extensions which are transfered in ascii mode (such as .php, .sh, .css, .html, ...). Any other files are transferred in binary mode. That's the behaviour of any traditional ftp-client. E.g. filezilla: http://filezilla-project.org/images/screenshots/fz3_win_settings.png Transfer->File types. Agreed, however adding configuration for FTP transfer modes is more enhancement than a bug. |