1 (edited by JoeWesthead 2004-01-08 18:30)

Topic: Problem with extern.php

I just looked at extern.php and put it onto my webpage, but got the following error:

Warning: Failed opening 'http://joey.gtrx.net/site/forums/extern … tion=stats' for inclusion (include_path='.;c:\php4\pear') in C:\FoxServ\www\site\index.php on line 236

The URL for extern.php and the URL for index.php are fine, I think the problem is with "include_path='.;c:\php4\pear'" - It looks weird to me sad

I'm no PHP programmer, so I'm not sure what this is all about.

Any help?

2

Re: Problem with extern.php

Ah, maybe the ".;" shouldn't be there..

3

Re: Problem with extern.php

Still wouldn't know where to change that though..

Re: Problem with extern.php

Well, since what you are including is an URL, the include path is ignored. I really don't know what could be wrong. Check your php.info and see if allow_url_fopen is enabled.

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

5 (edited by JoeWesthead 2004-01-08 21:04)

Re: Problem with extern.php

Directive           | Local Value |  Master Value 
allow_url_fopen         1                     1 

Does that mean it should be ok?

How much has extern.php been tested?

Re: Problem with extern.php

The problem has nothing to do with extern.php. The problem is that, for some reason, PHP cannot find the URL from where you are including it.

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

7

Re: Problem with extern.php

What do you suggest?

Re: Problem with extern.php

I just found this:

The Windows versions of PHP earlier than PHP 4.3 did not support remote file accessing for the following functions: include(), include_once(), require(), require_once(), and the imagecreatefromXXX functions in the Reference XLI, Image functions extension.

Are you running a version of PHP prior to 4.3.0?

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

9

Re: Problem with extern.php

Ah that'd be it - 4.2.2.

Never had a problem before. I'd best get downloading smile

Kennel, is there anything he can't solve?

10

Re: Problem with extern.php

Good call!

I've updated to PHP 4.3.4 and it works swimmingly big_smile

Re: Problem with extern.php

Nice to hear :)

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

12

Re: Problem with extern.php

I've come back to the PC after a weekend away, and the problem has started again. I checked and PHP is still on 4.3.4, and I did a clean insall of Pun, same error :x

Error wrote:

Warning: main(http://<snip>/site/forums/extern.php?action=stats): failed to open stream: Bad file descriptor in c:\apache\htdocs\site\index.php on line 63

Warning: main(): Failed opening '<snip>/site/forums/extern.php?action=stats' for inclusion (include_path='.;c:\php4\pear') in c:\apache\htdocs\site\index.php on line 63

Where <snip> is my URL..

Re: Problem with extern.php

And allow_url_fopen is still enabled?

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

14

Re: Problem with extern.php

Yup sad

15

Re: Problem with extern.php

Ah - think I have found the problem. As we discussed in IRC, I am now using DirectUpdate to mask my IP address.

I opened up the PHP file, and changed:

<?php include('http://joey.gtrx.net/site/forums/extern.php?action=stats'); ?>

to:

<?php include('http://localhost/site/forums/extern.php?action=stats'); ?>

and it works ok. Not sure what will happen when the site goes live to the public though.

Re: Problem with extern.php

localhost should be fine as long as your forums are hosted on the same server as your front page.

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

17

Re: Problem with extern.php

Cool. Any thoughts as to why it may not have worked?

18

Re: Problem with extern.php

And maybe this could go into the FAAQ for next time..

Re: Problem with extern.php

Yes, maybe it should.

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

20

Re: Problem with extern.php

Here you can read about your problem, http://se.php.net/include/

21

Re: Problem with extern.php

Om man har version 4.2.2 finns det inget att göra åt detta då?

Re: Problem with extern.php

Svinpäls Nr1 wrote:

Om man har version 4.2.2 finns det inget att göra åt detta då?

Sure, just include it with a relative path instead of the URL.

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

23

Re: Problem with extern.php

I have tried both absolut and relative paths but get an error anyway sad

Warning: Failed opening 'punbb_1_1_2/extern.php?action=active' for inclusion (include_path='.:/usr/share/pear:/usr/share/php/PEAR') in /customers/svinpalsarna.com/svinpalsarna.com/httpd.www/kontakt.php on line 415

or like this:

Warning: Unable to access /customers/svinpalsarna.com/svinpalsarna.com/httpd.www/punbb_1_1_2/extern.php?action=active in /customers/svinpalsarna.com/svinpalsarna.com/httpd.www/kontakt.php on line 415

Warning: Failed opening '/customers/svinpalsarna.com/svinpalsarna.com/httpd.www/punbb_1_1_2/extern.php?action=active' for inclusion (include_path='.:/usr/share/pear:/usr/share/php/PEAR') in /customers/svinpalsarna.com/svinpalsarna.com/httpd.www/kontakt.php on line 415

Re: Problem with extern.php

From what directory are you including it and with what include command?

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

25

Re: Problem with extern.php

I try to include it from the webroot from my page kontakt.php with the command:

include(punbb_1_1_2/extern.php?action=active');

also tried:

include('/customers/svinpalsarna.com/svinpalsarna.com/httpd.www/punbb_1_1_2/extern.php?action=active');