Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.