Jago6060 Posted August 13, 2009 Share Posted August 13, 2009 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); } Quote Link to comment https://forums.phpfreaks.com/topic/170135-solved-trouble-with-3rd-party-php-script/ Share on other sites More sharing options...
Jago6060 Posted August 13, 2009 Author Share Posted August 13, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/170135-solved-trouble-with-3rd-party-php-script/#findComment-897457 Share on other sites More sharing options...
mikesta707 Posted August 13, 2009 Share Posted August 13, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/170135-solved-trouble-with-3rd-party-php-script/#findComment-897460 Share on other sites More sharing options...
Jago6060 Posted August 13, 2009 Author Share Posted August 13, 2009 Something else I should mention is that this function is a small part of a larger encompassing function. Idk if that makes a difference but I thought it might be something to note. Quote Link to comment https://forums.phpfreaks.com/topic/170135-solved-trouble-with-3rd-party-php-script/#findComment-897464 Share on other sites More sharing options...
mikesta707 Posted August 13, 2009 Share Posted August 13, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/170135-solved-trouble-with-3rd-party-php-script/#findComment-897475 Share on other sites More sharing options...
Jago6060 Posted August 13, 2009 Author Share Posted August 13, 2009 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. Quote Link to comment https://forums.phpfreaks.com/topic/170135-solved-trouble-with-3rd-party-php-script/#findComment-897484 Share on other sites More sharing options...
Jago6060 Posted August 13, 2009 Author Share Posted August 13, 2009 It was the PHP version causing the problem. I contacted the hosting company and had them update the PHP version to PHP5 and now it works. Lesson learned Quote Link to comment https://forums.phpfreaks.com/topic/170135-solved-trouble-with-3rd-party-php-script/#findComment-897503 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.