Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Oct 2002
    Posts
    216

    Default cpanelphp adds a line?

    I'm trying to do a skin in php. Apparently, a blank line is put before the beginning, so a header() won't work. I've looked at the wrapper, but can't make it do what I want... plus it will be overwritten on update.
    Does anyone else experience this?

  2. #2
    Member
    Join Date
    Sep 2001
    Location
    Spain
    Posts
    779

    Default

    Yes it's a problem in cpanelphp, but I don't see how you could solve it without modifying it.

    The problem is here:

    my $top = 5;
    my $cont = 0;
    foreach $line (@cpanel) {
    my $dont = 0;
    if ($top > 0) {
    if ($line =~ /:/i) {
    $dont = 1;
    }
    $top--;
    }
    unless ($dont) { print TMP $line; }
    }

    Instead of looking for lines containing the ':' character, you may just skip until the empty line which separates the HTTP headers from the body and copy from there on.

    my $copy = 0;
    foreach (@cpanel) {
    if ($copy) { print TMP; }
    elsif (/^\s*$/) { $copy = 1; }
    }

  3. #3
    Member
    Join Date
    Oct 2002
    Posts
    216

    Default

    Thanks-
    Now can we get this in the edge version so it will not change this file? I know I can chattr it, but what if it really needs to be upgraded.

Similar Threads & Tags
Similar threads

  1. Replies: 1
    Last Post: 07-04-2011, 02:10 AM
  2. Replies: 1
    Last Post: 10-13-2005, 10:33 AM
  3. /scripts/cpbackup line 399, <PWCACHEENT> line 28.
    By demomen in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 06-30-2005, 05:48 AM
  4. Uploading a PHP file, cPanel adds line of gobbly guk to top of file
    By railx in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 09-12-2004, 11:09 PM
  5. Creating user via command line adds CPanel account!
    By UraniumWeb in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-06-2004, 11:15 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube