PHP Server deamons

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
mike
New php-forum User
New php-forum User
Posts: 73
Joined: Sun May 04, 2003 4:26 am
Location: Athens
Contact:

Sat Sep 04, 2004 6:03 am

Does anyone have ever tried creating a php server deamon? If yes, have you used any sockets to communicate with it? I need some ideas/suggestions. Thanks :)
11:16am up 404 days, 2 users, load average: 148.68, 143.45, 132.6


Mike Vassileiou
[Systems Administrator / PHP Developer]


PHP/MySQL Manual:
http://www.phpmysql-manual.com

Oleg Butuzov
Last Samuray
Last Samuray
Posts: 824
Joined: Sun Jun 02, 2002 3:09 am

Sun Sep 05, 2004 10:12 pm

its a bad idia my friend...

very bad.

you can use cron..., but you never you will get a demon like script....

User avatar
mike
New php-forum User
New php-forum User
Posts: 73
Joined: Sun May 04, 2003 4:26 am
Location: Athens
Contact:

Tue Sep 07, 2004 1:22 am

Why is that? I have already done this many times and works perfect. Now I am trying to create a child-proccess system and open sockets to communicate with. Of course it needs very high attention on security as well ...
11:16am up 404 days, 2 users, load average: 148.68, 143.45, 132.6


Mike Vassileiou
[Systems Administrator / PHP Developer]


PHP/MySQL Manual:
http://www.phpmysql-manual.com

User avatar
swirlee
Moderator
Moderator
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Tue Sep 07, 2004 6:18 am

If you're trying to create a serious server app, you're much better off using C++ or Java. PHP is not designed for writing server software, and will not serve you well for such.

However, if you want a good example of such an application, take a look at Nanoweb.
Image

User avatar
mike
New php-forum User
New php-forum User
Posts: 73
Joined: Sun May 04, 2003 4:26 am
Location: Athens
Contact:

Tue Sep 07, 2004 6:31 am

Thanks for the link! Seems very intresting... By the way I dont want to create an httpd deamon or something similar, just a small application to run some commands any time.

I think PHP is good for Server Apps, but not as best as possible. Plesk Control Panel is totally written in PHP.
11:16am up 404 days, 2 users, load average: 148.68, 143.45, 132.6


Mike Vassileiou
[Systems Administrator / PHP Developer]


PHP/MySQL Manual:
http://www.phpmysql-manual.com

User avatar
swirlee
Moderator
Moderator
Posts: 2257
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back
Contact:

Tue Sep 07, 2004 6:41 am

mike wrote:I think PHP is good for Server Apps, but not as best as possible. Plesk Control Panel is totally written in PHP.


Plesk Control Panel is not a daemon. In order for a daemon to work, it must be running constantly, which can be tricky with PHP. Plesk is just like any other web app -- it's executed only when it's requested.
Image

User avatar
mike
New php-forum User
New php-forum User
Posts: 73
Joined: Sun May 04, 2003 4:26 am
Location: Athens
Contact:

Tue Sep 07, 2004 7:15 am

Yeap, but its always running on the background and its ready to execute commands... is this a "deamon"?
11:16am up 404 days, 2 users, load average: 148.68, 143.45, 132.6


Mike Vassileiou
[Systems Administrator / PHP Developer]


PHP/MySQL Manual:
http://www.phpmysql-manual.com

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1279
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Tue Sep 07, 2004 8:56 pm

I think youre confusing yourself between an
Server Application (Like Plesk ) and a daemon.

A daemon sits behind and answers the call.. (in the OS)
while a webiste reponds when given a request only

User avatar
mike
New php-forum User
New php-forum User
Posts: 73
Joined: Sun May 04, 2003 4:26 am
Location: Athens
Contact:

Wed Sep 08, 2004 1:54 am

Well I know the difference between them but I made my self misundertood. I have created a deamon to execute linux commands, commands given through a web application. This "deamon" is running constantly and every 2" is checking a single file for commands to execute. I was wondering if I can do that in any other way like sockets or direct call.
11:16am up 404 days, 2 users, load average: 148.68, 143.45, 132.6


Mike Vassileiou
[Systems Administrator / PHP Developer]


PHP/MySQL Manual:
http://www.phpmysql-manual.com

Post Reply