CPMfetch errors: "Warning: Failed opening..." CPMfetch errors: "Warning: Failed opening..."
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

CPMfetch errors: "Warning: Failed opening..."

Started by Manutjee, May 14, 2015, 09:23:00 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Manutjee

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:

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

gmc

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!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Manutjee

Quote from: gmc 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

Thanks it worked! I was searching my butt off, haha!