Jump to content

[SOLVED] Trouble with 3rd party PHP script


Jago6060

Recommended Posts

I'm trying to use a program called GLPI via my company's website and I've run into some issues.  It appears to be a problem with the code.

 

MySQL v5.0.81

PHP 5.2.6-3Ubuntu4.1

 

Here is the error...

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /homepages/18/d258816375/htdocs/glpi/inc/dbmysql.class.php on line 334

 

Here is the corresponding code at the given line number...

public function request ($tableorsql, $crit="") {
    return new DBmysqlIterator ($this, $tableorsql, $crit);
}

 

 

Ok I have to append info to this since I apparently cannot edit my post more than twice...

 

The PHP version listed above, is what the host company tells me the PHP version is, but I uploaded a script with just phpinfo() in it, and the version listed by that is 4.4.9.  So I'm assuming that 4.4.9 is the actual PHP version.

looks like its a simple syntax error. delete the space between the function name (request) and the parentheses.

public function request($tableorsql, $crit="") {

 

hope that helps

 

EDIT: Nevermind, just tested a simple function and a space between the function name and parameter list is allowed

interesting. I'm not sure if PHP has support for nested funtions. That might be your problem. I just tried a simple example on my server with a nested function. the code was:

 

<?php

function tacos ($taco){
echo $taco;
insite($taco . "to");
function insite($poop){
echo $poop;
}
}

tacos("hello");
?>

 

the output was:

hello

Fatal error: Call to undefined function insite() in C:\Server\htdocs\text.php on line 5

 

so I think your nested functions is the problem

I think the trouble may be with the version of PHP.  The software works on my server which has teh following...

 

root@supermicro:~# php --version
PHP 5.2.6-3ubuntu4.1 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23 2009 14:37:14) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

 

The software was copied over to the hosting provider from the server mentioned above.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.