Problems Embdedding Serendipity Into HTML

Having trouble installing serendipity?
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Where does test.php lie? In the root? Then it should work.

Check your webserver error log if it doesn't work, there must be some kind of error notice logged.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Lil
Regular
Posts: 19
Joined: Wed May 02, 2007 4:43 pm

Post by Lil »

yes test.php is in wwwroot/

I don't know if these are the right logs but the last line in the logs on the webserver are

2007-05-03 14:38:33 W3SVC1368 RHEA 83.245.63.111 GET /test.php - 80 - 82.69.116.253 HTTP/1.1 Mozilla/5.0+(Macintosh;+U;+PPC+Mac+OS+X+Mach-O;+en-US;+rv:1.8.1.1)+Gecko/20061204+Firefox/2.0.0.1 serendipity[old_session]=e47ff95910cde5121670f44fae64469f;+PHPSESSID=61410b68e7346c6de2ef1f2e87a31e18 - www.peoplepassionplanet.com 404 0 0 2392 571 328
Lil
Regular
Posts: 19
Joined: Wed May 02, 2007 4:43 pm

Post by Lil »

having asked the host, that's all the logs there are.

with

<?php
include("C:\Domains\peoplepassionplanet.com\blog\wrapper.php");
?>

in test.php

it does return the page again but still without the test post from index.php

:cry:
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

If you change the chdir() commands to also use C:\.... paths, does it work then?

The logs you posted are only the ACCESS logs. What you need in case of "page cannot be displayed" pages are the ERROR logs.

HTH,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Lil
Regular
Posts: 19
Joined: Wed May 02, 2007 4:43 pm

Post by Lil »

no it doesn't work :cry:

i asked the host for error logs but they said there aren't any
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

There must be error logs. If a "Page cannot be found" error happens, there ARE errorlogs.

If your provider cannot provide them, you should think about moving to a provider who actually knows what he's doing. ;)

It's hard to give you a helping hand without knowing about the errors that seem to happen.

Please post yoru current wrapper.php and test.php contents. And I assume you have not changed any other .php files in the s9y directories.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Lil
Regular
Posts: 19
Joined: Wed May 02, 2007 4:43 pm

Post by Lil »

Hi Garvin,

Thanks for your help I really appreciate it, I'll ask for the error logs again.

Here's my test.php page which is located here: http://www.peoplepassionplanet.com/

<?php
include("C:/Domains/peoplepassionplanet.com/blog/wrapper.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<div>Non-Serendipity content goes here.</div>
<div>
<?php
echo $serendipity_contents;
?>
</div>

<div>More non-Serendipity content here.</div>
</body>
</html>



And here's my wrapper.php page which is located here:
http://www.peoplepassionplanet.com/blog/

<?php
ob_start();
chdir("C:/Domains/peoplepassionplanet.com/wwwroot/blog/");
require("index.php");
chdir("C:/Domains/peoplepassionplanet.com/wwwroot/");
$serendipity_contents = ob_get_contents();
ob_end_clean();
?>

All I have changed is the index file in the serendipity_admin.php configuration to say wrapper.php
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Basically it should work. There might be an issue with your PHPs output buffering - please ask your provider which PHP version is running?

Try to modify wrapper.php like this:

Code: Select all

<?php
ob_start();
chdir("C:/Domains/peoplepassionplanet.com/wwwroot/blog/");
require("index.php");
chdir("C:/Domains/peoplepassionplanet.com/wwwroot/");
$serendipity_contents = ob_get_contents();
echo "1) Captured " . strlen($serendipity_contents) . " Bytes.<br />";
ob_end_clean();
echo "2) Captured " . strlen($serendipity_contents) . " Bytes.<br />";
?>
Then call wrapper.php via HTTP and see if it gives you any output?

Regards,
garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Lil
Regular
Posts: 19
Joined: Wed May 02, 2007 4:43 pm

Post by Lil »

thanks - it outputs

2) Captured 12635 Bytes.

and the hosting panel says php 4
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

If you change your test.php and after the include(...) you add this:

Code: Select all

print_R($GLOBALS);
you should get an output that lists all variables. Can you see if any "serendipity" related variables are set there?

It seems the wrapper.php itself is working, but when being included from the test.php file, it is either not called or... hey, hang on.

Try to replace "include(...)" in test.php with "require(...)". If the script then outputs a blank page it means a fatal error that happens because the file could not be found! In this case, the include of wrapper.php is still not working because the paths are still wrong!

In that case you'd definitely need to make your server provider check out the error logs and see why you cannot access/include the mentioned file. It might even be a safe_mode or open_basedir problem of a wrong configuration of your provider!

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Lil
Regular
Posts: 19
Joined: Wed May 02, 2007 4:43 pm

Post by Lil »

Hi,

If I change it to require it outputs this:

Fatal error: require() [function.require]: Failed opening required 'C:/Domains/peoplepassionplanet.com/blog/wrapper.php' (include_path='.;C:\php5\pear') in C:\Domains\peoplepassionplanet.com\wwwroot\test.php on line 2
PHP Fatal error: require() [function.require]: Failed opening required 'C:/Domains/peoplepassionplanet.com/blog/wrapper.php' (include_path='.;C:\php5\pear') in C:\Domains\peoplepassionplanet.com\wwwroot\test.php on line 2

and if I keep it as include and add print_R($GLOBALS);

it outputs a whole load of stuff which you can see here:

http://www.peoplepassionplanet.com/test.php
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Perhaps I'm just missing something, but it looks like we've dropped a directory. Isn't:
C:/Domains/peoplepassionplanet.com/blog/wrapper.php
supposed to be
C:/Domains/peoplepassionplanet.com/wwwroot/blog/wrapper.php
?

That would explain why it can't require the file, and why there are no Serendipity variables in the print_r($GLOBALS) call.
Judebert
---
Website | Wishlist | PayPal
Lil
Regular
Posts: 19
Joined: Wed May 02, 2007 4:43 pm

Post by Lil »

doh !

you're right - and if I put wwwroot back into test.php it goes back to page cannot be found

confused!
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

I just visited your pages.

There was a strange anomaly. I visited http://www.peoplepassionplanet.com/test.php, and it gave me a blog page, indicating "Blog Content should follow here:". Later, it gave me an Internet-Explorer looking "page not found" error, which must have been generated by your webserver, since I'm using FireFox. A third visit gave me back the empty blog; a fourth, "Parse error: parse error, unexpected T_STRING in C:\Domains\peoplepassionplanet.com\wwwroot\blog\wrapper.php on line 4".

Perhaps you're still making changes. In any case, at least we're actually calling the wrapper.php. It looks like the most recent change forgot to quote a string.

Visiting blog/index.php returns an unformatted blog page, as expected. Visiting blog/wrapper.php returns a blank page (also as expected, since we're assigning the value to a variable). When exactly does test.php return the "not found", and when the blogless content?

Please try this alternate wrapper.php:

Code: Select all

<?php
chdir("C:/Domains/peoplepassionplanet.com/wwwroot/blog/");
ob_start();
require("index.php");
$serendipity_contents = ob_get_contents();
ob_end_clean();
chdir("C:/Domains/peoplepassionplanet.com/wwwroot/");
?> 
You can see it just rearranges things to put all the output bufferring as close as possible. It looks like it should work. I know I've gotten it to work before.

Although it shouldn't make any difference, also try changing the echo command in test.php to a print, or a print_r.
Judebert
---
Website | Wishlist | PayPal
Lil
Regular
Posts: 19
Joined: Wed May 02, 2007 4:43 pm

Post by Lil »

Hi, thanks for looking.

This is the code I have with page cannot be found:

in test.php

<?php
include("C:/Domains/peoplepassionplanet.com/wwwroot/blog/wrapper.php");
?>

in wrapper.php

<?php
ob_start();
chdir("C:/Domains/peoplepassionplanet.com/wwwroot/blog/");
require("index.php");
chdir("C:/Domains/peoplepassionplanet.com/wwwroot/");
$serendipity_contents = ob_get_contents();
ob_end_clean();
?>

To get the blogless content I take off the c:/ at the front of the paths

The wrapper code you have given gives the same results as above, the print command didn't seem to make a difference either.

As much as I don't want to, I think I'm going to have to abandon this soon and hack about with css instead for the next few days.
Post Reply