1

Topic: extern.php problem

Hi,

I've just changed my hoster. I have transferred all my DB.
The forum works good but I have an only problem on my index page of my site concerning extern.php
In my index I have this:

<?php
include('http://www.pluriservices.net/forum/extern.php?action=active&show=8');
?>

It gives this:

Warning: main(http://www.pluriservices.net/forum/exte … amp;show=8): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in /home/ju37853/index.php on line 149

Warning: main(): Failed opening 'http://www.pluriservices.net/forum/exte … amp;show=8' for inclusion (include_path='') in /home/ju37853/index.php on line 149

I think it is due to the host migration.

How to correct this problem?

Ludo

2 (edited by zaher 2004-10-23 23:54)

Re: extern.php problem

your hoster is disable allow_url_fopen in php.ini
allow_url_fopen = Off
so you cannot use extern.php in your site sad

>How to correct this problem?
modify or build another extern.php file to include it as normal file let us name it as internal.php
include('./forum/internal.php');

see
http://www.punres.org/viewtopic.php?id=89
there is a file active_topics.php i included in home.php to show the active topics in home page.

If your people come crazy, you will not need to your mind any more.

3 (edited by Ludo 2004-10-24 08:51)

Re: extern.php problem

it seems to be enabled.
When I Looked in my php info I saw it is on for local value and master value
I don't understand...

Ludo

4 (edited by Ludo 2004-10-24 17:46)

Re: extern.php problem

any idea Rickard?
May the problem be linked with dns?
Do you think reinstalling the forum in the whole would solve the problem?
Can it be done whithout loosing messages and settings.
Last question: Has the install process a link with the good working of extern.php ?

Ludo

Re: extern.php problem

Well, try including it with a relative path instead of using the full URL.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

6

Re: extern.php problem

I tried puting

<?php
include('/forum/extern.php?action=active&show=8');
?>


and it gives

Warning: main(): Unable to access /forum/extern.php?action=active&show=8 in /home/ju37853/index.php on line 149

Warning: main(/forum/extern.php?action=active&show=8): failed to open stream: No such file or directory in /home/ju37853/index.php on line 149

Warning: main(): Failed opening '/forum/extern.php?action=active&show=8' for inclusion (include_path='') in /home/ju37853/index.php on line 149

Any idea?

Ludo

7

Re: extern.php problem

You might need to use a full path: /home/ju37853/forum/extern.php

8

Re: extern.php problem

Isn't the problem here that '?action=active&show=8' is getting treated as part of the file name rather than as a paremeter being passed to extern.

9

Re: extern.php problem

hcgtv wrote:

You might need to use a full path: /home/ju37853/forum/extern.php

I tried with that and it always gives the same error message.
I really don't understand what is happening because this worked good with my foreign hoster.

Any idea?

Re: extern.php problem

Paul: Yes, but that would mean that allow_url_fopen is disabled, but according to Ludo, it isn't.

Ludo: I honestly don't know what's wrong. What does this script output:

<?php exit(ini_get('allow_url_fopen')); ?>
"Programming is like sex: one mistake and you have to support it for the rest of your life."

11

Re: extern.php problem

Rickard wrote:

Paul: Yes, but that would mean that allow_url_fopen is disabled, but according to Ludo, it isn't.

Ludo: I honestly don't know what's wrong. What does this script output:

<?php exit(ini_get('allow_url_fopen')); ?>

The scripts execute and it gives  1

I also tell you that I've just tried to reinstall the forum but there is always the error

Re: extern.php problem

Try chmodding the extern.php script to 777.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

13

Re: extern.php problem

My be it is blocked to access ports with php code or any code. (i am not expert with servers sad ).

If your people come crazy, you will not need to your mind any more.

Re: extern.php problem

thing is if we can see the file theres no reason why the server should get a 403 error :S

15 (edited by Ludo 2004-10-25 07:26)

Re: extern.php problem

Rickard wrote:

Try chmodding the extern.php script to 777.

That's done but no result... always the same error.

just a precision. I have several websites. As I'm curious, I tried to call the inculde.... from another website not hosted in the same hoster. I'm very surprised to see extern.php works when it is called from the outside.
I really think it's a hoster problem.
Is i t possible to call extern.php with fopen?

You can see my phpinfo here:
http://www.pluriservices.net/test.php


Ludo

16 (edited by Ludo 2004-10-25 09:29)

Re: extern.php problem

My hoster has just informed me that it is not possible to make an include with parameters for security reasons... He told me that you code is not secure enough...

So, I've tried another thing.
I put:

$_GET['action'] = 'active';
$_GET['show'] = 8;
include('/home/ju37853/forum/extern.php')

And I got the following error:

The file 'config.php' doesn't exist or is corrupt. Please run install.php to install PunBB first.

I don't understand. My config.php exists and all is correct.
Any idea?

17 (edited by Ludo 2004-10-25 20:03)

Re: extern.php problem

I've got the solution!

in extern.php , I modified punroot with '/home/ju37853/forum/'

and it works now!

But there is now another problem.

The navigator don't read anything after the code calling extern

<?php
$_GET['action'] = 'active';
$_GET['show'] = 8;
include('/home/ju37853/forum/extern.php');
?>

All the code after this is not seen. So I only got an half page...

What's happening?

Re: extern.php problem

http://www.pluriservices.net/forum/exte … amp;show=8

19 (edited by Ludo 2004-10-25 10:40)

Re: extern.php problem

I see it works.

The problem is when it is integrated in a page with the include fonction. This is why I try others solution.
One of this solution works but does not enable the page to screen in the whole.
See here:
http://www.pluriservices.net/test2.php
and here:
http://pluriservices.net
and you'll see that there is the footer missing.

Ludo

20

Re: extern.php problem

No idea?

Hummm, I'm sure that with modifications in extern.php it would work but I don't know php engouh to do it wink

Ludo

Re: extern.php problem

try adding a ; to the end of include('/home/ju37853/forum/extern.php')

22

Re: extern.php problem

Connorhd wrote:

try adding a ; to the end of include('/home/ju37853/forum/extern.php')

oups, in fact there is ever a ;
I just forgot to put it here
So I edit my post to modify it

The problem does not come from here...

Any idea?

thanksfully,

Ludo

23

Re: extern.php problem

I also tried with that code but it has the same effect:

<?php
$ancien_get_action = $_GET['action'];
$ancien_get_show = $_GET['show'];
$_GET['action'] = 'active';
$_GET['show'] = 8;
include($_SERVER['HTTP_RACINE'] . '/forum/extern.php');
$_GET['action'] = $ancien_get_action;
$_GET['show'] = $ancien_get_show;
?>

Re: extern.php problem

Ludo wrote:

My hoster has just informed me that it is not possible to make an include with parameters for security reasons... He told me that you code is not secure enough...

Then he needs to do his homework. There is nothing inherently insecure with extern.php.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

25 (edited by Ludo 2004-10-25 20:22)

Re: extern.php problem

Rickard wrote:
Ludo wrote:

My hoster has just informed me that it is not possible to make an include with parameters for security reasons... He told me that you code is not secure enough...

Then he needs to do his homework. There is nothing inherently insecure with extern.php.

I know Rickard that your code is secure. My hoster disagree.
As I don't want to change again of hoster (I've just done it two days ago...) I'm trying to find a solution.

May the problem come from "exit" in extern.php ? Someone told me that I could replace exit by return. What do you think about it?

Ludo