Forum OpenACS Q&A: php + aolserver + oacs

Collapse
Posted by edwin ho on
Hi,

I think is a bit off topic but I need some help intergrating php into
aolserver. I'ved on the aolserver list and still couldn't get it to
work.

I've compiled the module and stuff, I'ved added the lines into my
config.tcl but aolserver won't pass the php file to the php module.

maybe to lessen the clutter, someone with some spare time can email
me prv to help me?

thanks
edwin

Collapse
Posted by Jun Yamog on
Hi Edwin,

You can try a search on the bboards and enter this "php integration".  I am not trying to be sarcastic here, its just that the search results are good.  Its better to just put the keywords that I used rather than pasting a bunch of links here.  The first few threads is about OpenACS's gatekeeper package.  Things are separate still but on the end users it's still one site.

Collapse
Posted by Bart Teeuwisse on
Edwin,

give these settings a try, they work for me:

ns_section "ns/server/${server}/modules"
       ns_param   php             ${bindir}/libphp4.so

I haven't followed the AOLServer thread very well but I belief this might be your missing link:

ns_section "ns/server/${server}/module/php"
       ns_param map                             *.php

Good luck.

/Bart

P.S. Don't forget to replace ${server} with whatever applies to your configuration.

Collapse
Posted by edwin ho on
Bart, this is what I currently have in my config file.
ns_section "ns/server/${servername}/module/php"
        ns_param        map     *.php
        ns_param        map     *.php3
        ns_param        php_value "session.auto_start 1"


ns_section "ns/server/${servername}/modules"
        ns_param        php             ${bindir}/libphp4.so

my oacs site is in /www/edwinx
so i made a copy of the libphp4.so and placed it into /www/edwinx/bin

but my php files are still coming out as plain files.
is there a way to see which modules aolserver has loaded up?

thanks, edwin

Collapse
Posted by Radam Batnag on

Edwin,

Just follow this guide from OpenForce: http://openforce.biz/library/doc/openacs/php-on-aolserver.adp

I tried this successfully with AOLServer 3.3 and PHP 4.2.0 on Red Hat 7.3. Your .tcl file's OK, maybe it's with the way you compiled PHP?

To check if PHP is being loaded properly, grep for the following in your error log:

Notice: modload: loading '/usr/local/aolserver/bin/libphp4.so'
Notice: Registering PHP for "*.php"
Debug: modload: initializing module 'php'

To know where your error log is located, look for the serverlog parameter in the ns/parameters section. My .tcl file contains something like this:

ns_section ns/parameters 
ns_param   serverlog          ${homedir}/log/${server}-error.log 
Collapse
Posted by Cheng-Yi Hsu on
I have same problem, here is my experience:
if you install php + aolserver , it works.
but if you combine acs + php + aolserver. It can not service php program,
I had check my server.log and make sure the php module had been loaded, but have no idea about why it happen !
Collapse
Posted by Don Baccus on
Check rp_serve_concrete_file in /packages/acs-tcl/tcl/request-processor-procs.tcl.  If it doesn't recognize the file it just returns it back to the browser, which skips AOLserver's processing of it.  OACS isn't designed to support integration of this sort but it shouldn't be too hard to make it do so.

You probably need to explicitly check for your PHP extensions in the procedure and then return filter_ok rather than return the file in this case.  I believe that if you do this then AOLserver will ship the file off to the PHP module but have not tested it myself (nor will I be doing so).

I also may be misreading the source and this may not be the problem at all but it does explain the experiences related by folks above.

Collapse
Posted by Bart Teeuwisse on
Don,

based on personal experience I doubt that /packages/acs-tcl/tcl/request-processor-procs.tcl has anything to do with this problem. I'm running an OACS site + IMP + PHP without any problems. The config file contains the basic PHP parameters and there are no modifications to the request processor.

/Bart

Collapse
Posted by edwin ho on
I've tried all the suggestions and none are working. The only one that I  haven't tried yet is Don's method, I'll hold off on that. But for some reason, my site isn't even responding to public requests even thought aolserver is up and running.  I'm gonna do re-install and see if that helps.

thanks
edwin