php-general Digest 28 Jun 2009 21:46:06 -0000 Issue 6200

Topics (messages 294692 through 294698):

Re: Image Type BMP @ "Save Image As" Dialog on IE
        294692 by: Martin Zvarík
        294693 by: Nitsan Bin-Nun

Problems with an extension
        294694 by: Eric A. Boney
        294695 by: Daniel Brown
        294696 by: Eric A. Boney

Re: mysql_query blocking
        294697 by: Tom Worster

Socket error
        294698 by: Luke

Administrivia:

To subscribe to the digest, e-mail:
        [email protected]

To unsubscribe from the digest, e-mail:
        [email protected]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
Nitsan Bin-Nun napsal(a):
I have wrote a PHP script that serves JPEG images in smaller size, the
resize is done using GD on-the-fly.
I have noticed an interesting issue during the "save image as..." dialog on
serveral internet explorer browsers, somehow, for some strange reason, the
JPEG file is shown as BMP file.

I don't know why this is happening, but I'm trying to make it save it as JPG
file.
In firefox or any other browser everything works like a charm.

I have to mention that the JPG file is located in the HTML in the following
format:
<img src='xxx.jpg' alt='aaa' style='border:0;' />

I have also used mod_rewrite to serve the file with .jpg extension (I
thought that the strange IE may not know how to recognize it..), the PHP
file is sending the correct headers, I'm attaching an example for HTTP
request & response for this resized image:

GET /gallery-image-dolphinim-12450163853. HTTP/1.1
Host: www.dolphinim.net
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10)
Gecko/2009042316 Firefox/3.0.10 FirePHP/0.3
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: PHPSESSID=e4542edfa5bcb7904e351d39c341fffa

HTTP/1.x 200 OK
Date: Fri, 26 Jun 2009 16:18:52 GMT
Server: Apache/1.3.41 (Unix) PHP/5.2.6 mod_log_bytes/1.2 mod_bwlimited/1.4
mod_auth_passthrough/1.8 FrontPage/5.0.2.2635 DAV/1.0.3 mod_ssl/2.8.31
OpenSSL/0.9.8e-fips-rhel5
X-Powered-By: PHP/5.2.6
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache
Keep-Alive: timeout=15, max=98
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: image/jpeg


Any directions will be highly appreciated!

Thanks!


I have noticed the same thing... although after the temporary files clean up and refresh it works OK.

So, this is an IE bug - I have not found any workaround.

--- End Message ---
--- Begin Message ---
I have been working on it for a while but no luck.

I personally don't have IE to test it but my customer have noticed it and
brought it up to the table.

If you have any ideas I would like to hear you out :)

On Sun, Jun 28, 2009 at 5:28 PM, Martin Zvarík <[email protected]> wrote:

> Nitsan Bin-Nun napsal(a):
>
>  I have wrote a PHP script that serves JPEG images in smaller size, the
>> resize is done using GD on-the-fly.
>> I have noticed an interesting issue during the "save image as..." dialog
>> on
>> serveral internet explorer browsers, somehow, for some strange reason, the
>> JPEG file is shown as BMP file.
>>
>> I don't know why this is happening, but I'm trying to make it save it as
>> JPG
>> file.
>> In firefox or any other browser everything works like a charm.
>>
>> I have to mention that the JPG file is located in the HTML in the
>> following
>> format:
>> <img src='xxx.jpg' alt='aaa' style='border:0;' />
>>
>> I have also used mod_rewrite to serve the file with .jpg extension (I
>> thought that the strange IE may not know how to recognize it..), the PHP
>> file is sending the correct headers, I'm attaching an example for HTTP
>> request & response for this resized image:
>>
>> GET /gallery-image-dolphinim-12450163853. HTTP/1.1
>> Host: www.dolphinim.net
>> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.10)
>> Gecko/2009042316 Firefox/3.0.10 FirePHP/0.3
>> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
>> Accept-Language: en-us,en;q=0.5
>> Accept-Encoding: gzip,deflate
>> Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
>> Keep-Alive: 300
>> Connection: keep-alive
>> Cookie: PHPSESSID=e4542edfa5bcb7904e351d39c341fffa
>>
>> HTTP/1.x 200 OK
>> Date: Fri, 26 Jun 2009 16:18:52 GMT
>> Server: Apache/1.3.41 (Unix) PHP/5.2.6 mod_log_bytes/1.2 mod_bwlimited/1.4
>> mod_auth_passthrough/1.8 FrontPage/5.0.2.2635 DAV/1.0.3 mod_ssl/2.8.31
>> OpenSSL/0.9.8e-fips-rhel5
>> X-Powered-By: PHP/5.2.6
>> Expires: Thu, 19 Nov 1981 08:52:00 GMT
>> Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
>> pre-check=0
>> Pragma: no-cache
>> Keep-Alive: timeout=15, max=98
>> Connection: Keep-Alive
>> Transfer-Encoding: chunked
>> Content-Type: image/jpeg
>>
>>
>> Any directions will be highly appreciated!
>>
>> Thanks!
>>
>>
> I have noticed the same thing... although after the temporary files clean
> up and refresh it works OK.
>
> So, this is an IE bug - I have not found any workaround.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
So I am developing a custom extension and I am having a issue. I have a header 
file that I need included in the project. If I #include the header file 
everything compiles and makes just fine, but after restarting the web server 
the extension won't load.

If I remove or comment out the #include of the header file everything still 
compiles and makes just fine, and after restarting the web server the extension 
is loaded just fine.

Does anyone have any idea what would cause the extension to refuse to load 
with the header file included?

-Eric

--- End Message ---
--- Begin Message ---
On Sun, Jun 28, 2009 at 10:56, Eric A.
Boney<[email protected]> wrote:
> So I am developing a custom extension and I am having a issue. I have a header
> file that I need included in the project. If I #include the header file
> everything compiles and makes just fine, but after restarting the web server
> the extension won't load.

    Eric,

    Custom extensions programming is in C/C++ (as also indicated by
your #include reference), which is beyond the scope of this list.
Unfortunately, there is not an official dedicated list for extensions
developers, but if it's not urgent, you can email me privately at
[email protected] and I'll see if I can help you out.

-- 
</Daniel P. Brown>
[email protected] || [email protected]
http://www.parasane.net/ || http://www.pilotpig.net/
Ask me about our fully-managed servers and proactive management
clusters starting at just $200/mo.!

--- End Message ---
--- Begin Message ---
On Sunday 28 June 2009 11:00:48 you wrote:
> On Sun, Jun 28, 2009 at 10:56, Eric A.
>
> Boney<[email protected]> wrote:
> > So I am developing a custom extension and I am having a issue. I have a
> > header file that I need included in the project. If I #include the header
> > file everything compiles and makes just fine, but after restarting the
> > web server the extension won't load.
>
>     Eric,
>
>     Custom extensions programming is in C/C++ (as also indicated by
> your #include reference), which is beyond the scope of this list.
> Unfortunately, there is not an official dedicated list for extensions
> developers, but if it's not urgent, you can email me privately at
> [email protected] and I'll see if I can help you out.
Thanks Dan:

I thought it might be beyond this list, but I figured it might be worth the 
shot. It is not urgent at all, so I will drop you a private message with a 
more detailed explanation and if you can help great, if not, I'll keep poking 
around at it.

-Eric


--- End Message ---
--- Begin Message ---
On 6/27/09 7:09 PM, "Daniel Kolbo" <[email protected]> wrote:

> Tom Worster wrote:
>> On 6/27/09 3:15 PM, "Daniel Kolbo" <[email protected]> wrote:
>> 
>>> When a MySQL table is locked a php call of mysql_query() that requires
>>> that table will hang as the request blocks at the MySQL server until the
>>> table is unlocked.  Is there a way to stop a mysql_query from hanging
>>> (by setting a time limit)?
>> 
>> would it be possible to test for presence of the lock before issuing the
>> query that would block? if so, you could check the lock periodically until
>> your time limit is up. would achieve you you're looking for?
>> 
>> 
>> 
> it would still be possible that after checking but before issuing the
> query the table's could be locked - albeit a much smaller chance.

that's true.

what would be nice for this kind of problem would be a kind of async api,
perhaps a bit like curl_multi but with a way to check the state of an
outstanding query (queued, processing, etc). much like a js script uses
ajax.



--- End Message ---
--- Begin Message ---
Hey guys, getting an odd error here... The code involved:

            $master_socket = socket_create_listen($this->port);

            socket_bind($master_socket, '127.0.0.1', $this->port);
            socket_listen($master_socket);
            socket_set_option($master_socket, SOL_SOCKET, SO_REUSEADDR, 1);
            socket_set_nonblock($master_socket);

And I'm getting:

'PHP Warning:  socket_bind(): unable to bind address [22]: Invalid argument
in /home/luke/talkserver/new/classes/server.php online 30'

$this->port is valid, I've checked both this and that socket_create_listen
seems to be executing correctly.

I'm a bit lost on the error too it seems to be what the php.net manual says
are the parameters?

I'm trying to create a listening socket server that binds to a port on the
local machine.

Thanks in advance for any help!

-- 
Luke Slater
:O)

--- End Message ---

Reply via email to