Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2009
    Posts
    54
    Plugin Contributions
    0

    Default php file format?

    I've been having trouble trying to understand the differences in the php file line endings as some of my pages don't display at all.

    I opened some of the php files on my new installation using my editor in binary mode and see 0D 0D 0A at the end of every line of every file. My sever is Linux but I edit on my windows PC.

    When I edit a php file on my windows box do I make sure and save it in a Linux format before uploading it? I assume that is the correct way to do it?

    Do I need to run a utility and replace those 0D 0D 0A chars with just 0A to make them all Linux compatible php files?

    And finally what is that format where each line ends with 0D 0D 0A?

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,268
    Plugin Contributions
    3

    Default Re: php file format?

    1. Port php files in FTP ASCII mode.
    2. Edit ONLY using a plain text editor (notepad++ or Crimson Editor - both free on the www).
    3. 0D 0D 0A - - - no idea where these came from...
    20 years a Zencart User

  3. #3
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,755
    Plugin Contributions
    9

    Default Re: php file format?

    What and how are you accessing/opening these files???

    Recommend that you use FTP to download files to your local, open them with a PLAIN text editor like notepad, make any edits, Save and FTP back to your server, Do it this way only as a policy.

    There should be no spurious characters as you have posted.
    Files are all in clear text.

  4. #4
    Join Date
    Jan 2009
    Posts
    54
    Plugin Contributions
    0

    Default Re: php file format?

    I used TextPad to open the file because it has a binary mode and I wanted to see what the extra char was at the end of each line. So TextPad showed the 0D 0D 0A chars at the end of each line.

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,268
    Plugin Contributions
    3

    Default Re: php file format?

    The process for editing php is quite simple.

    1. Send php files back and forth using FTP in ASCII MODE (not binary). You should be using a proper FTP tool for this, and Filezilla (free on the www) is suggested. I use WS-FTP Professional (commercially available at about $50).

    2. Don't use TextPad to edit. This program may contain formatting features that will corrupt the file.

    3. Either use a dedicated professional PHP editor, or a PLAIN TEXT editor such as notepad++ or Crimson Editor. (Notepad++ and Crimson are freeware.)
    20 years a Zencart User

 

 

Similar Threads

  1. Fatal Error: Incompatible File Format in m1_loader.php
    By badmunchkin in forum All Other Contributions/Addons
    Replies: 8
    Last Post: 8 Aug 2011, 01:11 AM
  2. contribution file format?
    By mersonmathew in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 4 Nov 2007, 01:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg