程序员最近都爱上了这个网站  程序员们快来瞅瞅吧!  it98k网:it98k.com

本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长

+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

PHP Formatting After FTP Upload

发布于2023-01-19 10:05     阅读(1117)     评论(0)     点赞(21)     收藏(3)


Why are PHP files I am uploading via FTP losing their formatting?

I create the files in notepad++ and upload via FileZilla to HostGator.

The file looks like this in notepad..

The file looks like this in vi on the server..

I've tried uploading the same file using Auto and Binary, neither worked.

All other files on the server that I did not create from scratch in notepad++ appear fine in vi. With that being said I've created many scripts from scratch in notepad++ and have never had this issue before.

--- edit ---

solution: change end of line to UNIX/OSX format in Notepad++

Screenshot from Notepad++


解决方案


Different operating systems use different coding of linebreaks.

Namely MS-Windows uses "\r\n", whilst all unixoid systems (so also Linux) use "\n".

Nothing is "lost" during the transfer, but the code is interpreted different by the server side editor. There are settings in each editor to control that behavior.



所属网站分类: 技术文章 > 问答

作者:黑洞官方问答小能手

链接:http://www.phpheidong.com/blog/article/476299/cfbe23af02f6075e867d/

来源:php黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

21 0
收藏该文
已收藏

评论内容:(最多支持255个字符)