1 (edited by KeyDog 2009-01-01 11:36)

Topic: URL file-access is disabled in the server configuration in

Warning: getimagesize() [function.getimagesize.php]: URL file-access is disabled in the server configuration in
pun_attachment/pun_attach.php on line 30


Suddenly I am getting this warning for pun_attachment extension

Where to I enable URL file-access?
Was working fine until couple of days ago....

Operating system: FreeBSD
PHP: 5.2.8

Re: URL file-access is disabled in the server configuration in

Try adding

ini_set('allow_url_fopen', 'On');

at the beginning of the script.

3 (edited by KeyDog 2009-01-01 16:34)

Re: URL file-access is disabled in the server configuration in

thanks, but that hasn't worked for me yet.
put that code in pun_attach.php right before

    if (!defined('FORUM')) die();

reading in other php forums...  is there some file "php.ini" - a global setting I can modify... ?

or do I need to modify another file... or put it in another place in pun_attach.php

EDIT: if I drop this code it works ... is it important? big_smile

        }
        else
        {
            list($width, $height, , ) = getimagesize($forum_config['attach_icon_folder'].$names[$i]);

            if (($width > 20) || ($height > 20))
                $pun_attach_errors['big_images'][] = '<li class="warn"><span>'.$forum_config['attach_icon_folder'].$names[$i].'</span></li>';

4 (edited by MattF 2009-01-01 17:15)

Re: URL file-access is disabled in the server configuration in

Without that code, there is no image size restriction on whatever images are in that icon directory, it would appear from that snippet.

Re: URL file-access is disabled in the server configuration in

suppose I can live with that smile there's option to drop icons anyway in admin area of pun_attachement.

users should never be none the wiser....

of course if anyone knows why getimagesize is giving trouble - all the better....

thx

6 (edited by MattF 2009-01-01 17:24)

Re: URL file-access is disabled in the server configuration in

KeyDog wrote:

of course if anyone knows why getimagesize is giving trouble - all the better....

Your host has locked PHP down. Contact them if the above workaround doesn't work, (which I doubt it will).

Edit: Is this on your own server or a hosted server?

Re: URL file-access is disabled in the server configuration in

If you have access to php.ini, set "allow_url_fopen" to "On" (both without quotes).

Re: URL file-access is disabled in the server configuration in

hosted server i'm afraid.
will contact them to find out how to get access / if it's possible (php.ini)

Re: URL file-access is disabled in the server configuration in

This is still a problem by the way of this attachment extension.
I just tried installing fresh version of the latest pun_attachment and get a dozen lines of warning code with that error when I click in Admin, Settings, Attachments.... LINE 26!


PHP 5.2.9
MySql improved 5.1.30

Re: URL file-access is disabled in the server configuration in

Idem : Warning: getimagesize(http://7iemecie.free.fr/forum/extensions/pun_attachment/img/text.png) [function.getimagesize]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /mnt/126/free.fr/0/2/7iemecie/forum/extensions/pun_attachment/pun_attach.php on line 26

there are not solution ?

Thank

Re: URL file-access is disabled in the server configuration in

Has there been a fix for this yet? It seems pretty important.

I just put a forum on a hosted server and got the same error. However, I am happy to report that KeyDog's code snip suggestion worked for me. Thanks KeyDog!

I don't understand the function of the icons anyway, so I've disabled them.

12

Re: URL file-access is disabled in the server configuration in

added to trac
http://punbb.informer.com/trac/ticket/359

13

Re: URL file-access is disabled in the server configuration in

This is still bug on v. 1.1.17 of pun_attachement for PunBB 1.4.x

pun_attach.php   line 26

        list($width, $height,,) = getimagesize($forum_config['attach_icon_folder'].$icon_name);

http://www.learnphponline.com/errors/ur … figuration

suggestions in article:
1) The First Solution: Use Relative File Paths
2) The Second Solution: Use Another PHP Function
3) The Best Solution: Using Server Variables

is number 3 not being used?