简体   繁体   中英

JasperServer with PHP

I tried to run a sample PHP code that comes with JasperServer. When I load index.php , I got the following message:

Deprecated: Assigning the return value of new by reference is deprecated in C:\\xampp\\php\\pear\\HTTP\\Request.php on line 412

Deprecated: Assigning the return value of new by reference is deprecated in C:\\xampp\\php\\pear\\HTTP\\Request.php on line 736

Deprecated: Assigning the return value of new by reference is deprecated in C:\\xampp\\php\\pear\\HTTP\\Request.php on line 749

Deprecated: Assigning the return value of new by reference is deprecated in C:\\xampp\\php\\pear\\HTTP\\Request.php on line 794

Strict Standards: Redefining already defined constructor for class Net_URL in C:\\xampp\\php\\pear\\Net\\URL.php on line 124

Notice: Undefined index: username in C:\\xampp\\htdocs\\registration\\php-sample\\index.php on line 12

Notice: Undefined index: password in C:\\xampp\\htdocs\\registration\\php-sample\\index.php on line 13

How can I fix the problem?

I'm using JasperServer 4.7 with PHP 5.4.7 (XAMPP 1.8.1).

You can change PHP's error_reporting settings to not show deprecated/strict warnings. http://php.net/manual/en/function.error-reporting.php

This error:

Redefining already defined constructor for class Net_URL in C:\xampp\php\pear\Net\URL.php on line 124

Is because the Net_URL PEAR package has a PHP4 compatibility in it that causes the error on more recent versions. The best thing to do is replace Net_URL with something a bit more modern (eg NET_URL2) - but if you need a quick fix to get legacy code working just edit the file URL.php (get the location from the error message) and remove or comment out the following block:

/**
* PHP4 Constructor
*
* @see __construct()
*/
function Net_URL($url = null, $useBrackets = true)
{
    $this->__construct($url, $useBrackets);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM