• Installing PHP5 with SBBS3.15a

    From Scottie@VERT/VHCBBS to All on Thu Nov 18 11:29:01 2010
    Hello everyone. For a while now I have been trying to get PHP5 to work on my Synchronet BBS. I will show how I have have things setup and maybe just maybe someone out there in BBS land may be able to help me.
    First off, I am using php-5.2.14-Win32.zip from php.net website.
    I unzipped the archive and placed it in "C:\PHP5"
    I used the php.ini-recommended for my php.ini file.

    * I copyed the php.ini to c:\windows
    * I also included "C:\PHP5" in the system Enviromnet PATH

    php.ini
    ----------
    *Windows Path
    include_path = ";c:\php5\includes"

    *Document Root
    doc_root = "c:\sbbs\web\root"

    *Extention Directory
    extention_dir = "c:\php5\ext\"

    NOTE:
    *I HAVE NOT uncommented any extentions in the extentions list.
    *The rest of the php.ini is as is. No changes have been made.


    web_handler.ini
    ----------------
    [CGI]
    php = c:/php5/php-cgi
    cgi = /perl/bin/perl
    pl = /perl/bin/perl


    sbbs.ini
    ---------
    [WEB]
    CGIExtentions=.cgi,.php,.pl





    OK, So that is what I have so far.
    Now if I do a simple echo test in the main.inc file.
    Example:
    <?php
    $test = "12356 - this is a test - 67890";
    echo $test;


    Then navigate to the index.ssjs there is nothing. No error, no echo nothing except the embedded javascript that is on the main.inc itself.

    I guess I am trying to setup PHP like you would for Apache Server.
    But I havent added "PHPDir" to any file. Do to the fact that I would now where to add this anyway.
    Im not ever sure PHP can be used like this in SBBS. Along time ago I was told to use PHP in CGI mode. What is CGI Mode????
    php.net doesnt even explain in any detail what php in CGI Mode is or even how to use it.
    I completely understand that writing Documents and the BBS itself takes alot
    of time. But I have been working on this issue for quit sometime now with zero results.

    If there is away to get this to work with some help from someone. I will be more than glad to write up a Document on how to setup PHP under Synchronet BBS or something!





    ---

    Scottie
    http://octane.synchro.net
    For every action, there is a beer.
    For every beer, should be a shot of whiskey.
    For every shot of whiskey, that will be $5.00!
    Yahoo: octanebbs@yahoo.com
    ICQ: 367812078
    Scott Knapp
    1:123/65
    ---
    ■ Synchronet ■ Octane BBS - 72.148.214.60
  • From Digital Man@VERT to Scottie on Thu Nov 18 15:56:51 2010
    Re: Installing PHP5 with SBBS3.15a
    By: Scottie to All on Thu Nov 18 2010 11:29 am

    Hello everyone. For a while now I have been trying to get PHP5 to work on
    my Synchronet BBS. I will show how I have have things setup and maybe just maybe someone out there in BBS land may be able to help me.
    First off, I am using php-5.2.14-Win32.zip from php.net website.
    I unzipped the archive and placed it in "C:\PHP5"
    I used the php.ini-recommended for my php.ini file.

    * I copyed the php.ini to c:\windows
    * I also included "C:\PHP5" in the system Enviromnet PATH

    php.ini
    ----------
    *Windows Path
    include_path = ";c:\php5\includes"

    *Document Root
    doc_root = "c:\sbbs\web\root"

    *Extention Directory
    extention_dir = "c:\php5\ext\"

    NOTE:
    *I HAVE NOT uncommented any extentions in the extentions list.
    *The rest of the php.ini is as is. No changes have been made.


    web_handler.ini
    ----------------
    [CGI]
    php = c:/php5/php-cgi
    cgi = /perl/bin/perl
    pl = /perl/bin/perl


    sbbs.ini
    ---------
    [WEB]
    CGIExtentions=.cgi,.php,.pl





    OK, So that is what I have so far.
    Now if I do a simple echo test in the main.inc file.
    Example:
    <?php
    $test = "12356 - this is a test - 67890";
    echo $test;


    No, that won't work. You need to have an index.php file (for example) for the file to be parsed by the PHP engine.

    Then navigate to the index.ssjs there is nothing. No error, no echo nothing except the embedded javascript that is on the main.inc itself.

    I guess I am trying to setup PHP like you would for Apache Server.
    But I havent added "PHPDir" to any file. Do to the fact that I would now where to add this anyway.
    Im not ever sure PHP can be used like this in SBBS. Along time ago I was told to use PHP in CGI mode. What is CGI Mode????

    CGI mode means the .php file is passed to the php-cgi interpretter and the results are sent to the client.

    php.net doesnt even explain in any detail what php in CGI Mode is or even how to use it.
    I completely understand that writing Documents and the BBS itself takes
    alot of time. But I have been working on this issue for quit sometime now with zero results.

    If there is away to get this to work with some help from someone. I will be more than glad to write up a Document on how to setup PHP under Synchronet BBS or something!

    Try creating a test.php file with simple PHP content and enter that into your brower. You can't mix SSJS and PHP content in the same file.

    digital man

    Snapple "Real Fact" #114:
    The oldest known animal was a tortoise, which lived to be 152 years old.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ telnet://vert.synchro.net
  • From Scottie@VERT/VHCBBS to Digital Man on Thu Nov 18 22:02:26 2010
    Re: Installing PHP5 with SBBS3.15a
    By: Scottie to All on Thu Nov 18 2010 11:29 am

    Hello everyone. For a while now I have been trying to get PHP5 to work
    on my Synchronet BBS. I will show how I have have things setup and maybe just maybe someone out there in BBS land may be able to help me.
    First off, I am using php-5.2.14-Win32.zip from php.net website.
    I unzipped the archive and placed it in "C:\PHP5"
    I used the php.ini-recommended for my php.ini file.

    * I copyed the php.ini to c:\windows
    * I also included "C:\PHP5" in the system Enviromnet PATH

    php.ini
    ----------
    *Windows Path
    include_path = ";c:\php5\includes"

    *Document Root
    doc_root = "c:\sbbs\web\root"

    *Extention Directory
    extention_dir = "c:\php5\ext\"

    NOTE:
    *I HAVE NOT uncommented any extentions in the extentions list.
    *The rest of the php.ini is as is. No changes have been made.


    web_handler.ini
    ----------------
    [CGI]
    php = c:/php5/php-cgi
    cgi = /perl/bin/perl
    pl = /perl/bin/perl


    sbbs.ini
    ---------
    [WEB]
    CGIExtentions=.cgi,.php,.pl





    OK, So that is what I have so far.
    Now if I do a simple echo test in the main.inc file.
    Example:
    <?php
    $test = "12356 - this is a test - 67890";
    echo $test;


    No, that won't work. You need to have an index.php file (for example) for the file to be parsed by the PHP engine.

    Then navigate to the index.ssjs there is nothing. No error, no echo nothing except the embedded javascript that is on the main.inc itself.

    I guess I am trying to setup PHP like you would for Apache Server.
    But I havent added "PHPDir" to any file. Do to the fact that I would now where to add this anyway.
    Im not ever sure PHP can be used like this in SBBS. Along time ago I was told to use PHP in CGI mode. What is CGI Mode????

    CGI mode means the .php file is passed to the php-cgi interpretter and the results are sent to the client.

    php.net doesnt even explain in any detail what php in CGI Mode is or
    even how to use it.
    I completely understand that writing Documents and the BBS itself takes alot of time. But I have been working on this issue for quit sometime
    now with zero results.

    If there is away to get this to work with some help from someone. I will be more than glad to write up a Document on how to setup PHP under Synchronet BBS or something!

    Try creating a test.php file with simple PHP content and enter that into your brower. You can't mix SSJS and PHP content in the same file.

    digital man

    Snapple "Real Fact" #114:
    The oldest known animal was a tortoise, which lived to be 152 years old.

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ telnet://vert.synchro.net


    ----------------- UPDATE -----------------------
    OK, Thanks to Digital Man and a little digging around I was able to get php working with SBBS 3.15a. All I real had todo was go here http://wiki.synchro.net/howto:php


    Edit your ctrl/web_handler.ini file.
    If you're using Synchronet for Windows, edit the [CGI.Win32] section, otherwise, edit the [CGI] section: Ensure the php key value points to the correct path (location) of your php-cgi (or php-cgi.exe) file.
    Example (*nix):
    [CGI]
    php = /usr/local/bin/php-cgi

    Example (Windows):
    [CGI.Win32]
    php = /php/php-cgi.exe


    Edit your ctrl/cgi_env.ini file, ensuring it contains the following lines: [REDIRECT_STATUS]
    value=200

    Add this to the bottom of the cgi_env.ini file.
    Then create a test.php and navigate to the test.php file.

    POW! It worked.

    Thanks Again Digital Man!

    ---

    Scottie
    http://octane.synchro.net
    For every action, there is a beer.
    For every beer, should be a shot of whiskey.
    For every shot of whiskey, that will be $5.00!
    Yahoo: octanebbs@yahoo.com
    ICQ: 367812078
    Scott Knapp
    1:123/65
    ---
    ■ Synchronet ■ Octane BBS - 72.148.214.60