Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > Using php in custom built http server
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 27th May 19:43
grmrgecko
External User
 
Posts: 1
Default Using php in custom built http server


Hey, I built my own http server, and I'm wanting to add php to it. the
server is in Objective-C.
I know I can use terminal commands to do it, but if I was to do that
how would I get headers and stuff php sends, and how would I send php
HTTP_REMOTE_ADDRESS and stuff like that?
I would prefer doing it with terminal commands, but I am willing it do
it with a library or however I have to do it.

Thanks,
Mr. Gecko
  Reply With Quote


  sponsored links


2 27th May 19:43
grmrgecko
External User
 
Posts: 1
Default Using php in custom built http server


Hey, I built my own http server, and I'm wanting to add php to it. the
server is in Objective-C.
I know I can use terminal commands to do it, but if I was to do that
how would I get headers and stuff php sends, and how would I send php
HTTP_REMOTE_ADDRESS and stuff like that?
I would prefer doing it with terminal commands, but I am willing it do
it with a library or however I have to do it.

Thanks,
Mr. Gecko
  Reply With Quote
3 27th May 19:43
nrixham
External User
 
Posts: 1
Default Using php in custom built http server


I'd get the php source if i was you and go from there..
  Reply With Quote
4 27th May 19:43
quickshiftin
External User
 
Posts: 1
Default Using php in custom built http server


there is a well known book, by sara golemon, extending & embedding
php<http://tinyurl.com/a75bbk>.
youll almost certainly want to grab that. there are also some nice pdf's
and articles online, mostly for writing extensions afaict. only a small
portion of the book about embedding php, but to give you a quick overview,
the most simple approach to embedding essentially boils down to including
libphp, and invoking it with a string of php & the C level eval(). the book
will get you going from there.

im sure if you know what youre doing, which if you could write a webserver
in objc, i suppose you would, should be able to get the eval-based approach
working 'pretty quickly'TM. from there you can experiment w/ the info the
book has and it would probly be good to find some smaller webserver projects
that support php, like lighttpd <http://www.lighttpd.net/download>.
lighttpd is stricly C tho, if im not mistaken, but im sure youll find some
nice example segments there.

I would prefer doing it with terminal commands, but I am willing it do it

well, im not sure what you need to do, make-file-wise, to get C to compile
into an objective-C application, but i know it can be done, b/c i did it on
an iphone app where we used the C interface to sqlite3. im sure if youre
webserver is using objective-C classes, and some of its neat runtime
features, you might wind up writing some sort of OO wrapper around phps
embedding api, but thats just a guess.

btw, is this a private project or is the code out there somewhere ?

-nathan
  Reply With Quote


  sponsored links


5 27th May 19:43
grmrgecko
External User
 
Posts: 1
Default Using php in custom built http server


Hey, I built my own http server, and I'm wanting to add php to it. the
server is in Objective-C.
I know I can use terminal commands to do it, but if I was to do that
how would I get headers and stuff php sends, and how would I send php
HTTP_REMOTE_ADDRESS and stuff like that?
I would prefer doing it with terminal commands, but I am willing it do
it with a library or however I have to do it.

Thanks,
Mr. Gecko
  Reply With Quote
6 27th May 19:43
grmrgecko
External User
 
Posts: 1
Default Using php in custom built http server


Hey, I built my own http server, and I'm wanting to add php to it. the
server is in Objective-C.
I know I can use terminal commands to do it, but if I was to do that
how would I get headers and stuff php sends, and how would I send php
HTTP_REMOTE_ADDRESS and stuff like that?
I would prefer doing it with terminal commands, but I am willing it do
it with a library or however I have to do it.

Thanks,
Mr. Gecko
  Reply With Quote
7 27th May 19:43
nrixham
External User
 
Posts: 1
Default Using php in custom built http server


I'd get the php source if i was you and go from there..
  Reply With Quote
8 27th May 19:43
quickshiftin
External User
 
Posts: 1
Default Using php in custom built http server


there is a well known book, by sara golemon, extending & embedding
php<http://tinyurl.com/a75bbk>.
youll almost certainly want to grab that. there are also some nice pdf's
and articles online, mostly for writing extensions afaict. only a small
portion of the book about embedding php, but to give you a quick overview,
the most simple approach to embedding essentially boils down to including
libphp, and invoking it with a string of php & the C level eval(). the book
will get you going from there.

im sure if you know what youre doing, which if you could write a webserver
in objc, i suppose you would, should be able to get the eval-based approach
working 'pretty quickly'TM. from there you can experiment w/ the info the
book has and it would probly be good to find some smaller webserver projects
that support php, like lighttpd <http://www.lighttpd.net/download>.
lighttpd is stricly C tho, if im not mistaken, but im sure youll find some
nice example segments there.

I would prefer doing it with terminal commands, but I am willing it do it

well, im not sure what you need to do, make-file-wise, to get C to compile
into an objective-C application, but i know it can be done, b/c i did it on
an iphone app where we used the C interface to sqlite3. im sure if youre
webserver is using objective-C classes, and some of its neat runtime
features, you might wind up writing some sort of OO wrapper around phps
embedding api, but thats just a guess.

btw, is this a private project or is the code out there somewhere ?

-nathan
  Reply With Quote
9 27th May 22:59
quickshiftin
External User
 
Posts: 1
Default Using php in custom built http server


actually, i think thats how lighttpd does it

-nathan
  Reply With Quote
10 27th May 22:59
mike503
External User
 
Posts: 1
Default Using php in custom built http server


Also could look at using fastcgi and would not have to embed libphp
and such.
  Reply With Quote
Reply


Thread Tools
Display Modes




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