Error : \system\codeigniter\Common.php on line 130 & 136 in Code Igniter

Deprecated: Assigning the return value of new by reference is deprecated in C:\web\site\system\codeigniter\Common.php on line 130

Deprecated: Assigning the return value of new by reference is deprecated in C:\web\site\system\codeigniter\Common.php on line 136

if you got error like that , after uploading and try to load in your hosting . its may be complicated with PHP version

How to solve it ?

here is the step :

A. remove by condition set_magic_quotes_runtime

file: codeigniter/CodeIgniter.php (line: 60)

if(!phpversion()=='5.3.0')
set_magic_quotes_runtime(0); // Kill magic quotes 

B. remove all new object by reference, change ‘=&’ to ‘=’

from: $objects[$class] =& new $name();
became: $objects[$class] = new $name();

file: codeigniter/Common.php   (line: 130)
file: codeigniter/Common.php   (line: 136)
file: libraries/Loader.php   (line: 255)
file: database/DB.php       (line: 133)

$objects[$class] = new $name(); 

see: = new
C. since hyphen ‘-’ became special character in php 5.3, change this way:

file: config/config.php     (line: 153)

from:

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

to:

$config['permitted_uri_chars'] = '~%.:_\-'; 

file: libraries/URI.php     (line: 189)

from:

if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) 

to:

if ( !
preg_match("|^[\w".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str)) 

wacth!:
! preg_match(”|^[\w

 Try to load your website again 🙂
Advertisements

3 thoughts on “Error : \system\codeigniter\Common.php on line 130 & 136 in Code Igniter

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s