[PHP] Installing Imagemagick on Windows

2004-06-01 Thread Tan Ai Leen
Hi,
I need help with installing Imagemagick on Windows. I tried googling but 
there is no solution provided. I discovered that a lot of people are 
having the same problem as me. After placing the dll in the extension 
folder and adding in extension=php_imagick.dll into php.ini, Apache will 
hit error Unknow(): Unable to load dynamic library 
F:\php\extensions\php_imagick.dll.

I believe that my php.ini is configured correctly. I am able to load 
other extensions with out any error.
This is what is in my php.ini file

extension_dir = "F:\php\extensions\"
extension=php_imagick.dll
What should I do with the ImageMagick library? Is there a step by step 
guide on installing imagemagick? With versions of library and links to 
download them?

Thanks in advance,
Ai Leen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Socket warning

2004-02-17 Thread Tan Ai Leen
Hi all,
I programmed a server to bind to an external server(Let's call it 
C-server). My server will have to listen on the connection to C-server 
and send over data frequently. Each write of data to C-server from my 
server will cause C-server to response a string.
So the codes will be something like this:

if($response)
{   
socket_write($read_socket, "$response", strlen($response));
echo $response."\n";
}
...
some processing to construct string to be send over
...
foreach($message as $part)
{
socket_write($this->c_socket, $part);
echo $part."\n";
$out = socket_read($this->c_socket, 1024);
echo $out."\n";
error_log($part.":".$out."\n", 3, $this->logfile);
}
Everytime the execution reaches socket_write($this->c_socket, $part);
a php warning is issued

Warning:  socket_read() unable to read from socket [11]: Resource 
temporarily unavailable in 
/var/www/html/dreamscape_mg/connectors/celcom/mo.php on line 
134

Line 134 is the curl brace after the foreach. I am assuming that the 
socket read would be $out = socket_read($this->c_socket, $part). Why do 
I get the warning? c_socket is non blocking.

Thanks for your help
Ai Leen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Use a Server or Client Socket?

2004-02-08 Thread Tan Ai Leen
Hi,

I need to be polling the connection constantly for new messages as well 
as have a check that the connection is on. These need to be done in one 
connection. That's where the headache comes in. In order to poll 
constantly, I placed the socket read in a while loop. Since the script 
is looping constantly there, I can't place the checking in the while 
loop. And I can't make a need connection to check if I am still login 
because the external server only allows one connection.

Raditha Dissanayake wrote:
Hi,

If you only need to make a connection to the server every ten minutes 
you will be saving a lot of resources if you use a cron job to connect 
at intervals instead of keeping a permanently open connections. Creating 
a cron job is quite simple, if you type

man 5 crontab

you will be able to read more about it (at least in linux - a poor 
substitute exists in windows called scheduled tasks)

With this approach you just need to call fsockopen to do connect to your 
server and do the needful.





Tan Ai Leen wrote:

Hi Raditha,

Thanks, I have a better idea of how to write the codes. But I wonder, 
to check that the connection to the external server is on, where 
should I place the code? I need to do this every 10 minutes. If the 
connection is dropped, I have to reconnect. Where should I place this 
check? If I place it in the while(true) loop, I will be checking every 
few miliseconds rite? That will be too frequent. What about in another 
script? Will I be able to check that the connection is on?

Regards,
Ai Leen
Raditha Dissanayake wrote:

Hi Tan,

If you are connecting to another server you are using a client socket 
you do not need to make a server socket. If you need to listen for 
connections make use of a server socket. To give you an example your 
browser makes use of client sockets while apache makes use of server 
sockets. That is an over simplified view of things but hope it helps 
you understand things better.

Generally working with client sockets is easier.

best regards




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Use a Server or Client Socket?

2004-02-07 Thread Tan Ai Leen
Hi Raditha,

Thanks, I have a better idea of how to write the codes. But I wonder, to 
check that the connection to the external server is on, where should I 
place the code? I need to do this every 10 minutes. If the connection is 
dropped, I have to reconnect. Where should I place this check? If I 
place it in the while(true) loop, I will be checking every few 
miliseconds rite? That will be too frequent. What about in another 
script? Will I be able to check that the connection is on?

Regards,
Ai Leen
Raditha Dissanayake wrote:
Hi Tan,

If you are connecting to another server you are using a client socket 
you do not need to make a server socket. If you need to listen for 
connections make use of a server socket. To give you an example your 
browser makes use of client sockets while apache makes use of server 
sockets. That is an over simplified view of things but hope it helps you 
understand things better.

Generally working with client sockets is easier.

best regards
raditha
Tan Ai Leen wrote:

Hi all,
I have this situation now that requires socket programming. But I am not
sure how to realise the requirements in programming whether as a 
client or
server
The requirement is like this.
I have to connect to an external server constantly to listen for incoming
data. How can I make sure that the connection is there all the time? Upon
receiving the message, I will have to response back an acknowledgement 
that
the message is received. I can also send data to the server. From my
requirements, I understand that there will only be one connection. 
Therefore
the data exchange need not be in sequence.

Currently, what I have is a server programmed using the socket library.
Server logic :
socket_create
socket_bind
socket_listen
while(true)
{
   socket_select
   if(new connection)
   {
   add to connections array
   }
   else
   {
   if(can read)
   {
   read incoming
   response back
   }
   else
   {
   //error or connection close
   if(error)
   {
   print error
   }
   else
   {
   print connection close
   remove from connections array
   }
   }
   }
}
I am planning to include a check somewhere in the codes for 
maintaining the
connection between my server and the other server. Where should I 
place it?
Also, I need to initiate a connection to the external server and then
listen. Where should this piece of code be insert at? Is this the right
approach? Or I am over killing by writing a server if this can be 
handle in
easier manner.
Hope that I have been clear in the above.

Thanks for helping
Ai Leen
 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Use a Server or Client Socket?

2004-02-07 Thread Tan Ai Leen
Hi Raditha,

Thanks, I have a better idea of how to write the codes. But I wonder, to 
check that the connection to the external server is on, where should I 
place the code? I need to do this every 10 minutes. If the connection is 
dropped, I have to reconnect. Where should I place this check? If I 
place it in the while(true) loop, I will be checking every few 
miliseconds rite? That will be too frequent. What about in another 
script? Will I be able to check that the connection is on?

Regards,
Ai Leen
Raditha Dissanayake wrote:
Hi Tan,

If you are connecting to another server you are using a client socket 
you do not need to make a server socket. If you need to listen for 
connections make use of a server socket. To give you an example your 
browser makes use of client sockets while apache makes use of server 
sockets. That is an over simplified view of things but hope it helps you 
understand things better.

Generally working with client sockets is easier.

best regards
raditha
Tan Ai Leen wrote:

Hi all,
I have this situation now that requires socket programming. But I am not
sure how to realise the requirements in programming whether as a 
client or
server
The requirement is like this.
I have to connect to an external server constantly to listen for incoming
data. How can I make sure that the connection is there all the time? Upon
receiving the message, I will have to response back an acknowledgement 
that
the message is received. I can also send data to the server. From my
requirements, I understand that there will only be one connection. 
Therefore
the data exchange need not be in sequence.

Currently, what I have is a server programmed using the socket library.
Server logic :
socket_create
socket_bind
socket_listen
while(true)
{
   socket_select
   if(new connection)
   {
   add to connections array
   }
   else
   {
   if(can read)
   {
   read incoming
   response back
   }
   else
   {
   //error or connection close
   if(error)
   {
   print error
   }
   else
   {
   print connection close
   remove from connections array
   }
   }
   }
}
I am planning to include a check somewhere in the codes for 
maintaining the
connection between my server and the other server. Where should I 
place it?
Also, I need to initiate a connection to the external server and then
listen. Where should this piece of code be insert at? Is this the right
approach? Or I am over killing by writing a server if this can be 
handle in
easier manner.
Hope that I have been clear in the above.

Thanks for helping
Ai Leen
 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Use a Server or Client Socket?

2004-02-07 Thread Tan Ai Leen
Hi all,
I have this situation now that requires socket programming. But I am not
sure how to realise the requirements in programming whether as a client or
server
The requirement is like this.
I have to connect to an external server constantly to listen for incoming
data. How can I make sure that the connection is there all the time? Upon
receiving the message, I will have to response back an acknowledgement that
the message is received. I can also send data to the server. From my
requirements, I understand that there will only be one connection. Therefore
the data exchange need not be in sequence.

Currently, what I have is a server programmed using the socket library.
Server logic :
socket_create
socket_bind
socket_listen
while(true)
{
socket_select
if(new connection)
{
add to connections array
}
else
{
if(can read)
{
read incoming
response back
}
else
{
//error or connection close
if(error)
{
print error
}
else
{
print connection close
remove from connections array
}
}
}
}
I am planning to include a check somewhere in the codes for maintaining the
connection between my server and the other server. Where should I place it?
Also, I need to initiate a connection to the external server and then
listen. Where should this piece of code be insert at? Is this the right
approach? Or I am over killing by writing a server if this can be handle in
easier manner.
Hope that I have been clear in the above.

Thanks for helping
Ai Leen

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: rich text editing

2003-08-20 Thread Tan Ai Leen
You can also use dhtml/js to code a html editor. But it will work in IE
only. Search for online html editor. See this
link:http://msdn.microsoft.com/library/default.asp
If you are developing for a organisation, the type of browser used is easy
to predict. If you are developing for the general public, there is of course
other browsers to take care of. Java will fit all kind of browsers (that
have java plugin) but it is usually very heavy for the client side.

Regards,
Tan Ai Leen



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: problem writing \t and } tp text files

2003-08-20 Thread Tan Ai Leen
I think it is because I used the wrong mode for editing the file. x+ merely
write over existing data in a file, does not truncate. The } could be
residue from previous writes. Using w+ solves the problem. ;>

Regards,
Tan Ai Leen




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] problem writing \t and } tp text files

2003-08-20 Thread Tan Ai Leen
Hi,
Did anyone encounter problem writing \n\t\t\t\t follow by } into text files?
I tried doing this. I am writing a class generator. That's why there are so
many \t.
When I tried \n\t\t\t\t}, the } will be missing from the textfile. \t}can't
be an escape sequence rite?
What's wrong?
I am using php4.3 on winxp the fopen mode I am using is r+t and x+t.

Thanks,
Tan Ai Leen



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: people who has done a POS system before

2003-07-24 Thread Tan Ai Leen
Actually I am looking for a emulator that works for printers, not phones



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] people who has done a POS system before

2003-07-23 Thread Tan Ai Leen
Hi,
I was just wondering there is a emulator for us developers to develop
programs for palm and handphone, etc. Is there a program that emulates the
output from various printers on screen?

Regards,
Tan Ai Leen



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] The 'Unable to create Java Virtual Machine' Again

2003-07-20 Thread Tan Ai Leen
Hi,
I know there are already a lot of posting regarding this bug. But I can't
find a solution for this problem. There is no problem with my installation,
I think. I can call java classes. But the Unable to create Java Virtual
Machine error will occur if I would to constantly refresh the page. I guess
there is a out of memory issue or deadlock somewhere.
Have any one sucessfully deploy php pages accessing java classes without
errors? This bug has been submitted but not resolved. Have anyone come up
with a solution?
I am working on a winxp, using Apache 1.3.27 and php 4.3.2., java version
1.4.1.

Thanks in advance.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] The 'Unable to create Java Virtual Machine' Again

2003-07-20 Thread Tan Ai Leen
Hi,
I know there are already a lot of posting regarding this bug. But I can't
find a solution for this problem. There is no problem with my installation,
I think. I can call java classes. But the Unable to create Java Virtual
Machine error will occur if I would to constantly refresh the page. I guess
there is a out of memory issue or deadlock somewhere.
Have any one sucessfully deploy php pages accessing java classes without
errors? This bug has been submitted but not resolved. Have anyone come up
with a solution?
I am working on a winxp, using Apache 1.3.27 and php 4.3.2., java version
1.4.1.

Thanks in advance.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Auto session timeout

2003-07-20 Thread Tan Ai Leen
Hi,
Can someone confirm that php does not have a auto timeout feature? Meaning
something like session will auto expire irregardless of whether the browser
is close or not?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php