Forum Moderators: coopster

Message Too Old, No Replies

createimagefromjpeg with URL parameters fails

         

whirlpool6

7:18 am on Oct 10, 2007 (gmt 0)

10+ Year Member



hello everyone.

i have installed gd2 on our linux server and used createimagefromjpeg with a URL parameter. this fails and returns an empty string. i tried to access a native public url but it doesn't work as well.. when i changed the native url to the ip address of the server, it works perfectly.

i don't know if i missed something but i really have no more idea how and why this happened...

can somebody please help me.

thanks a lot.

eelixduppy

3:19 pm on Oct 10, 2007 (gmt 0)



Hello and Welcome to WebmasterWorld!

Make sure your allow_url_fopen [us2.php.net] directive is set to true otherwise it will not correctly work.

whirlpool6

12:50 am on Oct 11, 2007 (gmt 0)

10+ Year Member



yes allow_url_fopen is turned on. is there something else i missed?

eelixduppy

1:34 am on Oct 11, 2007 (gmt 0)



Aside from the fact that you are using the wrong function (assuming you are using what you have wrote in your first msg). The function you should be using is imagecreatefromjpeg [us2.php.net] not createimagefromjpeg.

I don't see any other reasons why it shouldn't be working. Maybe safe mode has some affect on it in which case you may want to check that out.

whirlpool6

1:41 am on Oct 11, 2007 (gmt 0)

10+ Year Member



hey sorry for that... it should have been imagecreatefromjpeg... i just wrote it wrongly but i used the function correctly.

what is safe mode? our servers are all apache in linux. how would i check on this?

whirlpool6

3:44 am on Oct 16, 2007 (gmt 0)

10+ Year Member



the previous entry was somewhat erroneous. here is the real deal guys.

i cant access images in php... here is the warning it shows.

Warning: imagecreatefromjpeg(http://trialhost:81/DOCUMENTUM//430/ss007-2007052634012.jpg) [function.imagecreatefromjpeg]: failed to open stream: HTTP request failed! HTTP/1.1 401 Access Denied in /usr/local/apache2/htdocs/iv_stage_fritz/try.php on line 8

i dont know what is with the access denied... i have to make sure first that this is not with the configuration before i ask the sysad...

pls help.

joelgreen

12:34 pm on Oct 16, 2007 (gmt 0)

10+ Year Member



Did you try removing :81? Do you try to access jpg located on the another machine from your network? Maybe image permissions on that machine does not allow to view?

whirlpool6

1:45 am on Oct 17, 2007 (gmt 0)

10+ Year Member



but i can access the image in browser...

if i remove 81, nothing can be seen... a specified port must be written.

eelixduppy

5:41 am on Oct 17, 2007 (gmt 0)



This is safe mode: [php.net...] Make sure that it is disabled.

whirlpool6

6:25 am on Oct 17, 2007 (gmt 0)

10+ Year Member



yup allow_url_fopen is turned on... im using urls because the images come from a different server...

whirlpool6

6:56 am on Oct 17, 2007 (gmt 0)

10+ Year Member



yes i have checked and it is not in safe mode...

jatar_k

12:57 pm on Oct 17, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



what version of php do you have?

also you could be getting blocked from the other site.

whirlpool6

1:16 am on Oct 18, 2007 (gmt 0)

10+ Year Member



im using php5. i have already informed the other party but still we are waiting for reply. but ive got to make sure that it really is not a problem on our side. what other configurations do i have to check?

thanks a lot..

jatar_k

12:13 pm on Oct 18, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



because it is returning a 401 my first look would be why the other server is denying the request.

Have they setup a username/password?

whirlpool6

3:48 am on Oct 19, 2007 (gmt 0)

10+ Year Member



is it possible to setup username and password on specific addresses only? like if 12.12.12.12 accessses, no authentication is required and if 10.10.10.10, needs an authentication?

the other server i think is running on iis.