Welcome Guest, Not a member yet? Register   Sign In
5.2.17 to 5.3.10 hosting site upgrade breaking things (depreciation errors)
#1

[eluser]LouRocco[/eluser]
Hi out there! Firstly, I want to say I'm a codeigniter and php novice, but ready to learn. That said, I have a big pending issue on a live site!

So here's what's up: The site has a custom-built CMS using code igniter using PHP 4. It's running fine in PHP 5.2.17 on the hosting platform but the hosting site is forcing all to upgrade
to 5.3.10. When I manually upgraded the site through the Admin, I got
5 depreciation errors when I refresh the website. So I reverted it
back to 5.2.17, but on May 24 the upgrade is permanent. (eek!) Tech support
isn't allowing us to not upgrade, or delay this.

I was able to follow their FAQ to remove 2 of the errors. I downloaded
the "php.ini.sample" file, renamed it to "php.ini" and uploaded it
(within the etc folder) with just one line of code added:
display_errors = Off

But I still get these 3 errors on load. These are again deprecation
errors. If we can just turn them off somewhere else and the site
works, that is acceptable. I haven't fully tested every nook of the
website while in 5.3.10 but as I said, it appears just to be warning
messages and not true site breakage.

Questions: Do I need to upgrade everything to a newer version of Codeigniter?
Or... is there a way I can easily edit the code to avoid depreciation errors in 5.3.10, yet have all the forms/site function?

Any advice/insight would be awesome!

Thank you,
Lou

Here are the errors:

A PHP Error was encountered
Severity: 8192
Message: Function set_magic_quotes_runtime() is deprecated
Filename: codeigniter/CodeIgniter.php
Line Number: 60
A PHP Error was encountered
Severity: 8192
Message: Assigning the return value of new by reference is deprecated
Filename: libraries/Loader.php
Line Number: 255
A PHP Error was encountered
Severity: 8192
Message: Assigning the return value of new by reference is deprecated
Filename: database/DB.php
Line Number: 133
#2

[eluser]Aken[/eluser]
The best solution would be to upgrade the app to use the newest version of CodeIgniter, but that's not exactly novice work.

The set_magic_quotes_runtime() function can just be commented out, as far as I know. It should only affect PHP settings, and they're already default in 5.3, hence the deprecation warning.

The other two are usually caused by doing something along these lines:

Code:
$object =& new Object();

This is what the error means - the ampersand means assign by reference to the original. Since you're creating something new, there is no original for it to find, so it's not necessary to pass by reference (I probably messed up that explanation - Google the error text and you'll find more stuff about it). You should be able to correct them by removing the ampersands.

Code:
$object = new Object();

I can't confirm that these will magically fix all your problems, nor am I sure of whether or not they will create other problems. What version of CI is this built on, anyway? But either way, that should at least explain why they're cropping up and possibly help you solve them.
#3

[eluser]Ayeyermaw[/eluser]
Is your live site a corporate one? If so and you're a complete novice at codeigniter/php you should consider getting outside assistance because your deadline is pretty close.

If not then you could do as Aken suggests but you're having to go in and change the core files of codeigniter, which is not really recommended in the long run.
#4

[eluser]LouRocco[/eluser]
Aken -- Thank you. I saved a copy of the original files then went in and edited them. Your edits worked--I don't get those depreciation errors on load. But now I've noticed other errors (which we're probably always there). No matter where I click on the site, I get this error:

An Error Was Encountered
The URI you submitted has disallowed characters.

Any other advice on those?

Also, what is "CI" and how would I know what version?
#5

[eluser]LouRocco[/eluser]
Ayeyermaw, Akew and others --

The site is a corporate one. This upgrade came out of the blue and you are right, I likely need outside outside assistance. I'm attempting to do what I can on my own.

Are either of you, or anyone else available for assistance?

Let me know!

--Lou
#6

[eluser]CroNiX[/eluser]
For the version, you can echo CI_VERSION or look at the top of /system/CodeIgniter.php.

For the disallowed characters, check the setting for 'permitted_uri_chars' in /application/config/config.php. Make sure it is the same as your old one. If it is, make sure it has whatever characters that are in the url that are causing problems that are missing.
#7

[eluser]LouRocco[/eluser]
CroNiX, I am very happy for your assistance as well!

Within /application/configh/config.php I found this line:

$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';

What does this mean? What could I add here?
The URLs on the site appear to just be basic. Example: ".com/on_site_process"

I don't know what echo means. But I found this info at the top of the CofeIgniter.php file:

* An open source application development framework for PHP 4.3.2 or newer
*
* @package CodeIgniter
* @author ExpressionEngine Dev Team
* @copyright Copyright © 2008, EllisLab, Inc.
* @license http://ellislab.com/codeigniter/user-guide/license.html
* @LinK http://codeigniter.com
* @since Version 1.0


Any more insight would be so welcome!!

thanks, Lou
#8

[eluser]CroNiX[/eluser]
For the version, look a little further down until you see a line like:
define('CI_VERSION', '2.1.0');
But, from what you posted, "An open source application development framework for PHP 4.3.2 or newer" seems like it's quite an old version since even version 1.7 required PHP 5.1.6 and CI 2 has even newer requirements.

For your URL problem, I can't say. The one example you provided shouldn't cause an issue with url characters according to your 'permitted_uri_char' setting.

I would get some assistance. Troubleshooting corporate sites through forums isn't the way to go. Not trying to put you down, but if you don't know what 'echo' is, you will have a very tough time trying to figure all of this out in any sort of acceptable timeframe (you only have 2 weeks). I think you're in over your head and need help. I would urge you to find someone asap, or find another host still running PHP <5.3 to buy more time.
#9

[eluser]LouRocco[/eluser]
Found it: define('CI_VERSION', '1.7.1');

I agree, I'm over my head.

Do you recommend anyone who would be willing to work on this site?
Or do you recommend a host still running lower versions of PHP?

Thanks, Lou

#10

[eluser]Ayeyermaw[/eluser]
I sent you a PM Lou although my sent items on this forum shows as zero.
Let me know if you got it.

Cheers




Theme © iAndrew 2016 - Forum software by © MyBB