Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    2

    Default empty lines added into .php files

    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. #2
    Registered User
    Join Date
    Jul 2003
    Posts
    2

    Default

    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. #3
    Member
    Join Date
    Jun 2003
    Location
    Miami, Florida
    Posts
    34

    Default Re: empty lines added into .php files

    Originally posted by jifu
    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:
    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:http://www.foo.com/index.php");
    ?>
    cPanel.net Support Ticket Number:

    cPanel.net Support Ticket Number:

    cPanel.net Support Ticket Number:

Similar Threads & Tags
Similar threads

  1. All my files got added .gz extension Help
    By focus72050 in forum Data Protection
    Replies: 2
    Last Post: 09-03-2009, 01:26 AM
  2. Horde - Always Attached Files are empty
    By minotauro in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 04-23-2008, 03:03 PM
  3. log files are empty
    By iCARus in forum cPanel and WHM Discussions
    Replies: 20
    Last Post: 02-06-2006, 03:40 AM
  4. Create New account What files added?
    By fxcops in forum Data Protection
    Replies: 1
    Last Post: 03-18-2005, 03:30 AM
  5. Processed 0 lines 0 in files [Webalizer] this problem no have end?
    By Dattatec in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 05-05-2003, 06:10 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube