Rules with php files?

by mbomb
9 replies
When uploading php files with ftp, are there certain guidelines to follow or pitfalls to avoid? For the past few days I've been working to upload php files to my server, but for some reason I end up with errors. When someone helps me out and ftps from their end, it seems to work just fine.

I've been working with Filezilla and Cute FTP. What could I be doing wrong? Are my settings off? Should I be changing certain permissions? Anyone have a clue? I'm more than interested to know. Thanks.

Mike
#files #php #rules
  • Profile picture of the author Martin Avis
    If you can ftp a regular htm file and have it work, you should be able to ftp a php one. Both are simply text files.

    What are the errors that you are getting?

    Martin
    Signature
    Martin Avis publishes Kickstart Newsletter - Subscribe free at http://kickstartnewsletter.com
    {{ DiscussionBoard.errors[142628].message }}
    • Profile picture of the author ryanstreet
      are you uploading it in ASCII or binary? Make sure to upload it in binary mode.

      In FileZilla, go to Transfer >> Transfer Type >> Select Binary.

      upload your file and try again.

      Make sure to put it back to auto afterwards
      Signature
      Ryan Street
      PHP Developer Specializing in WordPress and Magento
      {{ DiscussionBoard.errors[142747].message }}
      • Profile picture of the author mbomb
        Binary mode? I thought it was supposed to be ACCII mode. Filezilla's settings are on "auto". Is binary the correct mode?

        Mike
        {{ DiscussionBoard.errors[143098].message }}
        • Profile picture of the author Neil Morgan
          A PHP file is a text file and should be uploaded using ASCII (not binary) transfer mode.

          Cheers,

          Neil
          Signature

          Easy email marketing automation without moving your lists.

          {{ DiscussionBoard.errors[144218].message }}
        • Profile picture of the author rwil02
          Originally Posted by mbomb View Post

          Binary mode? I thought it was supposed to be ACCII mode. Filezilla's settings are on "auto". Is binary the correct mode?

          Mike

          Do you edit PHP files on that computer?

          If not, FileZilla may not be able to determine that the file type is ASCII automatically. Most FTP programs will default to binary when unsure (so they don't break images, etc).
          Signature

          Roger Willcocks
          L-Space Design
          Please vote to help me win a 3kW solar array

          {{ DiscussionBoard.errors[146947].message }}
          • Profile picture of the author ryanstreet
            Sorry guys,

            Your right, i totally wrote the wrong one. I meant ASCII. Thanks for keeping me on my toes!

            ....Need More coffee...
            Signature
            Ryan Street
            PHP Developer Specializing in WordPress and Magento
            {{ DiscussionBoard.errors[147085].message }}
            • Profile picture of the author petebolduc
              What errors are you getting? PHP is a simple text transfer.

              Perhaps the script itself has an error. If it is calling for a file you have yet to upload you will get an error.

              If the host's security is set too low you will get an error as well. If the host has it set too tight it will require loose permissions to make the script work as well.

              It depends on the error. If you paste the error it would provide a better understanding of more precisely what your issue is.


              pete
              {{ DiscussionBoard.errors[148933].message }}
              • Profile picture of the author mbomb
                Apparently the FTP setting ("auto") was stripping out carriage returns. Everything is working fine now, thanks
                {{ DiscussionBoard.errors[149121].message }}
  • Profile picture of the author lightningzeus
    yes php is supposed to be in ACCII, in fact most files are supposed to be in ACCII
    uploadin in binary could break the file, and we do not want that happening
    {{ DiscussionBoard.errors[144367].message }}

Trending Topics