[PHP 5.2 ISSUE]Proposed solution TL 1.9.5 PHP parse error ::

Ask community to help.

Moderators: Amaradana, TurboPT, TL Developers

[PHP 5.2 ISSUE]Proposed solution TL 1.9.5 PHP parse error ::

Postby Rab » Wed Jan 09, 2013 9:37 am

Good morning

First post on the forums here, so I hope this is in the correct place. I am a new TL user and just finished installing yesterday. I was having some trouble with PHP parse errors but managed to fix it, so I thought I would record what happened and the solution (plus log a bug ticket) to get this fixed. Hopefully this will help other users who might be in a similar situation.

Setup:
Win 7 Ent
Apache 2.2.22
PHP 5.2.17
MySQL 5.5.29
TestLink 1.9.5

Situation:
Install of Testlink proceeded normally, however when it completed and went to the project setup page it had the header but there was no content on the page. Viewing the page source there was very little content except basic HTML for the header bar. I checked the PHP and APACHE error logs and found the following:
[08-Jan-2013 16:39:26] PHP Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\testlink\lib\functions\tlIssueTracker.class.php on line 555

I had a look at the code and then spent at least a couple of hours looking online for answers, but I found very little of use. The weird error message above is Hebrew and means '::' which ties in with the code. It looks like the way the code is making a call is now considered incorrect (been a decade since I coded PHP).

So I changed the code to this and it let me proceed and use Testlink (apparently so far) normally:
/* ORIGINAL CODE
$impl = $this->getImplementationForType($item['type']);
$dummy = $impl::checkEnv();*/
$impl = $this->getImplementationForType($item['type']);
$dummy = impl::checkEnv();


As I say I havent coded PHP in a very long time, so I may have just stopped the error by causing something else to fail more gracefully. If there are any PHP-philes on here that could advise that would be great. Either way, Testlink wasnt working at all before and now seems to be, allowing me to evaluate it as a potential piece of software to use.

Comments?

Rab
Rab
Advanced user
 
Posts: 15
Joined: Tue Jan 08, 2013 6:58 pm

Re: Proposed solution to TL 1.9.5 PHP parse error ::

Postby fman » Wed Jan 09, 2013 9:59 am

issue is PHP version
We need to add an urgent notice indicating that we want 5.3 or greater
If you use XAMPP 1.7.7 IMHO you are not going to face the error

In any case the post subject is IMHO a little bit generic to be useful
fman
Member of TestLink Community
 
Posts: 3063
Joined: Tue Nov 15, 2005 7:19 am

Re: Proposed solution to TL 1.9.5 PHP parse error ::

Postby Rab » Wed Jan 09, 2013 11:21 am

Hi

Thanks for reply. If you have a suggestion for a better title I am all ears - it went through a few iterations and nothing seemed quite right :)

RE the PHP version, there are newer versions but they are all compiled using VC9 and the PHP windows site explicitly states to use the VC6 compiled versions with apache 2.x. Do you perhaps know of a solution to this?

Thanks
Rab
Rab
Advanced user
 
Posts: 15
Joined: Tue Jan 08, 2013 6:58 pm

Re: Proposed solution to TL 1.9.5 PHP parse error ::

Postby Rab » Wed Jan 09, 2013 11:45 am

I thought I was confined to apache 2.2 and therefore PHP 5.2.17, but I have just found out that I can get a VC9 version of apache 2.4.3 so could then use VC9 version of PHP 5.4.10 so that should bring me up to date.
Rab
Advanced user
 
Posts: 15
Joined: Tue Jan 08, 2013 6:58 pm

Re: Proposed solution to TL 1.9.5 PHP parse error ::

Postby fyang » Thu Jan 31, 2013 3:22 pm

Cool! Your solution does fix my problem on Windows2008 which has Apache 2.2.14, PHP 5.2.121, and Postgres 8.4. I raised my question on viewtopic.php?f=41&t=7195. the title is Windows 2008 -Empty TL1.9.5 webpage only show the first line.

Testlink 1.9.5 with Apache 2.2.22, PHP 5.3.21, and Postgres 8.4.15-1 on Windows 7 works perfect.

Thank you so much for the sharing. :D

Rab wrote:Good morning

First post on the forums here, so I hope this is in the correct place. I am a new TL user and just finished installing yesterday. I was having some trouble with PHP parse errors but managed to fix it, so I thought I would record what happened and the solution (plus log a bug ticket) to get this fixed. Hopefully this will help other users who might be in a similar situation.

Setup:
Win 7 Ent
Apache 2.2.22
PHP 5.2.17
MySQL 5.5.29
TestLink 1.9.5

Situation:
Install of Testlink proceeded normally, however when it completed and went to the project setup page it had the header but there was no content on the page. Viewing the page source there was very little content except basic HTML for the header bar. I checked the PHP and APACHE error logs and found the following:
[08-Jan-2013 16:39:26] PHP Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\testlink\lib\functions\tlIssueTracker.class.php on line 555

I had a look at the code and then spent at least a couple of hours looking online for answers, but I found very little of use. The weird error message above is Hebrew and means '::' which ties in with the code. It looks like the way the code is making a call is now considered incorrect (been a decade since I coded PHP).

So I changed the code to this and it let me proceed and use Testlink (apparently so far) normally:
/* ORIGINAL CODE
$impl = $this->getImplementationForType($item['type']);
$dummy = $impl::checkEnv();*/
$impl = $this->getImplementationForType($item['type']);
$dummy = impl::checkEnv();


As I say I havent coded PHP in a very long time, so I may have just stopped the error by causing something else to fail more gracefully. If there are any PHP-philes on here that could advise that would be great. Either way, Testlink wasnt working at all before and now seems to be, allowing me to evaluate it as a potential piece of software to use.

Comments?

Rab
fyang
TestLink user
 
Posts: 11
Joined: Tue Jan 22, 2013 10:34 pm

Re: [PHP 5.2 ISSUE]Proposed solution TL 1.9.5 PHP parse erro

Postby fyang » Fri Aug 02, 2013 1:14 pm

Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in ...Apache2\htdocs\testlink\lib\functions\tlIssueTracker.class.php on line 555
In my case, the original code in tlIssueTracker.class.php on line 555:
$dummy = $impl::checkEnv();
Then I modified it as:
$dummy = impl::checkEnv();
However, when I upgraded to TL1.9.6, the solution does not work anymore. Then I'm using original code again: $dummy = $impl::checkEnv();
and this works in TL1.9.6.

Good luck
fyang
TestLink user
 
Posts: 11
Joined: Tue Jan 22, 2013 10:34 pm


Return to Installation and configuration



Who is online

Users browsing this forum: No registered users and 1 guest