Problem with printing module

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
oliver341
Forum Members
Forum Members
Posts: 89
Joined: Sat Feb 23, 2008 3:51 pm

Problem with printing module

Post by oliver341 »

Hi,

When I try printing a page with the Printing Module (using "Print this page") I get a blank page.

On further investigation, it appears my webhost does not allow:

Code: Select all

file_get_contents("http://www.mysite.co.uk/test.txt")
It returns "Connection Refused" in the Apache error log.

However it does seem to allow:

Code: Select all

file_get_contents("test.txt")
Is there anything I can do about this, or does this issue mean the Printing Module must be disabled on my site?

Thanks.
Last edited by oliver341 on Sat Aug 22, 2009 11:18 pm, edited 1 time in total.
studip101
Forum Members
Forum Members
Posts: 15
Joined: Wed Jun 13, 2007 8:31 am

Re: Problem with printing module

Post by studip101 »

try setting allow_url_fopen to 1 in your php.ini file
oliver341
Forum Members
Forum Members
Posts: 89
Joined: Sat Feb 23, 2008 3:51 pm

Re: Problem with printing module

Post by oliver341 »

I checked the allow_url_fopen option and it was enabled. However it seems my webhost does not allow the server to connect to itself, so I cannot use the Printing Module.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: Problem with printing module

Post by Rolf »

Hi oliver341

Perhaps you can find some answers here:
http://forum.cmsmadesimple.org/index.ph ... #msg178033

Grtz. Rolf
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
oliver341
Forum Members
Forum Members
Posts: 89
Joined: Sat Feb 23, 2008 3:51 pm

Re: Problem with printing module

Post by oliver341 »

Rolf wrote: Perhaps you can find some answers here:
http://forum.cmsmadesimple.org/index.ph ... #msg178033
Thanks Rolf.

Unfortunately I've hit a dead end. I've uploaded the full package as in point 1, and also confirmed allow_url_fopen is enabled by using PHP phpinfo() as in point 2.

The problem here is that the Printing Module uses a command like this to get its data for inclusion (not real, just an example):
file_get_contents("http://www.myhost.co.uk/index.php?option=print")

The trouble is, this command makes the server connect to itself, and this results in the server rejecting the connection. I have no idea why my webhost behaves like this, but they have said it's for security reasons and they will not change it.

Oh well, at least the Printing Module is the only thing affected!

I suppose the Printing Module could be coded in another way to avoid the server connecting to itself, but the vast majority of users are probably unaffected so there's probably no point in doing it.
Post Reply

Return to “CMSMS Core”