The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 40 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue Sep 09, 2008 11:19 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Feb 05, 2008 3:23 am
Posts: 35
I just updated a 1.5.6 to 1.5.7 using the update package. During testing I found out when you Submit an Article in the Front-End you get "Fatal error: Call to undefined function: stripos() in /home/public_html/libraries/joomla/environment/uri.php on line 675"

The Article is posted as normal.

Ideas?

The 675 line is
Code:
      if(stripos($base, JURI::base()) !== 0 && !empty($host)) {


Last edited by humvee on Sun Sep 14, 2008 7:18 pm, edited 3 times in total.
marked topic as resolved as per original poster


Top
 Profile  
 
PostPosted: Wed Sep 10, 2008 12:32 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Feb 05, 2008 3:23 am
Posts: 35
I think I found the problem, someone confirm.

stripos() function is for PHP 5 only. My host I'm almost certain is PHP 4.x.

looking at php.net someone posted
Code:
function stripos($haystack, $needle){
    return strpos($haystack, stristr( $haystack, $needle ));
}


as a substitute on PHP 4.x servers. I'm going to stick it somewhere and see if that works.


Top
 Profile  
 
PostPosted: Wed Sep 10, 2008 12:41 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Feb 05, 2008 3:23 am
Posts: 35
Replace line 675 in /libraries/joomla/environment/uri.php
Code:
          if(stripos($base, JURI::base()) !== 0 && !empty($host)) {


With
Code:
      if(strpos($base,stristr($base,JURI::base())) !== 0 && !empty($host)) {


It worked perfect for me.


Last edited by MarkCII on Thu Sep 11, 2008 11:40 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Sep 10, 2008 9:32 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Sep 10, 2008 9:20 am
Posts: 3
yes - works for me too


Top
 Profile  
 
PostPosted: Wed Sep 10, 2008 9:53 am 
Joomla! Ace
Joomla! Ace

Joined: Fri Sep 14, 2007 8:11 pm
Posts: 1321
for me too, Thanks

_________________
Roar
http://www.joomlainorge.no/


Top
 Profile  
 
PostPosted: Wed Sep 10, 2008 12:22 pm 
Joomla! Intern
Joomla! Intern

Joined: Sat Apr 12, 2008 3:19 pm
Posts: 79
I had the same front end error problem and sorted it by enabling php 5 in Cpanel. But I have also got a problem accessing the back end which is not resolved by this.

See this thread: viewtopic.php?f=430&t=324159


Top
 Profile  
 
PostPosted: Wed Sep 10, 2008 9:19 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Aug 31, 2006 5:33 pm
Posts: 44
Just for reference this will also produce an error when trying to login on the front end.

THIS MUST BE FIXED ASAP as you are going to make a load of sites go from stable 1.5.6 to broken on 1.5.7

(and while I don't like to shout at open source coders etc - WTF did this not get found on the beta testing before release? It is a fairly quick find - so do the beta testers not test on PHP4 at all?)


Top
 Profile  
 
PostPosted: Wed Sep 10, 2008 9:32 pm 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Thu Jan 24, 2008 1:54 pm
Posts: 109
Location: Staffs, UK
This has been reported and confirmed by the bug squad. Hopefully it will be fixed ASAP.
I agree, this should have been found during testing and hopefully the Bug Squad will look at their testing platforms

_________________
"The answer my friend is blowing in the wind" (Bob Dylan) - not necessarily correct, but the search feature will probably find it ;-) .


Top
 Profile  
 
PostPosted: Thu Sep 11, 2008 1:45 am 
Joomla! Intern
Joomla! Intern

Joined: Sat Apr 12, 2008 3:19 pm
Posts: 79
Hey, polc1410,

I don't necessarily disagree with the content of your comment, but I do think your criticism is too harsh and unwarranted. After all, the coders and forum helpers are doing this as a voluntary project.

I have made four upgrades in the past months without problem. This is the first glitch. I made backups before the upgrade so it is not a big deal.

And I for one am extremely grateful that I am getting a free and absolutely superb WCMS for our non-profit project. So just hold your horses before launching into a diatribe about glitches. They are not getting paid--perhaps if more freeloaders made a financial contribution to the project, we might get an improve and more rapid response? :)

The key to the success of open source is thousands of micro-payments. OK, we get requests for donations on all open source web-sites. But if every down-loader of Joomla made just a small donation of say $5 or $10 it would make a massive difference.

I am going to make a donation now.


Top
 Profile  
 
PostPosted: Thu Sep 11, 2008 3:03 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon May 26, 2008 2:22 am
Posts: 21
I had the same problem. Thank you for not only posting the fix, but doing it so clearly that a novice like me could follow the instructions, even though I didn't understand any of the code! ;D


Top
 Profile  
 
PostPosted: Thu Sep 11, 2008 4:37 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Feb 05, 2008 3:23 am
Posts: 35
No problem. I don't know too much php either so I give major credit to a friend of mine. :D

For the record I have tons of addons including CB and Fireboard (<-bugtastic!) and this is the only bug I had upgrading. Or maybe I should say "found" instead of "had". ;)
I would say for those who have major bugs to back up your db and home and try a clean 1.5.7 install and see if the server gives any errors.
I thought I read somewhere that 1.5.x was going to be geared toward php 5? Anyway we all got to upgrade sometime I guess. For me I would have to ask my host to do the change or do the .htaccess thing. That scares me too much...


Top
 Profile  
 
PostPosted: Thu Sep 11, 2008 2:36 pm 
User avatar
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Sep 10, 2008 8:15 pm
Posts: 3
Yup, thanks. Worked for me too Mark CII.
Good description.


Top
 Profile  
 
PostPosted: Thu Sep 11, 2008 6:01 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Aug 31, 2006 5:33 pm
Posts: 44
ChrisE,

What you don't know is I do a bit of coding myself... and am involved in some OS projects and yeh I've seen exactly these types of cockups happen... but the project I'm involved with has a beta test team of 3! I hope J! has a little bit bigger team.... if it doesn't or it doesn't have the platforms it needs then maybe it needs to post a request for specific help (eg. Beta Tester needed with PHP 4, MySQL4)

Two things concern me here:
- 1 a mistake in the code got through. One that I'd have expected to be picked up by a beta tester installing and trying to use the site on PHP4. Considering that there were changes to the 'Not Allowed' type screens this must have been beta tested on PHP5...
- 2 there has now been a single line code fix in the wild for 24 hours and from what i can see still people will be downloading the unfixed version. There doesn't even seem to be any statement anywhere that there is an issue for PHP4 users and they shouldn't upgrade or if they do they need to refer to this thread etc.

But the thing that really surprised me about this was this wasn't some rarely used feature in the core or some plugin 3PD Component that broke it was fundamental core code...

So its free code - what do you expect! I am 100% familiar with the GPL licence and defend it on an almost daily basis when people complain the code didn't work and seem to expect some warranty. So trust me its not that... but this is a big blow to joomla - you may not think so but loads of people missed J1.5.6 upgrade and discovered it too late when they were hacked. They are now carefully watching the security thread in case there is another "biggy" - I bet anyone hacked with 1.5.5 upgraded to 1.5.7 quickly this time... Some will then have had broken sites what do they do when J1.5.x comes out with another high priority security release - they wait to make sure its not going to take their site out... that waiting means they leave their site open to attack and then might loose the site... then joomla gets a bad name for being insecure.

From what I have understood this release was not as high priority as J1.5.6 yet it seemed that 1.5.6 went through a better beta test when you read the articles on how 1.5.6 happened in 3 hours or whatever it was thats pretty impressive...

As for the comment someone else made that J1.5 was aimed at at PHP5 - yip but till now its worked OK on PHP4 - the Joomla team never intended it to break.

In case anyone has mis-understood I'm not angry - I don't have a live site on 1.5 - I upgraded to 1.5.7 to beta test a component that is for imminent release... ...and hence was testing it on both PHP4 and 5... kind of seemed ironic that I found the bug while beta testing an entirely different component...


Top
 Profile  
 
PostPosted: Thu Sep 11, 2008 10:05 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Jan 23, 2008 1:27 am
Posts: 17
Well said Polc,
When an upgrade is released the support team should be on high alert for a few days constantly monitoring the feedback and reacting to it. A new upgrade file should have been built hours ago or (as you say) warnings and advice placed very prominantly to help.

This is exactly the sort of thing that can cripple the reputation of a good CMS. I really like Joomla (still pretty new to it though). I want to see it succeed.


Top
 Profile  
 
PostPosted: Thu Sep 11, 2008 10:22 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Jan 06, 2007 10:45 pm
Posts: 11
I had the same problem, and your solution works for me too. I don't know php at all, but it gave me no problems.

thx for providing a solution for the problem so fast!


Top
 Profile  
 
PostPosted: Fri Sep 12, 2008 2:36 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Feb 11, 2006 1:09 pm
Posts: 15
Location: NSW, Australia
Thanks for the solution. Also rather annoyed that this still hasn't been updated on the main page with any kind of warning... it's all well and good that mistakes will be made but unless prompt action is taken to rectify them, people will lose patience. In my case this problem just took down my only income-producing site for over 12 hours.


Top
 Profile  
 
PostPosted: Fri Sep 12, 2008 10:55 pm 
User avatar
Joomla! Exemplar
Joomla! Exemplar

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 7986
Location: New York
http://docs.joomla.org/Why_do_you_get_a_%22Fatal_error:_Call_to_undefined_function:_stripos()%22_when_editing_Joomla!_1.5.7_Articles_from_the_frontend_when_using_PHP_4%3F

This was posted in docs (although in a slightly different location originally) within an hour or so of release.

_________________
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.


Top
 Profile  
 
PostPosted: Fri Sep 12, 2008 11:28 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Aug 31, 2006 5:33 pm
Posts: 44
mcsmom:

I don't think the complaint is that the answer isn't out there - afterall we are on a thread with the answer. Although I challenge anyone to find the wiki article by themselves. The FAQ for 1.5.7 brings up an empty article for me!

However, It'd be better if you are about to install this on a PHP4 system to know the bug is there and needs manually fixed if for some reason there is a good reason it couldn't just be fixed (call it 1.5.7b if you like)
--
BUT
--
I think the fudamental problem is no-one on the Joomla Core Team has reaslised the significance of this bug. It doesn't just affect article submission (wouldn't have complained about that missing a beta test). It affects user logins. I'm guessing as the forum isn't full of posts on this - not all but a good proportion of them.

See viewtopic.php?f=430&t=324934#p1413992
and probably numerous other articles

I have a suspicion there are a lot less people using PHP4 than I thought - perhaps because since August it has stopped being maintained.

So let me stress again what I think the joomla team should have done if they weren't prepared to issue a 1.5.7b or 1.5.8. On the page where you see the download: http://www.joomla.org/announcements/rel ... lable.html there should be a clear note warning that users with PHP4 will need to manually amend a line of code and then linking to the wiki article. Not difficult - ?

The wiki needs amended as it implies the bug has less significance than it does.


Top
 Profile  
 
PostPosted: Sat Sep 13, 2008 12:05 am 
User avatar
Joomla! Exemplar
Joomla! Exemplar

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 7986
Location: New York
It's a wiki, feel free to make it more effective and accurate if you feel it isn't serving its purpose well enough.


However, I haven't seen reports of login problems at all.

ausref wrote:
Thanks for the solution. Also rather annoyed that this still hasn't been updated on the main page with any kind of warning... it's all well and good that mistakes will be made but unless prompt action is taken to rectify them, people will lose patience. In my case this problem just took down my only income-producing site for over 12 hours.


A simple search for strpos would have found you the solution in minutes.

_________________
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.


Top
 Profile  
 
PostPosted: Sat Sep 13, 2008 12:24 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Feb 11, 2006 1:09 pm
Posts: 15
Location: NSW, Australia
It does prevent logins in the front-end, I will confirm this. I only realised I had a problem when my users started emailing me complaining they couldn't log in any more, and tested it and found the error myself also.

No problems with the wiki et al, but essentially the 1.5.7 update BREAKS Joomla for PHP4 users. Since J1.5x is supposed to be compatible with PHP4, this is a serious issue and shouldn't simply be in the forums or on a docs wiki - it should be on the very same article telling people to upgrade.

Otherwise, your PHP4 users - like myself - are going to see an urgent security update, apply it as a matter of priority without checking wikis etc, and break their site. Yes, it's not that hard to fix for many of us... but how long will it take before the problem is noticed, then to find the solution... and not everyone has the technical savvy to edit PHP files. I know I don't find it difficult but part of the beauty of Joomla is supposed to be that you don't need to delve into code.


Top
 Profile  
 
PostPosted: Sat Sep 13, 2008 12:57 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Aug 31, 2006 5:33 pm
Posts: 44
mcsmon

I went straight from posting to the wiki. Have edited to make it clearer (IMO). However, I don't have much wiki experience so I don't know what to do to make it actually appear in the J! 1.5.7 FAQs.

I suddenly started to realize that no-one on the J! team knew about or at least were acknowledging the login issue when the wiki didn't mention it. This thread has become the discussion for it but didn't mention it and was linked to by a couple of other threads discussing the login error.

I agree that it wouldn't have been critical to get a patch out for the article submission as it doesn't physically stop things working. But for login it does. What I don't understand is how some people can obviously login to be able to submit an article when I couldn't login !! Perhaps there is something in the sequence of logging in that is different between those who can and those who cant.

I agree a search finds the articles pretty easily. But why not post a notice?


Top
 Profile  
 
PostPosted: Sat Sep 13, 2008 5:21 am 
User avatar
Joomla! Exemplar
Joomla! Exemplar

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 7986
Location: New York
I'm looking for other threads on the login issue but not seeing them. Can you give me some links?

Also please run forum post assistant and paste the results.
Also say what extensions you have installed

Please turn error reporting to maximum and do some tests..
Please explain EXACTLY what happens when you try to log in.
Please do this for using the login module and using the component (menu link). Also try it without any redirect on login and with a redirect.

_________________
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.


Top
 Profile  
 
PostPosted: Sat Sep 13, 2008 9:23 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Aug 31, 2006 5:33 pm
Posts: 44
mcsmom wrote:
I'm looking for other threads on the login issue but not seeing them. Can you give me some links?

viewtopic.php?f=430&t=324441
viewtopic.php?f=430&p=1412557
viewtopic.php?f=304&t=325033
viewtopic.php?f=430&t=324934

At least one of those reports a problem with backend login but not something I've had.

Quote:
Also please run forum post assistant and paste the results.
Also say what extensions you have installed

Will do. I patched the stripos() code because I was specifically trying to beta test a component on PHP4 on J1.5.7, so I'll create a new perfectly clean occurrence of J1.5.7 and see if I can reproduce it, with no components installed etc. Give me a couple of hours and I'll be back.
The machine i know I can produce the error on which i've now patched is pretty clean. I was beta testing AEC but it happens with AEC installed or not. Think the only other component is a file manager in the backend.

Quote:
Please turn error reporting to maximum and do some tests..
Will do but the error message was appearing on my standard config of error reporting (it is a dev server so is fairly high) as: Fatal error: Call to undefined function: stripos() in /home/.../www/joomla/libraries/joomla/environment/uri.php on line 675

So using the fix quoted on here of course fixes it. Which is fine.

Quote:
Please explain EXACTLY what happens when you try to log in.
Please do this for using the login module and using the component (menu link). Also try it without any redirect on login and with a redirect.

OK the situation I can tell you about is: login module, no-login redirection, this was when it produced the above error.

I'll run through all the scenarios on a completely clean server and post the detail with Post Assistant.

Speak soon


Top
 Profile  
 
PostPosted: Sat Sep 13, 2008 10:09 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Aug 31, 2006 5:33 pm
Posts: 44
As requested here's the detail. This is from a completely clean version of Joomla, no components added, brand new database etc. None of the options for login make any difference. I tested this with the admin account and a standard registered user account.

Problem Description:
Login module is broken in J1.5.7 with PHP 4. Server is switchable from PHP4 to 5 and switching fixes it. This is a totally clean out of the box install of J1.5.7 with no component etc installed.

Various Login Methods:

Module, no redirect set: broken
Module, redirect set: broken
Link(index.php?option=com_user&view=login), no redirect set: broken
Link, redirect set: broken



Log/Error Message:
Quote:
Fatal error: Call to undefined function: stripos() in /home/cpolwart/www/j157/libraries/joomla/environment/uri.php on line 675

Actions Taken To Resolve:
Amending the call to stripos() as described for the Submitted Article error fixes it.
Switching to PHP 5 fixes it.

Diagnostic Information
Joomla! Version: Joomla! 1.5.7 Production/Stable [ Wovusani ] 9-September-2008 23:00 GMT
configuration.php: Writable (Mode: 600 ) | RG_EMULATION: N/A
Architecture/Platform: Linux 2.6.15-23-386 ( i686) | Web Server: Apache/2.0.55 (Ubuntu) PHP/5.1.2 mod_ssl/2.0.55 OpenSSL/0.9.8a ( sub.chemo.org.uk ) | PHP Version: 4.4.2-1build1
PHP Requirements: register_globals: Disabled | magic_quotes_gpc: Enabled | safe_mode: Disabled | MySQL Support: Yes | XML Support: Yes | zlib Support: Yes
mbstring Support (1.5): Yes | iconv Support (1.5): Yes | save.session_path: Writable | Max.Execution Time: 30 seconds | File Uploads: Enabled
MySQL Version: 5.0.22-Debian_0ubuntu6.06.10-log ( Localhost via UNIX socket )

Extended Information:
SEF: Disabled (without ReWrite) | FTP Layer: Disabled | htaccess: Not Implemented
PHP/suExec: User and Web Server accounts are the same. (PHP/suExec probably installed)
PHP Environment: API: cgi-fcgi | MySQLi: No | Max. Memory: 48M | Max. Upload Size: 2M | Max. Post Size: 8M | Max. Input Time: 60 | Zend Version: 1.3.0
Disabled Functions:
MySQL Client: 5.0.22 ( latin1 )


Top
 Profile  
 
PostPosted: Sat Sep 13, 2008 3:37 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Sep 26, 2005 8:11 pm
Posts: 23
MarkCII, muchas gracias!


Top
 Profile  
 
PostPosted: Sat Sep 13, 2008 4:17 pm 
User avatar
Joomla! Exemplar
Joomla! Exemplar

Joined: Thu Aug 18, 2005 8:43 pm
Posts: 7986
Location: New York
Yes, thanks for doing that, extremely helpful.

I've now posted something about this on the JBS blog.

http://developer.joomla.org/bug-squad-b ... 4-and.html

_________________
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.


Top
 Profile  
 
PostPosted: Sat Sep 13, 2008 5:48 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Thu Aug 31, 2006 5:33 pm
Posts: 44
Thanks. And I see there is now a link to the FAQ on the download page.

As I say - surprised how few reports there have been - which I think means most people on J1.5.7 are on PHP5 which I guess figures...


Top
 Profile  
 
PostPosted: Mon Sep 15, 2008 4:00 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Jul 28, 2008 5:44 pm
Posts: 5
Thank everyone here on this post, I had same problem for a few days, now it is all solved!


Top
 Profile  
 
PostPosted: Tue Sep 16, 2008 9:45 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Sep 10, 2007 8:15 am
Posts: 24
MarkCII wrote:
Replace line 675 in /libraries/joomla/environment/uri.php
Code:
          if(stripos($base, JURI::base()) !== 0 && !empty($host)) {


With
Code:
      if(strpos($base,stristr($base,JURI::base())) !== 0 && !empty($host)) {




I tried this correction but it didn't work instead it through up parse errors.

Currently reloading site after a few poor installs and hoping to get 1.5.7 to install the 3rd time round without and problems.

Also should it not read

if(stripos($base,stristr($base,JURI::base())) !== 0 && !empty($host))

Just a few questions from a newbie so please no one take any offence should strpos not read stripos and where there are 3 ))) there are 4(((( before it does there need to be the same no. closed as opened.

My joomla is on version php 5.

I have loaded 1.5.7 on PHP5 and have the issue with front end. Do php5 used have to alter their files if so do we later uri.php on it's own or do we need to alter other files as well.



Confused and frustrated.

A


Top
 Profile  
 
PostPosted: Tue Sep 16, 2008 12:03 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Feb 05, 2008 3:23 am
Posts: 35
You shouldn't have this "Line 675" problem if you are on PHP5 since it has the stripos() function. Just PHP4 users need to edit that line to use the old strpos() along with stristr() to do the same thing without throwing up an error when submitting an article.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 40 posts ]  Go to page 1, 2  Next



Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group