• This looks like an interesting plugin. Unfortunately I’m unable to activate the plugin because it causes a fatal error: Cannot redeclare class URI_Template_Parser in /var/www/vhosts/xxx.xxx/subdomains/xxx/httpdocs/wp-content/plugins/google-drive-wp-media/google-api-php-client/src/external/URITemplateParser.php on line 30

    Website running PHP 5.3.5, cUrl enabled.

    https://www.ads-software.com/plugins/google-drive-wp-media/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Moch Amir

    (@moch-a)

    try this..
    in the plugin dir: google-drive-wp-media/google-api-php-client/src

    open/edit Google_Client.php

    change line 51
    from

    require_once 'external/URITemplateParser.php';

    to

    if(  !class_exists('URI_Template_Parser') ) {
    	require_once 'external/URITemplateParser.php';
    }

    Thread Starter CoCha

    (@cocha)

    This gives the same error, but this time it points to another plugin called UserPro. This one has the ability to use a person’s Google-account to login (and a lot more) and seems to use the same Google-API-PHP-Client set (embedded in/with it’s own plugin, of course).

    The error as it appeared: Fatal error: Cannot redeclare class URI_Template_Parser in /var/www/vhosts/xxx.xxx/subdomains/xxx/httpdocs/wp-content/plugins/userpro/lib/google/src/external/URITemplateParser.php on line 30.

    Then, combining this new error togethet with your suggested solution I decided to make another change by removing the inclusion.

    // userpro (Google) conflict....
    // if(  !class_exists('URI_Template_Parser') ) {
    //	require_once 'external/URITemplateParser.php';
    // }

    Right now I’m able to activate your plugin. ??

    But, after setting e-mail. ID’s etc. another error appears ?? :
    Fatal error: Call to undefined method apiOAuth2::setAssertionCredentials() in /var/www/vhosts/xxx.xx/subdomains/xxx/httpdocs/wp-content/plugins/google-drive-wp-media/google-api-php-client/src/Google_Client.php on line 345

    Perhaps I made some mistake when copy-and-pasting the Google-API-settings, but even if so, that shouldn’t end up with a fatal error I guess?

    Plugin Author Moch Amir

    (@moch-a)

    did you have to try unsettng apiConfig variable?

    in config.php

    add this

    if (isset($apiConfig)) {
        unset ($apiConfig);
    }

    it just my guess, i dont have plugin you mentioned above ??

    Thread Starter CoCha

    (@cocha)

    I added the lines at the end of your plugin’s config.php.
    Sorry, makes no difference…

    Plugin Author Moch Amir

    (@moch-a)

    I have released v0.8

    worth to try

    Thread Starter CoCha

    (@cocha)

    Updated to 0.8.
    I still had to disable the ‘require_once ‘external/URITemplateParser.php’-part just to get the plugin installed.

    The good news: the ability to get to the settings are back again and they’re saved. The bad: after saving the following messages and error/warning appear.

    Great! All API settings successfuly saved.
    
    Warning: openssl_sign() [function.openssl-sign]: Unknown signature algorithm. in /var/www/vhosts/xxx.xxx/subdomains/xxxx/httpdocs/wp-content/plugins/google-drive-wp-media/gdwpm-api/auth/Google_P12Signer.php on line 65
    
    An error occurred: Unable to sign data
    Thread Starter CoCha

    (@cocha)

    Updated to 0.9.
    Disabling UserPro (which uses the same Google API) makes no difference.
    Still getting error:

    Warning: openssl_sign() [function.openssl-sign]: Unknown signature algorithm. in /var/www/vhosts/xxx.xxx/subdomains/xxx/httpdocs/wp-content/plugins/google-drive-wp-media/gdwpm-api/auth/Google_P12Signer.php on line 65
    An error occurred: Unable to sign data

    Plugin Author Moch Amir

    (@moch-a)

    it should works in php v5.3.xx

    ok.. try this
    open/edit

    gdwpm-api/auth/Google_P12Signer.php

    find: (line 65)

    if (!openssl_sign($data, $signature, $this->privateKey, "sha256")) {
          throw new Google_AuthException("Unable to sign data");
        }

    and replace w/:

    if (!openssl_sign($data, $signature, $this->privateKey, "sha256")) {
    		$digests = openssl_get_md_methods();
    		if (!openssl_sign($data, $signature, $this->privateKey, $digests[array_search('SHA256', $digests)])) {
    			throw new Google_AuthException("Unable to sign data");
    		}
        }

    let me know the result

    Thread Starter CoCha

    (@cocha)

    Still the same… ??
    Guess it may be some conflict with some other plugin(s) that use the same Google API. But that’s just a guess.

    Plugin Author Moch Amir

    (@moch-a)

    have you try to install it on another blog on the same hosting?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘ver 0.7 Fatal error: URITemplateParser.php on line 30’ is closed to new replies.