1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

Strange PHP 4.4.1 problem (previously declared...)

Discussion in 'Plesk for Linux - 8.x and Older' started by Eijkb, Jan 10, 2006.

  1. Eijkb

    Eijkb Guest

    0
     
    PSA: 7.5.4
    HTTP: 2.0.53
    PHP: 4.4.1

    Description:
    A dedicated client has several sites on his server, all running the CJ Overkill script for linktrading.

    All different sites are host on different vhosts

    Problem:
    Output log from "smatjes.com" ->

    [Tue Jan 10 11:48:08 2006] [error] [client 80.201.111.181] PHP Fatal error: Cannot redeclare cjoverkill_connect() (previously declared in /var/www/vhosts/paardenlullen.com/httpdocs/cj-functions.inc.php:13) in /var/www/vhosts/smatjes.com/httpdocs/cj-functions.inc.php on line 12

    Question:
    How is it possible that a function declared within a file on smatjes.com is crashing with the (same) function declared within a file on paardenlullen.com? That shouldn't be possible between different vhosts?

    Anyone a solution?
     
  2. spandox

    spandox Guest

    0
     
    I would check to see if other PHP scripts aren't calling (or more likely 'requiring' or 'including') eachother.

    If he has two copies the files and includes files from smatjes.com in paardenlullen.com things would normally be fine (assuming open_basedir)

    The problem comes up if he (probably in another file) includes a duplicate of the function declaration - there is a problem.

    My theory as to what is happening:

    file A includes file B in "cj-functions.inc.php" in "smatjes.com", it either: also includes "cj-functions.inc.php" itself or another files that does

    OR

    File B requires other files that have a require_once File B - becuase of the search path of the include it ends up finding a different file.

    I am a shell guy - sorry but I am
    I would check the files with a quick grep command:

    Code:
    grep -rsi  paardenlullen /var/www/vhosts/smatjes.com/httpdocs/
    and see what you get. I bet it is in an include or a require.....if not look in the vhost.conf and see if he added it to his basedir
     
  3. Eijkb

    Eijkb Guest

    0
     
    Thx for reply.

    grep -rsi paardenlullen /var/www/vhosts/smatjes.com/httpdocs/trade.php is not giving any output.

    I have altered /conf/vhost.conf and included an open_basedir statement, problems are solved for crossdomain problems.
     
Loading...