LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-03-2005, 09:13 AM   #1
merana
Member
 
Registered: May 2002
Location: Philly/So. Jersey
Distribution: ESXi CentOS Red-Hat Ubuntuu Solaris Debian
Posts: 85

Rep: Reputation: 15
PHP Troubleshooting


Hi All,

I hope that you all had a good holiday season and that the New Year is treating you well.

I am trying to troubleshoot a problem with my tikiwiki that manifested around the 22nd of December. Prior to this date the wiki was working fine and everything was normal.

I am running on Debian Sarge and I am fairly certain that the PHP 4.3.10-2 upgrade is largely to blame for the hosing...

I am now seeing the following error in my php log when I try to login:

Code:
[03-Jan-2005 09:58:14] PHP Parse error:  parse error, unexpected T_SL in /basepath/tikiwiki/tiki-login.php on line 17
The offending sections of code from lines 16-30 are as follows:

Code:
// Alert user if cookies are switched off
<<<<<<< tiki-login.php
if (ini_get('session.use_cookies') == 1) {
	if(!isset($_COOKIE['efnj_PHPSESSID'])) {
=======
// for some reason, CAS proxy tickets don't work if the following cookie check occurs: help!
global $auth_ext_xml_cas_proxy;
if (ini_get('session.use_cookies') == 1 && $auth_ext_xml_cas_proxy != 'y') {
	if(!isset($_COOKIE['efnj_PHPSESSID'])) {
>>>>>>> 1.43
		$url = 'tiki-error.php?error=' . urlencode(tra('You have to enable cookies to be able to login to this site'));
		header("location: $url");
		die;
	}
}
I've tried to look up the syntax for the 'odd' use of the redirects ("<<<<<<" and ">>>>>>") and I got some hits with references to long argument assembly... I'm not sure that is relevant in this instance...

What are they really trying to do with the redirects?

PHP settings are as follows:

Code:
	<IfModule mod_php4.c>                          
		php_admin_value open_basedir "/basepath/tikiwiki"
		php_admin_value magic_quotes_gpc "1"
		php_admin_value error_reporting "2039"
		php_admin_value log_errors "1"
		php_admin_value ignore_repeated_errors "1"
		php_admin_value register_globals "1"
		#php_value mmcache.enable "0"
		#php_value mmcache.optimizer "0"

		php_admin_value error_log "/var/log/apache/wiki_php4_error.log"

		php_value memory_limit "16M"                
	</IfModule>
Anyone?


Last edited by merana; 01-03-2005 at 01:11 PM.
 
Old 01-03-2005, 10:58 AM   #2
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
I would try to comment (add a // in front of line) the lines which begin with :

<<<<<<<
=======
>>>>>>>

 
Old 01-03-2005, 12:11 PM   #3
merana
Member
 
Registered: May 2002
Location: Philly/So. Jersey
Distribution: ESXi CentOS Red-Hat Ubuntuu Solaris Debian
Posts: 85

Original Poster
Rep: Reputation: 15
Thanks for the suggestion...

I tried that already but then it gives me another error farther down in the script where the terminator for the "< ? php" tag should be...
 
Old 01-03-2005, 01:29 PM   #4
zaichik
Member
 
Registered: May 2004
Location: Iowa USA
Distribution: CentOS
Posts: 419

Rep: Reputation: 30
I would strongly recommend rolling back to 4.3.9. If you look at the change log you will see that 4.3.10 contains back ports from version 5.0, and is bound to introduce unreliable results into your previously working scripts.

I work for a provider of dedicated servers, and we are recommending to our client base that they NOT upgrade to 4.3.10 at this time.

Having said that, I would have to agree with Cedrik that you should probably remove/comment out the lines with <<<<<<< and ========. I have no idea what they are, but it is not anything I have ever seen in PHP code before.
 
Old 01-03-2005, 01:45 PM   #5
merana
Member
 
Registered: May 2002
Location: Philly/So. Jersey
Distribution: ESXi CentOS Red-Hat Ubuntuu Solaris Debian
Posts: 85

Original Poster
Rep: Reputation: 15
Ugh. I was afraid of something like that...

I'me more than willing to do the roll back... Now the only question is how I am going to do that and still maintain some level of stability with the system... Y'see, I am running this on Debian Sarge Unstable. When you do an apt-get update process it automatically selects the PHP build in that particular segment of the project.

The way this sounds, I may have to remove the APT versions and do a manual build of Apache and PHP to keep it stable. The current Apache build on the box is using the php-module and even when I downgraded the version by trying to tick apt to fetch from stable, the PHP Module version remained the same...

I'll have to post some additional questions to the Distro section to see if anyone's got some advice...

This is why I keep my hair short... It's harder to pull out that way...
 
Old 01-03-2005, 03:12 PM   #6
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
it gives me another error farther down in the script where the terminator for the "< ? php" tag should be...
Usually that means that a ' } ' is missing (or more than one).
 
Old 01-03-2005, 04:08 PM   #7
merana
Member
 
Registered: May 2002
Location: Philly/So. Jersey
Distribution: ESXi CentOS Red-Hat Ubuntuu Solaris Debian
Posts: 85

Original Poster
Rep: Reputation: 15
That was a wicked head kick! AND it worked!!!

Now let me break it down:

Original Code:

Code:
// Alert user if cookies are switched off
<<<<<<< tiki-login.php
if (ini_get('session.use_cookies') == 1) {
	if(!isset($_COOKIE['efnj_PHPSESSID'])) {
=======
for some reason, CAS proxy tickets don't work if the following cookie check occurs: help!
global $auth_ext_xml_cas_proxy;
if (ini_get('session.use_cookies') == 1 && $auth_ext_xml_cas_proxy != 'y') {
	if(!isset($_COOKIE['efnj_PHPSESSID'])) {
 >>>>>>> 1.43
		$url = 'tiki-error.php?error=' . urlencode(tra('You have to enable cookies to be able to login to this site'));
		header("location: $url");
		die;
	}
}
Revised Code:

Code:
// Alert user if cookies are switched off
// <<<<<<< tiki-login.php
if (ini_get('session.use_cookies') == 1) {
	if(!isset($_COOKIE['efnj_PHPSESSID'])) {
// =======
// for some reason, CAS proxy tickets don't work if the following cookie check occurs: help!
//global $auth_ext_xml_cas_proxy;
//if (ini_get('session.use_cookies') == 1 && $auth_ext_xml_cas_proxy != 'y') {
//	if(!isset($_COOKIE['efnj_PHPSESSID'])) {
// >>>>>>> 1.43
		$url = 'tiki-error.php?error=' . urlencode(tra('You have to enable cookies to be able to login to this site'));
		header("location: $url");
		die;
	}
}
Nothing fancy there... I just did the old bracket matching... Then after that change I tried to login. Now I got an actual error message that said that a table was missing (tiki_logs). I verified that it was actually missing and then found the section in the application setup script that made the table (DB/tiki.sql) and just ran that code segment to make the table.

After that I tried to login again and Voila! It worked!!!

I wonder if those were somehow redirecting that error message so that it wouldn't show up in the logs.... I'll have to post this on the dev site as well!

Thanks for the nudge Cedrik!

MichaelE
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Troubleshooting KMail Ishkabibble Linux - Software 1 11-10-2005 02:50 PM
Troubleshooting apache, php, and mysql. IssacT Slackware 21 08-20-2005 01:58 AM
dvdbackup troubleshooting sploit Linux - Software 3 06-21-2005 11:17 AM
WUFTPD troubleshooting wendallsan Linux - Networking 0 06-05-2005 12:11 PM
troubleshooting how-to? chilehead Linux - Hardware 2 02-06-2005 04:58 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration