If you’re running a fresh install of WAMP and CodeIgniter like myself you are already probably running into problems such as deprecation errors and then a URI issue here’s some help:First, here’s how to solve the issue regarding these errors:
Deprecated: Assigning the return value of new by reference is deprecated in C:wampwwwcisystemcodeigniterCommon.php on line 130
Deprecated: Assigning the return value of new by reference is deprecated in C:wampwwwcisystemcodeigniterCommon.php on line 136
In index.php in your CI folder replace line 12 “
error_reporting(E_ALL);” (without quotes) with this:
error_reporting(E_ALL & ~E_DEPRECATED);” (without quotes)
Then, you’ll probably get an error about a bad URI if you try to run any controlls. It should say something like this: “The URI you submitted has disallowed characters.”
Here’s the solution for that as well. In URI.php which is located in systemlibraries replace line 189:
if ( ! preg_match("|^[".preg_quote($this->config->item” (without quotes and without the line break (it’s all one line)
to read like this:
if ( ! preg_match("|^[".str_replace('-', '-', preg_quote ($this->config->item('permitted_uri_chars')))."]+$|i", $str))” again without the quotes.
Also, please note that wordpress is changing the ” marks into pretty quotes WHICH WILL NOT WORK if you do a copy/paste. So, either retype the code by hand or when you do copy/paste go back and replace the pretty curly quotes with regular quote marks. Thanks go to Bram Van der Sype in the comments who caught this problem!
This should help you save a couple of hours of frustration. The reason for the change is in PHP 5.3 preg_quote was changed to escape the dash, so character ranges won’t work.