PHP File and Editor Issues

Advertisement

Anonymous User
Guest

PHP File and Editor Issues

Running a Debian server and performing modifications to a .php script on a Windows XP environment. Opening files from WinSCP either through the internal or an external editor will display blank lines after a closing PHP statement, ?>.

I have modified end-of-file settings with no positive results. This has been tested on two different machines with the same result, with files created in multiple editors.

The issue does not seem to appear in other documents, only in documents that have a closing PHP statement in the middle of the file.

Note that copying the file to a directory and opening it locally will result in the file being displayed properly.

Is this a bug or is there a setting I have missed?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: PHP File and Editor Issues

I'm not able to reproduce this. Neither with external not internal editor. What version of WinSCP are you using? Do I understand right that the file looks like:
<?\n
code\n
code\n
?>

Reply with quote

inetbizo
Donor
Joined:
Posts:
1
Location:
Destin, FL, USA

edit files not in linux format

I've been using the internal editor and the files are not being saved in unix format but windows and therefor corrupts the linux file. I cannot find setting to make sure file is saved in unix format without windows EOF

Reply with quote

Anonymous User
Guest

Re: PHP File and Editor Issues

Sorry for the delayed response. This was attempted in both WinSCP 4.1.5 (Build 410) and WinSCP 4.1.6 (Build 412).

Yes, prikryl, what you have for the example is similar, but any addition to the end of the script will not be shown.

For example:
<?php\n
code\n
code\n
?> \n
<html here>\n
<php\n
code\n
?>

Anything that is included after the first "?>" will not be displayed in any editor if opened directly from the server through WinSCP.

Hope that clarifies.

Reply with quote

Anonymous User
Guest

Re: PHP File and Editor Issues

One more bit of clarification: It is not necessarily HTML or other PHP scripts that do not display - any text entered after the closing tag is 'truncated', but the whitespace and number of lines are both retained.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: PHP File and Editor Issues

Please download the file using binary mode to your local machine, archive it (e.g. to ZIP file) and send it to my email. Thanks. You may also try to reupload the file back under the different name and verify the the problem still appears, so I should be able to reproduce the problem on my system. Also what is your server? FTP/SCP/SFTP? What OS?

Reply with quote

martin
Site Admin
martin avatar

Re: PHP File and Editor Issues

For tracking: The problem is caused by bug in ascii transfers in MySecureShell.

Reply with quote

Advertisement

You can post new topics in this forum