Closed Thread
Results 1 to 9 of 9

Thread: parse error in php

  1. #1
    Join Date
    Aug 2007
    Location
    Gizeh, Al Jizah, Egypt, Egypt
    Posts
    8,675
    Blog Entries
    12
    Rep Power
    81

    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!!
    yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
    Code:
    eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
    www.amrosama.com | the unholy methods of javascript

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,475
    Blog Entries
    75
    Rep Power
    143

    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.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    Join Date
    Aug 2007
    Location
    Gizeh, Al Jizah, Egypt, Egypt
    Posts
    8,675
    Blog Entries
    12
    Rep Power
    81

    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

  5. #4
    Join Date
    Jul 2006
    Location
    Amherst, New York, United States
    Posts
    6,277
    Blog Entries
    26
    Rep Power
    20

    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...

  6. #5
    Jordan Guest

    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.

  7. #6
    Join Date
    Aug 2007
    Location
    Gizeh, Al Jizah, Egypt, Egypt
    Posts
    8,675
    Blog Entries
    12
    Rep Power
    81

    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
    yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
    Code:
    eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
    www.amrosama.com | the unholy methods of javascript

  8. #7
    Jordan Guest

    Re: parse error in php

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

  9. #8
    Join Date
    Jul 2006
    Location
    Amherst, New York, United States
    Posts
    6,277
    Blog Entries
    26
    Rep Power
    20

    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.

  10. #9
    Jordan Guest

    Re: parse error in php

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

Closed Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. parse error in php
    By ravi951 in forum PHP Development
    Replies: 2
    Last Post: 09-20-2011, 10:30 PM
  2. Logic error in C hex parse program
    By indigo in forum C and C++
    Replies: 4
    Last Post: 09-14-2010, 09:44 AM
  3. [help]Parse error: syntax error, unexpected $end
    By kiddies in forum PHP Development
    Replies: 3
    Last Post: 07-18-2010, 02:58 PM
  4. PHP Parse Error
    By crd06c in forum PHP Development
    Replies: 3
    Last Post: 08-23-2009, 07:23 AM
  5. Can't figure out this parse error
    By jackolantern in forum PHP Development
    Replies: 3
    Last Post: 08-09-2009, 03:02 PM

Tags for this Thread

Bookmarks

Posting Permissions

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