Problems Embdedding Serendipity Into HTML
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
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
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/
# 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/
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
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
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
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
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/
# 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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
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
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/
# 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/
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
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:
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:
Then call wrapper.php via HTTP and see if it gives you any output?
Regards,
garvin
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 />";
?>
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/
# 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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
If you change your test.php and after the include(...) you add this:
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
If you change your test.php and after the include(...) you add this:
Code: Select all
print_R($GLOBALS);
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/
# 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/
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
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
Perhaps I'm just missing something, but it looks like we've dropped a directory. Isn't:
That would explain why it can't require the file, and why there are no Serendipity variables in the print_r($GLOBALS) call.
supposed to beC:/Domains/peoplepassionplanet.com/blog/wrapper.php
?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.
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:
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.
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/");
?>
Although it shouldn't make any difference, also try changing the echo command in test.php to a print, or a print_r.
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.
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.