The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

empty lines added into .php files

Discussion in 'General Discussion' started by jifu, Jul 22, 2003.

  1. jifu

    jifu Registered

    Joined:
    Jul 8, 2003
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I encountered a weird problem recently
    after running /scripts/easyapache

    whenever i tried to edit a php file.
    for example: index.php

    <?php
    header('location: http://www.domain.com');
    ?>

    i have omitted the blank lines after the ?>
    but eversince the apache upgrade.
    a blank line is always added to the end of the file.

    this causes the pharse error at line 4...

    This is weird cause i have checked permissions and i used pico, filemanager edit in cpanel or even editing locally on my computer and uploading via ftp. a blank line will always be added at the end causing a line error

    anyone got a solution for this ?

    cPanel.net Support Ticket Number:
     
  2. jifu

    jifu Registered

    Joined:
    Jul 8, 2003
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    and of cuz, my versions

    WHM 7.2.0 cPanel 7.2.1-S78
    RedHat 7.3 - WHM X v2.1

    apache (1.3.28 )

    cPanel.net Support Ticket Number:
     
  3. trukfixer

    trukfixer Active Member

    Joined:
    Jun 27, 2003
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Miami, Florida
    php ignores whitespace or blank lines.. especially after the close tag.. but..
    if these scripts ran fine on php 4.3.1 and now do not on 4.3.2.. try changing the single quote to a double quote...

    might make the difference.. php stops parsing at the ?> tag.
    HOWEVER php sometimes returns a parse error at a line FOLLOWING the error.. in this case.. parse error is probably due to the single quotes....

    a blank line AFTER the close tag wont do anything.. nor will MANY blank lines..

    the issue with a parse error is somewhere between <?php and ?>

    Ive had instances where even a SQL call has caused a parse error because an array was enclosed within quotes... once quotes were removed, the code no longer had a problem.. however the header() function requires the arguments to be withing quotes, so I suggest trying double quotes instead.. for the above line at least ....
    Code:
    <?php
    header("location:[url]http://www.foo.com/index.php[/url]");
    ?>
    cPanel.net Support Ticket Number:

    cPanel.net Support Ticket Number:

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page