Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > Sockets as a module or a separate PHP CLI instance?
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 9th March 00:59
External User
 
Posts: 1
Default Sockets as a module or a separate PHP CLI instance?



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?
Alternatively, would it be possible to compile PHP without apache and with
sockets for command line use only? 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?

Tx,
Paul W
  Reply With Quote


  sponsored links


2 9th March 00:59
toylet.toylet
External User
 
Posts: 1
Default Sockets as a module or a separate PHP CLI instance?



I think both Fedora Core and Ubuntu do it. Check out their RPM/DEB spec
file for compiling the packages.

--
.~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.10) Linux 2.6.21.1
^ ^ 19:58:01 up 4 days 4:51 0 users load average: 0.06 0.11 0.04
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk
  Reply With Quote
3 9th March 00:59
lists
External User
 
Posts: 1
Default Sockets as a module or a separate PHP CLI instance?


Am Mittwoch, 2. Mai 2007 13:29 schrieb list3@truswan.com:


It's possible if it's possible to compile it as shared object. It is, as far
as I know.

--with-socket=shared

There might be some obstacles with threaded servers. I am not sure.


--enable-cli

Regards,

Oliver
  Reply With Quote
4 9th March 00:59
lists
External User
 
Posts: 1
Default Sockets as a module or a separate PHP CLI instance?


Am Mittwoch, 2. Mai 2007 14:36 schrieb Oliver Block:


Actually it should be --enable-sockets=shared

Regards,

Oliver
  Reply With Quote
5 9th March 01:00
ceo
External User
 
Posts: 1
Default Sockets as a module or a separate PHP CLI instance?


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...


Definitely.

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


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 ***bersome 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?
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666