dfGallery error Invalid cURL response when accessing Admin control panel and Invalid JSON Data on website page itself.

Current installation: PHP v5.3.1, MySQL v5.1.41, dfGallery v2.0, mod_rewrite & cURL modules are loaded

 

Change the following files as per rafaelspfonseca suggested here http://www.dezinerfolio.com/forum/discussion-28, then some additional files where we have to assign the website's address:

  1. /lib/ci/libraries/Loader.php
    At line 249, replace
    $CI->dbutil =& new $class();
    with
    $CI->dbutil = new $class();
  2. /lib/ci/libraries/URI.php
    At line 190, replace
    if ( ! preg_match("|^[".preg_quote($this->config->item('permitted_uri_chars'))."]+$|i", $str))
    with
    if ( ! preg_match("|^[".($this->config->item('permitted_uri_chars'))."]+$|i",rawurlencode($str)))
  3. /lib/ci/codeigniter/CodeIgniter.php
    At line 60, replace
    set_magic_quotes_runtime(0); // Kill magic quotes
    with
    ini_set('magic_quotes_runtime', 0);
  4. /lib/ci/codeigniter/Common.php
    At line 123, replace
    $objects[$class] =& new $name();

    with

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

    At line 129, replace

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

    with

    $objects[$class] = new $name();
  5. /lib/ci/database/DB.php
    At line 133, replace
    command $DB =& new $driver($params);
    with
    $DB = new $driver($params);
  6. /app/config/config.php
    At line 129, replace
    $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
    with
    $config['permitted_uri_chars'] = 'a-z 0-9~%\.\:_\-';
  7. /.htaccess
    At line 16, replace
    RewriteRule ^(.+)$ index.php?/$1 [L]
    with
    RewriteRule ^(.*)$ http://www.itropics.net/dfgallery/index.php/$1 [L]
  8. /app/config/config.php
    At line 18, replace
    $config['base_url']    = 'http://'.$_SERVER['SERVER_NAME'].substr($_SERVER['SCRIPT_NAME'],0,strpos($_SERVER['SCRIPT_NAME'],'/index.php')). '/';
    with
    $config['base_url'] = "http://www.itropics.net/dfgallery/";
  9. /install.php
    At line 103, replace
    $curl_url = 'http://'.$_SERVER['SERVER_NAME'].substr($_SERVER['SCRIPT_NAME'],0,strpos($_SERVER['SCRIPT_NAME'],'/index.php')). '/api/rest/test_curl';
    with
    $curl_url = 'http://www.itropics.net/dfgallery/index.php/api/rest/test_curl';

 

That should be it...