Advanced search  

News:

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

Pages: [1]   Go Down

Author Topic: It stopped displaying for some reason!  (Read 4002 times)

0 Members and 1 Guest are viewing this topic.

Fred_Brown

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
It stopped displaying for some reason!
« on: June 19, 2007, 02:55:40 am »

cpmfetch has worked very well for months but all of a sudden returns giberish like this
������|j0y {n P9Z(лY[$AZZh 2,b1v˦Z̄")W6,Kǜ�1{)@vSk&4SNw݃+ MKdJ|l<]{h_K<)/3Aj*kaT?|16$n ���4/��
!

I'm sure I've mucked something up but I can't solve the issue. Here is the code in the .htm page;

<!--#include virtual="./photos/cpmfetch/testing1.php" -->

Here is the .php file;

<?php
include "./cpmfetch.php";
$objCpm = new cpm("./cpmfetch_config.php");
$objCpm->cpm_viewRandomMedia(1,1,array( 'subtitle' => '%t' , 'cellstyle' => 'gallerytext' , 'imagestyle' => 'a:link'  ));
$objCpm->cpm_close();
?>

I'm sure this is my blunder and has nothing to with cpmfetch, a great tool! I'm sure I'm missing something obvious!
Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: It stopped displaying for some reason!
« Reply #1 on: June 19, 2007, 03:39:58 am »

cpmfetch has worked very well for months but all of a sudden returns giberish like this
������|j0y {n P9Z(лY[$AZZh 2,b1v˦Z̄")W6,Kǜ�1{)@vSk&4SNw݃+ MKdJ|l<]{h_K<)/3Aj*kaT?|16$n ���4/��
!

I'm sure I've mucked something up but I can't solve the issue. Here is the code in the .htm page;

<!--#include virtual="./photos/cpmfetch/testing1.php" -->

Here is the .php file;

<?php
include "./cpmfetch.php";
$objCpm = new cpm("./cpmfetch_config.php");
$objCpm->cpm_viewRandomMedia(1,1,array( 'subtitle' => '%t' , 'cellstyle' => 'gallerytext' , 'imagestyle' => 'a:link'  ));
$objCpm->cpm_close();
?>

I'm sure this is my blunder and has nothing to with cpmfetch, a great tool! I'm sure I'm missing something obvious!

Dude...

Wierd...

Did you try running the php file directly?

Did you change encoding in cpg or something?

Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

Fred_Brown

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: It stopped displaying for some reason!
« Reply #2 on: June 19, 2007, 10:26:14 pm »

Dude...

Wierd...

Did you try running the php file directly?

Did you change encoding in cpg or something?



- The first thing I did was update my version of cpmfetch and so it's directory changed to inside /photos
- When running the install, everything worked out great, I could see the four random pictures and I can run
the php file directly. This is a good thing!
- I made sure cpg (Coppermine Photo Gallery 1.4.9) config page had Character encoding utf-8
- I noted that with cpmfetch version changes to 2.0.0, I would have to change the path to run the code from my home
page but I wanted to leave the home page with a .htm extention so I am using something like

<!--#include virtual="./photos/cpmfetch/test.php" -->

and test.php would look like the following because it's in the "/photos/cpmfetch" directory
<?php
  include "./cpmfetch.php";
  $objCpm = new cpm("./cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,4);
  $objCpm->cpm_close();
?>

- To get it to work before, I remember setting a user defined Apache extention handler ( .htm   server-parsed)
which created the necessary .htacess file with the line "AddHandler server-parsed .htm" in my home directory. I tested this <!--#echo var="DATE_LOCAL" --> in the .htm file and it returns the date properly, so I know the SSI's work.
- I remember that the documentation said that concerning SSI and cpmfetch, "XBitHack On" could be added to the .htaccess file. On Off makes no difference.
- A permission thing? Why would the cpmfetch install.php work and not my test.php? Anyway, the files have the same permissions; -rwxr-xr-x
- No, I figure I'm doing something silly and missing something obvious



Logged

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: It stopped displaying for some reason!
« Reply #3 on: June 20, 2007, 04:15:52 am »

- The first thing I did was update my version of cpmfetch and so it's directory changed to inside /photos
- When running the install, everything worked out great, I could see the four random pictures and I can run
the php file directly. This is a good thing!
- I made sure cpg (Coppermine Photo Gallery 1.4.9) config page had Character encoding utf-8
- I noted that with cpmfetch version changes to 2.0.0, I would have to change the path to run the code from my home
page but I wanted to leave the home page with a .htm extention so I am using something like

<!--#include virtual="./photos/cpmfetch/test.php" -->

and test.php would look like the following because it's in the "/photos/cpmfetch" directory
<?php
  include "./cpmfetch.php";
  $objCpm = new cpm("./cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,4);
  $objCpm->cpm_close();
?>

- To get it to work before, I remember setting a user defined Apache extention handler ( .htm   server-parsed)
which created the necessary .htacess file with the line "AddHandler server-parsed .htm" in my home directory. I tested this <!--#echo var="DATE_LOCAL" --> in the .htm file and it returns the date properly, so I know the SSI's work.
- I remember that the documentation said that concerning SSI and cpmfetch, "XBitHack On" could be added to the .htaccess file. On Off makes no difference.
- A permission thing? Why would the cpmfetch install.php work and not my test.php? Anyway, the files have the same permissions; -rwxr-xr-x
- No, I figure I'm doing something silly and missing something obvious

PM Me (or post here):
a link to the index page
a link to the test.php

As for the date - you are correct that it shows SSI is working, but it can be limited by the configuration of the server to what exactly is allowed.  In any case, it should not cause garbled output to be displayed. 

The XBitHack is preferred (if allowed) over telling the server to parse every htm file that comes up.

Anyway - none of this explains your issue, so post the stuff above and we shall see


Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco

vuud

  • Moderator
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1803
  • [cpmfetch.fistfullofcode.com]
    • Fist Full Of Code
Re: It stopped displaying for some reason!
« Reply #4 on: June 20, 2007, 09:42:57 pm »

- The first thing I did was update my version of cpmfetch and so it's directory changed to inside /photos
- When running the install, everything worked out great, I could see the four random pictures and I can run
the php file directly. This is a good thing!
- I made sure cpg (Coppermine Photo Gallery 1.4.9) config page had Character encoding utf-8
- I noted that with cpmfetch version changes to 2.0.0, I would have to change the path to run the code from my home
page but I wanted to leave the home page with a .htm extention so I am using something like

<!--#include virtual="./photos/cpmfetch/test.php" -->

and test.php would look like the following because it's in the "/photos/cpmfetch" directory
<?php
  include "./cpmfetch.php";
  $objCpm = new cpm("./cpmfetch_config.php");
  $objCpm->cpm_viewLastAddedMedia(1,4);
  $objCpm->cpm_close();
?>

- To get it to work before, I remember setting a user defined Apache extention handler ( .htm   server-parsed)
which created the necessary .htacess file with the line "AddHandler server-parsed .htm" in my home directory. I tested this <!--#echo var="DATE_LOCAL" --> in the .htm file and it returns the date properly, so I know the SSI's work.
- I remember that the documentation said that concerning SSI and cpmfetch, "XBitHack On" could be added to the .htaccess file. On Off makes no difference.
- A permission thing? Why would the cpmfetch install.php work and not my test.php? Anyway, the files have the same permissions; -rwxr-xr-x
- No, I figure I'm doing something silly and missing something obvious

Well Fred,  I give up.  I took a look at your code and that all looks fine.  It does seem as though the SSI is executing, so its not an XBITHack or handler problem.

I did some googling about this and some people say you cannot do an SSI on a php file, but others say you cant.  Still others say it is a server configuration thing. 

So at this point, I am going to note that the php file works fine directly.  I would take this up with your provider, or someone who is better at apache ssi / php stuff than I am.  I have made it work for me and others before, so it was possible at one time.  Who knows.

If you can, post back a solution if you find one.

Sorry

Logged
Please post for help to the forum... PM me only if you are sending security related items (passwords, security problems, etc).

cpmFetch - Images, RSS feeds from CPG from outside CPG
New release notification signup also. 
See http://cpmfetch.fistfullofco
Pages: [1]   Go Up
 

Page created in 0.05 seconds with 19 queries.