1
votes

Hi have uploaded a PHP file on the server. When reaching that url using a browser, for example

mysite.com/test.php

I see the code (content) of the PHP file and the script seems not running.

SERVER IS F5 BIG-IP Apache

Could you point me out what could be the error?

<?php

$url = rawurldecode($_GET['proxy_url']);
$cb = ! empty($_GET['callback']) ? $_GET['callback'] : null;

if(preg_match('#xxx\.xxx\.com/xxx/#', $url)){
    $url = preg_replace('#http\://xxx\.xxx\.com/xxx/#', '', $url);
}

if(! preg_match('#^https?:#', $url)){
    $url = preg_replace('#^[\.\/]+#', '', $url);

    if(!file_exists($url)){
        echo 'File not found';
        die(0);
    }
}

if(preg_match('#\.xml$#', $url)){
    header('Content-type: text/xml');
}

$file = file_get_contents($url);

if($cb){
    header('Content-type: application/javascript');
    echo $cb.'('.$file.');';

}else{
    echo $file;
}
3
Server does not support PHP.Muhammad Talha Akbar
What code did you post? Did it start with <?php?Jezen Thomas
See that entire list of dupes -->PeeHaa
Better you post some code here.Sarang
seems like your server is not configure to process php. What server do you use?Bojan Kovacevic

3 Answers

0
votes

Have you installed PHP? - If so do the following:

  1. Start off by trying a simple script - call it say info.php:

  2. Ensure (assuming Apache) that you have it the web server configured - see http://php.net/manual/en/install.php

If all this works then there is a problem with the script.

0
votes

close php tag and check does server support php

0
votes

Your server is not setup to parse PHP scripts, check that it has PHP installed