Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: rferris on April 12, 2013, 11:47:49 AM

Title: Fatal Error
Post by: rferris on April 12, 2013, 11:47:49 AM
I now get the following message when I visit the page:

Fatal error: Call to undefined function: stripos() in /home/WP-LC/wp-lc.php on line 2

Everything was working fine earlier today. I uninstalled and re-installed the program and continue to get the same error message.
Title: Re: Fatal Error
Post by: TheListener on April 12, 2013, 11:49:23 AM
Can we have more information please.

Is this in relation to a mod?

Link to forum?
Title: Re: Fatal Error
Post by: rferris on April 12, 2013, 12:11:46 PM
It is version 2.04. My webhosting company (lunarpages) has a program that installs various applications automatically (Softaculous Auto Installer).  I installed the program years ago and the only problem I have ever encountered was an occasional database error. I have always applied the latest patches to keep it current.

Everything was working fine until this morning when I got that fatal error. I renamed the directory it was in from myheritagepines.com/discussionboard to myheritagepines.com/discussionboardbackup and did a clean install again using Softaculous. It is in the same directory as I had it originally: myheritagepines.com/discussionboard. I am still getting the same error message after it was re-installed. No mods were applied recently.

Edited to make post easier to read.
Title: Re: Fatal Error
Post by: Arantor on April 12, 2013, 12:17:14 PM
That would be because you're using a very very old version of PHP on your server, that's now several years out of date - stripos was introduced in PHP 5.0 which launched in 2004.

It sounds like your host is using PHP 4.4.x which went end of life in 2007 and you should get your host to upgrade.

Also, if you're using SMF 2.0.4, please post in the 2.x support board next time, thanks.
Title: Re: Fatal Error
Post by: rferris on April 12, 2013, 12:20:20 PM
Thank you.
Title: Re: Fatal Error
Post by: MrPhil on April 12, 2013, 03:04:14 PM
LP should be at 5.3 on all its servers, but it wouldn't hurt to check the PHP level.

LP is currently reporting that its servers are under a brute force attack against WordPress sites. Maybe you're seeing a side-effect of that.
Title: Re: Fatal Error
Post by: Arantor on April 12, 2013, 04:12:33 PM
QuoteLP should be at 5.3 on all its servers, but it wouldn't hurt to check the PHP level.

All evidence suggests it isn't. Unless they have some reason to disable stripos from being executable.
Title: Re: Fatal Error
Post by: MrPhil on April 12, 2013, 05:31:28 PM
Perhaps it is a side effect of trying to foil the WP attack? They stated some months ago that all shared servers were now up to PHP 5.3, so unless a server got regressed somehow, it should be at 5.3.
Title: Re: Fatal Error
Post by: Arantor on April 12, 2013, 05:48:50 PM
No. If they had actually blocked it in the functional exclusion list, it should be a different error.

The error is saying stripos is not defined, which suggests a 4.4.x installation, not a 5.x one.
Title: Re: Fatal Error
Post by: MrPhil on April 12, 2013, 07:11:08 PM
What's in your php.ini? Is there anything in there that might have switched you back to PHP 4? I think most of the LP servers still have PHP 4 available with a switch. If it's not in php.ini, look in .htaccess and look in your control panel (cPanel, LPCP, etc.). Renaming directories and uninstalling and reinstalling sounds like an invitation to put in an old .htaccess or php.ini file.
Title: Re: Fatal Error
Post by: philwojo on August 12, 2013, 02:31:36 PM
I know this is an old topic, and it is in the wrong place as well, but do you know if there was ever a fix?  I am also on Lunar Pages for my host and I am also getting this error.

I run a forum for someone and it is not very visited, but I just tried to go to it today and I am receiving this same message.

Any suggestions on what I can do, short of doing a full re-install of SMF?

Phil
Title: Re: Fatal Error
Post by: Arantor on August 12, 2013, 02:34:23 PM
You have the *exact* same error? WP-LC is a WordPress file not an SMF one...

And as I said, if you're seeing issues with stripos not being defined, you have a very old, outdated, insecure version of PHP and should upgrade. If your host is unwilling or unable to use a version of PHP that isn't 6 years old, you should find a new host.
Title: Re: Fatal Error
Post by: philwojo on August 12, 2013, 02:38:27 PM
Here is the exact error I am getting:

Call to undefined function: stripos() in /home/WP-LC/wp-lc.php on line 2

And here are the contents of my php.ini file on my server:

register_globals = Off

zend_extension="/usr/local/IonCube/ioncube_loader_lin_4.4.so"
zend_extension_ts="/usr/local/IonCube/ioncube_loader_lin_4.4_ts.so"

[Zend]
zend_optimizer.optimization_level=15
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
zend_optimizer.version=3.3.3

zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so

upload_max_filesize = 99999999G ;Max file size that can be uploaded.
post_max_size = 999999G ;Max size of messages and files that can be posted by PHP in Meg.


Any help would be greatly appreciated.  If I do need to contact my host, what should I ask or say to them?

Title: Re: Fatal Error
Post by: MrPhil on August 12, 2013, 03:49:19 PM
Dunno about those upload_max_filesize and post_max_size settings -- they could be causing problems somewhere (hopefully they just get cut back to the maximum LP will support).

How about your /.htaccess file (and any other .htaccess files)? Are they specifying PHP4 usage? I don't know ioncube's versions and how they correlate with PHP's version, but "4.4" would certainly be suspicious that PHP might be 4.4.9.
Title: Re: Fatal Error
Post by: philwojo on August 12, 2013, 03:59:35 PM
Nothing in the .htaccess file, just a timezone setting, nothing else.

I have a ticket open with LP now to see what they say can fix this or how they will fix it.  I appreciate any other feedback though in the mean time.  I will post back when I hear from them.

phil
Title: Re: Fatal Error
Post by: Arantor on August 13, 2013, 11:54:02 AM
Nothing's changed, you're still using PHP 4.4.x or older (stripos was added in PHP 5.0.0) and unless your host changes that, it can't be fixed.

It's not an SMF error, though... nothing to do with SMF at all (since SMF actually provides compatibility code for a lack of stripos just in case), it's a problem with WordPress and your very poorly configured hosting company.
Title: Re: Fatal Error
Post by: philwojo on August 23, 2013, 11:16:45 AM
Thanks for the help, the finally got back to me on my ticket and I was using 4.4.x and just had to do a manual update to make my site use 5.x.x, which it now is.  As soon as I did that my link worked just fine, as you said it would.

To change it i had to go in to my cpanel and then to phpconfiguration.  From there it was just a drop down to choose php 5.x.x and then hit an "update" button.  It took all of like 3 seconds to do, just had no idea I ever needed to do it or had to do it.

Again, thanks for the feedback and help.

Phil
Title: Re: Fatal Error
Post by: Kindred on August 23, 2013, 12:17:35 PM
check which version of 5 you actually are running now... It makes a difference.

5.3.x and 5.4.x are fully supported.
There are known issues with running SMF on 5.5.x which are not yet resolved.
Title: Re: Fatal Error
Post by: Arantor on August 23, 2013, 12:29:47 PM
I don't think that matters much seeing how it's a WordPress install acting up...