سؤال

I have created a website 3 month ago. I uploaded it to internet and it worked(it still works there). Now I installed it in my local computer and trying to access it. However it prints the following error messages multiple times:

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\htdocs\ptr\xajax\xajax_core\xajax.inc.php on line 1258

Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\ptr\xajax\xajax_core\xajaxPluginManager.inc.php on line 269

I am using XAJAX framework and the errors have something to do with this framework. Since I haven't changed anything in the library files, I don't understand what the problem can be. Please help... I am freaking out

هل كانت مفيدة؟

المحلول

The framework you are using seems to be a little bit outdated and uses such constructs

$x = & new Classname();

The & before new is deprecated since PHP 5.0 (which is several years old now). With the introduction of E_DEPRECATED- and E_STRICT-messages it throws such a message now.

نصائح أخرى

Unfortunately this kind of statement are deprecated from PHP 5. In your local machine you're running a version which is 5.3 while your server is running an older version. Thus, on your machine is thrown a E_STRICT error. To avoid this problem, you have to change lines like:

$node_obj =& new someClass($somearg, $moreargs);

into

$node_obj = new someClass($somearg, $moreargs);

Xajax 0.6 targets this and a couple of other issues. When the development on xajax 0.5 started many users were still trapped on PHP4 Webservers and this syntax helped maintain compatibility for PHP4 up to 5.2.x. Xajax 0.6 can be found on https://github.com/Xajax/Xajax-Project Though it's still beta, it's already pretty solid. Many deprecated function were dropped and the core was shrinked & optimized.

Previous comments fully explain the source of those warnings. Your website will work fine despite of them. But you can disable PHP error reporting, if you want to hide these messages - this manual may help you: http://complete-concrete-concise.com/web-tools/how-to-turn-off-display_errors-in-xampp (UPD: For your local version only of course)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top