NetTalk Central

Author Topic: Serving PHP pages  (Read 4269 times)

Nick

  • Full Member
  • ***
  • Posts: 118
    • View Profile
    • Email
Serving PHP pages
« on: August 07, 2013, 01:05:08 PM »
Can someone tell me what has to be done to the php.ini file? I know there is a complete ini file in the example
but I'm looking for the changes. What do I have to change and/or add to the ini file?
BTW the example (58) gives an GPF here at startup.

Are other files needed?

Is the general idea to serve the php pages (with Nettalk) on request, to parse them and then to feed them to the php executable,
pick up the output  (The man with the hat's doing) and send that to the browser?
Then any data the php executable includes in its output (from database for example) will be available too and
might even be parsed as well before actually sending it, right?

Nick

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Serving PHP pages
« Reply #1 on: August 07, 2013, 03:11:57 PM »
works for me. what nt version are you on? Also try the following:

1) Rename the example folder, removing the brackets, in order for it to work. The PHP engine doesn’t like folder names with brackets + try to make folder shorter
2) Make sure OddJob is included in Application

Nick

  • Full Member
  • ***
  • Posts: 118
    • View Profile
    • Email
Re: Serving PHP pages
« Reply #2 on: August 09, 2013, 04:01:00 AM »
Thanks Kevin but that is not what I wanted to know.
Is the idea of how it should work ok and what's different in the ini than normal?
I've heard/read about "dynamic" stuff that the php-exe would generate and that this could not be captured?
If the output from php-exe is captured by OddJob then what is that "dynamic"part?

Nick

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11247
    • View Profile
Re: Serving PHP pages
« Reply #3 on: August 09, 2013, 08:03:52 AM »
Hi Nick,

The php engine consumes HTML pages, saved as .php on the disk, and containing PHP Server code. The php engine then "interprets" that page, and populates it with dynamic stuff. The output from the php engine is then captured by Oddjob, fed back to the NetTalk server and passed to the browser.

As to the PHP language and what it all does, that I can't help you with - that's outside my level of expertise.

cheers
Bruce

Nick

  • Full Member
  • ***
  • Posts: 118
    • View Profile
    • Email
Re: Serving PHP pages
« Reply #4 on: August 09, 2013, 12:50:36 PM »
Hi Bruce,

So there is an Apache server and a Nettalk server working.
Nettalk could then parse data in and retrieve data out of the php pages before they are send to the browser, right?

Could you show me what ini lines are changed? I mean replacing an existing ini is with this one is probably not a good idea.

Thanks,
Nick

Nick

  • Full Member
  • ***
  • Posts: 118
    • View Profile
    • Email
Re: Serving PHP pages
« Reply #5 on: August 09, 2013, 02:41:06 PM »
Hi Bruce,

So there is an Apache server and a Nettalk server working.
Nettalk could then parse data in and retrieve data out of the php pages html-pages before they are send to the browser, right?

Could you show me what ini lines are changed? I mean replacing an existing ini is with this one is probably not a good idea.

Thanks,
Nick

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11247
    • View Profile
Re: Serving PHP pages
« Reply #6 on: August 11, 2013, 04:26:43 AM »
No, there's no Apache server at all. The PHP engine is php-cgi.exe - and that's called directly from the nettalk server (using OddJob).

>> Nettalk could then parse data in and retrieve data out of the php pages html-pages before they are send to the browser, right?

Bear in mind that my experience with PHP is very limited, so this answer is largely what I understand, and not something I've tested.

It appears to me that the whatever is output from the php engine (ie it's now "html" as you say) is then parsed for NetTalk tags in the usual way. see; http://www.capesoft.com/docs/NetTalk7/NetTalkWebBasic.htm#Tags

To test it I'd start with something very simple;
ie set the first line to be
<!-- NetWebServer -->
and then embed a simple session value;
<!-- Net:s:SessionVariable -->

cheers
Bruce




Nick

  • Full Member
  • ***
  • Posts: 118
    • View Profile
    • Email
Re: Serving PHP pages
« Reply #7 on: August 11, 2013, 05:40:42 AM »
>>No, there's no Apache server at all. The PHP engine is php-cgi.exe - and that's called directly from the nettalk server (using OddJob).

Yes, just found out. Saw a php page in the webserver settings. That was not very clear in the doc's I guess.

>>>> Nettalk could then parse data in and retrieve data out of the php pages html-pages before they are send to the browser, right?

>> Bear in mind that my experience with PHP is very limited, so this answer is largely what I understand, and not something I've tested.
>> It appears to me that the whatever is output from the php engine (ie it's now "html" as you say) is then parsed for NetTalk tags in the usual way. >> see; http://www.capesoft.com/docs/NetTalk7/NetTalkWebBasic.htm#Tags

>> To test it I'd start with something very simple;
>> ie set the first line to be
>> <!-- NetWebServer -->
>> and then embed a simple session value;
>> <!-- Net:s:SessionVariable -->

Thanks! Best way is probably playing with it. Seems pretty interesting.

Nick