+ Reply to Thread
Results 1 to 9 of 9

Thread: parse error in php

  1. #1
    Code Warrior
    /////////|||||\\\\\\\\\
    amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama's Avatar
    Join Date
    Aug 2007
    Location
    Pyramids st, Giza, Egypt
    Age
    21
    Posts
    8,182
    Blog Entries
    12

    parse error in php

    hi people
    this is very urgent
    ive written a php script on ubuntu and it works fine on it
    but when i try to put the files on windows apache server i get parse error
    when i open the file i find it pretty missed up with alot of lines in the same line
    please anyone help me!!

  2. #2
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    36
    Posts
    11,686
    Blog Entries
    57

    Re: parse error in php

    Sounds like you're running afoul of the difference between how the two platforms save newline characters: x0A vs x0Ax0D. Try opening it in wordpad, jedit, or crimsoneditor.
    CodeCall Blog | CodeCall Wiki | Shareware
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  3. #3
    Code Warrior
    /////////|||||\\\\\\\\\
    amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama's Avatar
    Join Date
    Aug 2007
    Location
    Pyramids st, Giza, Egypt
    Age
    21
    Posts
    8,182
    Blog Entries
    12

    Re: parse error in php

    i did that shortly after the first post, i used a small application to convert it. now the file looks normal with lines and correct format..but i have the same error arse error at the final linePosted via CodeCall Mobile

  4. #4
    Co-Administrator John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John's Avatar
    Join Date
    Jul 2006
    Age
    21
    Posts
    5,885
    Blog Entries
    25

    Re: parse error in php

    This question is impossible to answer. Either post the code, or the kind of parse error you are getting, or if you want the correct answer, post both.

    unexpected T_STRING? unexpected T_VARIABLE? unexpected T_CONST? unexpected END? unexpected T_IF? The list of parse errors goes on...

  5. #5
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,556
    Blog Entries
    97

    Re: parse error in php

    You could use this:

    Code:
    sudo apt-get install tofrodos
    then
    Code:
    unix2dos <phpfile>.php
    You can also do "dos2unix". At work on our Redhat machines I have to convert all of my PHP code because of this.

  6. #6
    Code Warrior
    /////////|||||\\\\\\\\\
    amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama is a splendid one to behold amrosama's Avatar
    Join Date
    Aug 2007
    Location
    Pyramids st, Giza, Egypt
    Age
    21
    Posts
    8,182
    Blog Entries
    12

    Re: parse error in php

    tried that still doesnt work
    but i used todos.exe from windows ill try this one from ubuntu and see what happens
    thnx

  7. #7
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,556
    Blog Entries
    97

    Re: parse error in php

    Odd error, if it works in one it should work in the other. Are they different PHP versions?

  8. #8
    Co-Administrator John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John is a glorious beacon of light John's Avatar
    Join Date
    Jul 2006
    Age
    21
    Posts
    5,885
    Blog Entries
    25

    Re: parse error in php

    Quote Originally Posted by Jordan View Post
    Odd error, if it works in one it should work in the other. Are they different PHP versions?
    Not really, many functions need to be handled with special care under Windows. fopen(), stat(), mail() immediately come to mind. But I'm not going to guess what the problem could be, when the code and the line number which is causing the error could be posted.

  9. #9
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,556
    Blog Entries
    97

    Re: parse error in php

    nonetheless, in regards to a syntax error, it should work on both the same.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. PHP 5 and OOP
    By Jordan in forum PHP Tutorials
    Replies: 11
    Last Post: 09-22-2008, 01:58 AM
  2. PHP 4 end of life announcement
    By Jordan in forum News
    Replies: 4
    Last Post: 08-30-2007, 09:55 AM
  3. can someone help me with my c librarys?
    By bobwrit in forum C and C++
    Replies: 4
    Last Post: 04-27-2007, 06:19 PM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

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