Re: Sockets as a module or a separate PHP CLI instance?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 2, 2007 6:29 am, list3@xxxxxxxxxxx wrote:
> I need to do some socket work on a production machine that is
> constantly
> busy so I don't dare re-compile php. Anybody know if it's possible to
> load
> the socket functions dynamically, maybe as if they were in a module?

If you can do --with-sockets=shared, for the configure, you should end
up with a sockets.so file that you can then use http://php.net/dl to
load into your scripts that need sockets...

At least, *some* extensions this works...

> Alternatively, would it be possible to compile PHP without apache and
> with
> sockets for command line use only?

Definitely.

Just compile it as CLI or CGI, without the --with-apxs or --with-apxs2
or whatever pulls in Apache.

> If I do that I would like to give
> the
> resulting object a different name than PHP because I do have some cmd
> line
> pgms running on the machine. Is that difficult?

Then don't do 'make install' but just copy the bin/php over to
/usr/local/bin/php-with-sockets

Then you can do php-with-sockets -q whatever.php to run that one
special PHP binary.

Alternatively, you can download the PHP source to a whole new fresh
directory, compile it for CLI, and then leave it there, and use:

/path/to/php/src/php/bin/php -q whatever.php

so that you are running the special php binary from that source
directory instead of the usual one in /usr/local/bin (or wherever
yours lives)

I did that for a CVS version when I needed a patched PHP on a shared
host, and it worked pretty well for a cron job.

It would be kind of cumbersome for something you wanted to run by hand
from the shell a lot, but for a set it and forget it cron job, it was
fine for me.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux