setup php in rails template

Discussion in 'Install/Configuration' started by cswilliams, Jan 25, 2007.

  1. cswilliams

    cswilliams Member

    I'm using the provided rails virtual host template and everything is working fine. However, I want to add php support to this so I can run mint on my site. I installed and compiled php per your directions and didn't run into any problems. However, I'm having trouble getting php pages to work on my site now.
    First I setup an external application in my virtual host identical the external application that you have in the sample php template. I then was not sure whether to setup an lsapi context called /mint (i keep the mint php files in my rail's app's public folder) or to simply add a script handler for .php files.

    I tried both ways and I couldn't get it to work. When I created a context called /mint and then tried to go to any php page in it (I even created a sample php script that just called phpinfo()), I got the following error:
    2007-01-24 23:16:31.904 [NOTICE] [] [STDERR] PHP Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
    2007-01-24 23:16:31.904 [NOTICE] [] [STDERR] PHP Fatal error: Unknown: Failed opening required 'LS' (include_path='.:/usr/local/php5-lsws/lib/php') in Unknown on line 0

    I then tried removing this context and just adding a script handler for php files (using lsapi and linking to the external app I setup). Unfortunately though, any php page I tried to go to just came up as a blank page in my browser and viewing the source revealed the php script itself.

    I must also add that I tried using the php template by itself without any rails stuff and got the same behavior (scripts would just load as a blank page and you could see the source of the script if you did view source in the browser)

    I'm also using php 5.2.

    Any help would be appreciated.

    Thanks in advance,
  2. cswilliams

    cswilliams Member

    Well I got it working finally using the php script handler. An error in my test script was causing it just to output a blank page. doh! Its been awhile since I've worked in php ;)

    Anyhow, I am curious though, is there a way to get it to work through a context instead of through a script handler? I get those strange errors when I try to do it that way. No big deal though, just curious.
    Thanks again for this great piece of software.
  3. mistwang

    mistwang LiteSpeed Staff

    You have to use script handler configuration for php, context will not work. :)

Share This Page