Page 3 of 10

Re: It was not possible to determine the dimensions of the image

Posted: Mon Aug 27, 2007 2:28 pm
by latazyo
if you have the option of changing your php.ini file, that works (as it just happened to me) and I modified the value for allow_url_fopen from off to on and it worked instantly and took me .01 seconds to complete

Re: It was not possible to determine the dimensions of the image

Posted: Sun Sep 09, 2007 3:03 pm
by kernos
When I add this hack, I get the following, when posting or replying:

Code: Select all

Parse error: syntax error, unexpected T_STRING in /home/.jacinth/bill501/druidry.org/board/dhp/includes/message_parser.php on line 302
Lines 300-303 are:

Code: Select all

300{
301			 if (function_exists('curl_exec'))
302            {
303              $c_img = curl_init();
I too am on Dreamhost.

Bill

Re: It was not possible to determine the dimensions of the image

Posted: Fri Sep 14, 2007 1:11 am
by mantykore
Hello,

In my forum, the [img] only doesn't work on signs.

I can post an imagen at the message's body but not in the signs. Some users can, but the great majority is using the [Flash=] code to post images in the signs.

On my server, in the php.ini, allow_url_fopen is ON. I use phpBB3_RC5.

Anyone knows why this is happen?

Regards,
mantykore.

Re: It was not possible to determine the dimensions of the image

Posted: Sat Sep 15, 2007 4:35 pm
by medigeek
I use dreamhost as well, the code posted before is a great workaround, but the image x and y were placed reverted, hence it will say "Your images may only be up to 150 pixels high." if you have a 200 (width) x 50 (height).

With my limited programming knowledge, I just reverted the imagesx and imagesy:
After the lines (AFTER, NOT BEFORE):

Code: Select all

			if ($stats === false)
			{
You will add:

Code: Select all

                if (function_exists('curl_exec'))
                {
                   $c_img = curl_init();
                   $c_timeout = 8; //The timeout, in seconds. You may want to change this
                   $c_max_filesize = 64000; //The max file size loaded into memory
                   curl_setopt($c_img, CURLOPT_URL, $in);
                   curl_setopt($c_img, CURLOPT_RETURNTRANSFER, 1);
                   @curl_setopt($c_img, CURLOPT_BUFFERSIZE, $c_max_filesize);
                   curl_setopt($c_img, CURLOPT_CONNECTTIMEOUT, $c_timeout);
                   curl_setopt($c_img, CURLOPT_FOLLOWLOCATION,1);
                   $grabbed_img = @curl_exec($c_img);
                   curl_close($c_img);
                   $stats[0] = $stats[1] = false;
                   if ($grabbed_img)
                   {
                      $grabbed_img = @imagecreatefromstring($grabbed_img);
                      $stats[1] = @imagesy($grabbed_img);
                      $stats[0]= @imagesx($grabbed_img);
                      unset($grabbed_img, $c_img);
                   }
                   if (!$stats[0] || !$stats[1])
                   {
                      $stats = false;
                   }
                }
             }
             if ($stats === false)
             {         

Re: It was not possible to determine the dimensions of the image

Posted: Thu Nov 15, 2007 3:51 am
by clight77
You should be able to do this in .htaccess also if you do not have access to php.ini, by adding this line.

php_value allow_url_fopen On

Re: It was not possible to determine the dimensions of the image

Posted: Mon Nov 19, 2007 8:49 am
by banzaimonkey
medigeek wrote:I use dreamhost as well, the code posted before is a great workaround, but the image x and y were placed reverted, hence it will say "Your images may only be up to 150 pixels high." if you have a 200 (width) x 50 (height).

With my limited programming knowledge, I just reverted the imagesx and imagesy:
After the lines (AFTER, NOT BEFORE):
Thanks for the correction. I tested the hack and was wondering why it wasn't working. I didn't think to check that the dimensions had been reversed.

Cheers. :)

Re: It was not possible to determine the dimensions of the image

Posted: Mon Dec 17, 2007 7:11 pm
by luchope
Hi, my hosting also disabled the PHP setting: "allow_url_fopen". It is explained as follows:
http://phpsec.org/projects/phpsecinfo/t ... fopen.html .

Today I added the code you guys put in this forum, but only got an error:
Parse error: syntax error, unexpected '/' in /forum/phpBB3/includes/message_parser.php on line 445
Ive cleared style cache, template cache and general cache, but doesnt work ... :( Have PHPBB3 Gold

please help!

Byep!

Re: It was not possible to determine the dimensions of the image

Posted: Tue Dec 18, 2007 1:26 pm
by luchope
Has somebody tried something else? :cry:

Re: It was not possible to determine the dimensions of the image

Posted: Tue Dec 18, 2007 6:26 pm
by pinkshades05
I tried the MOD and it didn't work for me, either. I also got a Parse error. Any other ideas??

Re: It was not possible to determine the dimensions of the image

Posted: Wed Dec 19, 2007 12:19 am
by luchope
Ive installed another new installation of Gold Edition. It works fine with the basic DB whicih installas, but while changing DB in config.php it doesnt let post images again.


Has somebody know how to setup the DB for fixing this issue?
Which value from config table?

Byep!

Re: It was not possible to determine the dimensions of the image

Posted: Wed Dec 26, 2007 1:06 am
by RKumono
Dreamhost Users:

You CAN edit your PHP.INI file. I had to dig around for this myself, as we were getting the 'not possible' error on signature and avatar images. Too many places to try and custom recode quickly, so I looked for solutions.

The message workaround is great, but as I said--signature and avatar linked images.

I managed to find instructions on Dreamhost's on wiki to create your domain's own php.ini file, so you can edit it and turn on allow_url_fopen.

Here is how:
  1. Acquire a shell access program (I used PuTTY: http://www.chiark.greenend.org.uk/~sgtatham/putty/ )
  2. Make sure your username and password on your Dreamhost account has Shell access through their web panel.
  3. Start PuTTY (or whatever you use) and enter your domain name (http://www.mysite.com) and connect
  4. Login with your account username/password
  5. Now for the commands you need
    • For PHP5:

      Code: Select all

      mkdir mysite.com/cgi-bin
      cp /dh/cgi-system/php5.cgi mysite.com/cgi-bin/php.cgi
      cp /etc/php5/cgi/php.ini mysite.com/cgi-bin/php.ini
      exit
    • For PHP4:

      Code: Select all

      mkdir mysite.com/cgi-bin
      cp /dh/cgi-system/php.cgi mysite.com/cgi-bin/php.cgi
      cp /etc/php5/cgi/php.ini mysite.com/cgi-bin/php.ini
      exit
  6. Through FTP access, download mysite.com/cgi-bin/php.ini
  7. Edit your php.ini to change allow_url_fopen = On
  8. Upload and Overwrite the mysite.com/cgi-bin/php.ini with your modified file
  9. Create or Edit your mysite.com/.htaccess file using/adding the following lines:
    • mysite.com/.htaccess

      Code: Select all

      AddHandler php-cgi .php
      Action php-cgi /cgi-bin/php.cgi
  10. Assign file permissions as follows via FTP
    • mysite.com/.htaccess to 644
    • mysite.com/cgi-bin to 755
    • mysite.com/cgi-bin/php.cgi to 750
    • mysite.com/cgi-bin/php.ini to 644
  11. Delete all files via FTP from your phpBB3's /cache folder
And you are done. Now everything works fine. No modifications needed to any of the phpBB code this way.

If your phpBB installation is in your domain's root, you have to edit the phpBB3 .htaccess file for the lines needed in the instructions above, adding them to the beginning of the file.

If your phpBB installation is NOT in your domain's root, you create an .htaccess file for your domain's root folder (or edit what is there) to have those lines at the top. You only change the .htaccess file in the root of your domain.

And everything works. And it was good.

Remember, this is for Dreamhost. Other Host Providers may be different.

Re: It was not possible to determine the dimensions of the image

Posted: Sat Jan 19, 2008 2:04 am
by Down2thec
PowWeb claims my allow_url_fopen is on with the default php.ini for PHP4, but the sizing didn't work. I used the code hack listed above with some success. It does the trick but if you point it to a huge image that busts that 64000 limit, it gives the blank page crash for me. Might freak out the board users so I'll bump it up some for starters.

Not sure if there's any exception trapping for php that I might use to wrap that part up... I'll have to do some googling.

Re: It was not possible to determine the dimensions of the image

Posted: Tue Jan 22, 2008 4:35 pm
by heosemys
My site is hosted by siteground. I've tried many things, but in the end the solution was very simple:
- In the cPanel select 'Hotlink protection'.
- enable 'Allow direct requests'. ;)

Re: It was not possible to determine the dimensions of the image

Posted: Sun Jan 27, 2008 4:49 pm
by >>>Ana
oki guys i have possible other solution for this freeko think.

i had exactly same error, 2 funny facts:

1.) it worked before.
2.) there was no code changes and no system changes.

hmm. haxors? black cats? voodo sure.

oki heres reason. the webserver is in lan behind firewall. so the php went to www myadress com and got internet ip. so data goes to the router and back. since there were some changes in that router this "hookback" didnt run anylonger. and anyways its "dirty" thing
fix? find the HOSTS file, enter domains there with local ip or localhost manually. ping ur domains to be sure it works. dont forget to give every domain normal and www name if u dont mod_rewrite :)

as i said, this solution is only interesting if ure behind router or have mad firewalling.

another fun could be to assign the internet ip a second time on some lan interface of webserver (ip alias). dunno if that will lead into some problems. anyways, with this solution we wouldnt have to make entry in hosts file for every new vhost in apache.

Re: It was not possible to determine the dimensions of the image

Posted: Fri Feb 01, 2008 1:07 pm
by hoffy
RKumono wrote:Dreamhost Users:

You CAN edit your PHP.INI file. I had to dig around for this myself, as we were getting the 'not possible' error on signature and avatar images. Too many places to try and custom recode quickly, so I looked for solutions.

Thank you very much!!!! I am Very happy indeed with this & it worked a treat!

Cheers