Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: CPMfetch errors: "Warning: Failed opening..."  (Read 2367 times)

0 Members and 1 Guest are viewing this topic.

Manutjee

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 77
CPMfetch errors: "Warning: Failed opening..."
« on: May 14, 2015, 09:23:00 pm »

I have installed CPMfetch recently on one of my sites, but I can't seem to get the code to work.
I believe I installed it correctly, but when I put the code in the location I want it to be, I get this error:

Code: [Select]
Warning: include(./folio/cpmfetch/cpmfetch.php): failed to open stream: No such file or directory in /home/writteninreverse/public_html/wp/wp-content/themes/wppremade04/header.php on line 46

Warning: include(): Failed opening './folio/cpmfetch/cpmfetch.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/writteninreverse/public_html/wp/wp-content/themes/wppremade04/header.php on line 46

Fatal error: Class 'cpm' not found in /home/writteninreverse/public_html/wp/wp-content/themes/wppremade04/header.php on line 47[/quote]

and I can't seem to solve it. I am still working on the theme (CSS styling), but I thought I'd install it to see if the code works. What am I missing or doing wrong?

CPMfetch code is:

[code]<?php
  
include "./folio/cpmfetch/cpmfetch.php";
  
$objCpm = new cpm("./folio/cpmfetch/cpmfetch_config.php");
  
$objCpm->cpm_viewLastAddedMedia(2,5);
  
$objCpm->cpm_close();
?>

Link to site: http://writteninreverse.starszz.com/wp/?preview_theme=wppremade04
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 723
    • GMC Design Photo Gallery
Re: CPMfetch errors: "Warning: Failed opening..."
« Reply #1 on: May 15, 2015, 04:38:05 am »

The example given that you followed assumed you were adding the code to your webroot with gallery located one level down in folio directory...
If you are adding this code to pages in the wp directory, you need to change the code ./folio to ../folio (both occurrences).

As you have it coded it is looking for folio as a folder under wp.

Greg
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Manutjee

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 77
Re: Re: CPMfetch errors: "Warning: Failed opening..."
« Reply #2 on: May 15, 2015, 02:16:39 pm »

The example given that you followed assumed you were adding the code to your webroot with gallery located one level down in folio directory...
If you are adding this code to pages in the wp directory, you need to change the code ./folio to ../folio (both occurrences).

As you have it coded it is looking for folio as a folder under wp.

Greg

Thanks it worked! I was searching my butt off, haha!
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 22 queries.