PHP?

Creating and modifying plugins.
Post Reply
VideoRob
Regular
Posts: 21
Joined: Fri Feb 01, 2008 6:11 am

PHP?

Post by VideoRob »

What plugin do I need to install so php can work on my index? I have a simple piece of php that I need to put in the sidebar

I've tried using the "External PHP Application" plugin but it didn't seem to work, either that or it wouldn't install properly. I can't see any other php plugin
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: PHP?

Post by garvinhicking »

Hi!

Check http://www.s9y.org/78.html#A4 and http://www.s9y.org/78.html#A5 for how to put it in your index.tpl.

Apart frmo that, the "External PHP ApplicatioN" plugin should work. how did you configure it? What do you mean with "wouldn't install properly"?

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/
VideoRob
Regular
Posts: 21
Joined: Fri Feb 01, 2008 6:11 am

Post by VideoRob »

Thanks for your response.

When I try to install the External PHP Application as a sidebar plugin I get this error in the sidebar

Warning: show(/usr/home/rob/domains/mydomain.com/public_html/include/your_php.inc.php) [function.show]: failed to open stream: No such file or directory in /usr/home/rob/domains/mydomain.com/public_html/plugins/serendipity_plugin_externalphp/serendipity_plugin_externalphp.php on line 76

Warning: show(/usr/home/rob/domains/mydomain.com/public_html/include/your_php.inc.php) [function.show]: failed to open stream: No such file or directory in /usr/home/rob/domains/mydomain.com/public_html/plugins/serendipity_plugin_externalphp/serendipity_plugin_externalphp.php on line 76

Warning: show() [function.include]: Failed opening '/usr/home/rob/domains/mydomain.com/public_html/include/your_php.inc.php' for inclusion (include_path='.:/usr/local/lib/php:/usr/home/rob/domains/mydomain.com/public_html/:/usr/home/rob/domains/mydomain.com/public_html/bundled-libs/') in /usr/home/rob/domains/mydomain.com/public_html/plugins/serendipity_plugin_externalphp/serendipity_plugin_externalphp.php on line 76

When I install it as an event plugin, I looks like its installed properly but the php doesn't work.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

This error means, you configured a wrong path inside the plugin. The filename you entered does not exist!

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/
VideoRob
Regular
Posts: 21
Joined: Fri Feb 01, 2008 6:11 am

Post by VideoRob »

How do I set External PHP Application up? The file I want to add isn't on the same site and I want the php to work in the sidebar

All I want to do is add this piece of php into the sidebar

<?php
@ini_set('expose_php', 'Off');
@include "http://www.domain2.com/lo/site_templates/site_4_6.php";
?>
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Create a script like "remote.php" inside your s9y directory. Then configure the sidebar plugin to include the file "/path/to/your/s9y/remote.php". The remote.php should contain this code:

Code: Select all

<?php 
ini_set('expose_php', 'Off'); 
include "http://www.domain2.com/lo/site_templates/site_4_6.php"; 
?>
REMBER that not all PHP servers are configured to allow you to include PHP code from foreign servers! Most PHP servers do not allow include calls over HTTP. Remove the "@" to see possible error messages about that.

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/
Post Reply