• php-cgi

    From Mortifis@1:103/705 to All on Tue Mar 10 10:01:00 2020
    Running SBBS 3.17c Feb 21 2020 from, cvs update on Win_x86

    Error with php-cgi.exe

    3/10 09:54:59a 37132 Request: GET /cgi/test.php HTTP/1.1
    3/10 09:54:59a 37132 Executing FastCGI: C:\sbbs\etrucker\cgi\test.php
    3/10 09:55:00a 37132 Failure to send to FastCGI socket!
    3/10 09:55:00a 37132 !ERROR: 500 Internal Server Error (line 5876)

    test.php

    <?php

    echo "Hello World!";



    sbbs.ini, web_handler.ini, cgi_env.ini and webctrl.ini all setup as per http://wiki.synchro.net/howto:php

    Any ideas?

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rampage@1:103/705 to Mortifis on Tue Mar 10 12:01:36 2020
    Re: php-cgi
    By: Mortifis to All on Tue Mar 10 2020 10:01:00


    Mortifis> test.php

    Mortifis> <?php

    Mortifis> echo "Hello World!";

    that code is incomplete... it is missing the ending tag...

    <?php echo '<p>Hello World</p>'; ?>


    )\/(ark

    ---
    þ Synchronet þ The SouthEast Star Mail HUB - SESTAR
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Mortifis on Tue Mar 10 09:46:04 2020
    Re: php-cgi
    By: Mortifis to All on Tue Mar 10 2020 10:01 am

    Running SBBS 3.17c Feb 21 2020 from, cvs update on Win_x86

    Error with php-cgi.exe

    3/10 09:54:59a 37132 Request: GET /cgi/test.php HTTP/1.1
    3/10 09:54:59a 37132 Executing FastCGI: C:\sbbs\etrucker\cgi\test.php
    3/10 09:55:00a 37132 Failure to send to FastCGI socket!
    3/10 09:55:00a 37132 !ERROR: 500 Internal Server Error (line 5876)

    test.php

    <?php

    echo "Hello World!";



    sbbs.ini, web_handler.ini, cgi_env.ini and webctrl.ini all setup as per http://wiki.synchro.net/howto:php

    Any ideas?

    Do you have php-fpm running?

    digital man

    Synchronet "Real Fact" #43:
    Synchronet added Baja/PCMS support with v2.00a (1994).
    Norco, CA WX: 54.9øF, 97.0% humidity, 4 mph WSW wind, 0.28 inches rain/24hrs --- SBBSecho 3.10-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Mortifis@1:103/705 to Digital Man on Tue Mar 10 20:03:01 2020
    Re: php-cgi
    By: Mortifis to All on Tue Mar 10 2020 10:01 am

    Running SBBS 3.17c Feb 21 2020 from, cvs update on Win_x86

    Error with php-cgi.exe

    3/10 09:54:59a 37132 Request: GET /cgi/test.php HTTP/1.1
    3/10 09:54:59a 37132 Executing FastCGI:
    C:\sbbs\etrucker\cgi\test.php
    3/10 09:55:00a 37132 Failure to send to FastCGI socket!
    3/10 09:55:00a 37132 !ERROR: 500 Internal Server Error (line 5876)

    test.php

    <?php

    echo "Hello World!";



    sbbs.ini, web_handler.ini, cgi_env.ini and webctrl.ini all setup as per http://wiki.synchro.net/howto:php

    Any ideas?

    Do you have php-fpm running?

    digital man

    No, it isn't in my php7 distro

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to Mortifis on Tue Mar 10 17:29:23 2020
    Re: Re: php-cgi
    By: Mortifis to Digital Man on Tue Mar 10 2020 08:03 pm

    Re: php-cgi
    By: Mortifis to All on Tue Mar 10 2020 10:01 am

    Running SBBS 3.17c Feb 21 2020 from, cvs update on Win_x86

    Error with php-cgi.exe

    3/10 09:54:59a 37132 Request: GET /cgi/test.php HTTP/1.1
    3/10 09:54:59a 37132 Executing FastCGI: C:\sbbs\etrucker\cgi\test.php
    3/10 09:55:00a 37132 Failure to send to FastCGI socket!
    3/10 09:55:00a 37132 !ERROR: 500 Internal Server Error (line
    5876)

    test.php

    <?php

    echo "Hello World!";



    sbbs.ini, web_handler.ini, cgi_env.ini and webctrl.ini all setup as per http://wiki.synchro.net/howto:php

    Any ideas?

    Do you have php-fpm running?

    No, it isn't in my php7 distro

    Then your system doesn't support Fast CGI-PHP.

    digital man

    Synchronet "Real Fact" #45:
    Synchronet External "Plain Old Telephone System" support was introduced in 2007.
    Norco, CA WX: 63.2øF, 81.0% humidity, 1 mph SW wind, 0.41 inches rain/24hrs
    --- SBBSecho 3.10-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Mortifis@1:103/705 to Digital Man on Tue Mar 10 23:33:54 2020
    sbbs.ini, web_handler.ini, cgi_env.ini and webctrl.ini all setup
    as
    per http://wiki.synchro.net/howto:php

    Any ideas?

    Do you have php-fpm running?

    No, it isn't in my php7 distro

    Then your system doesn't support Fast CGI-PHP.

    digital man

    Hmmm... something to look into, just thought about it since I saw the support thread about php-cgi .. I have been using exec('php some-script.php'); calls from *.xjs scripts successfully ... just always assumed sbbs->php->mysql just worked because of the way I use it ...

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From alter ego@1:103/705 to Mortifis on Wed Mar 11 14:49:15 2020
    Re: Re: php-cgi
    By: Mortifis to Digital Man on Tue Mar 10 2020 11:33 pm

    Hmmm... something to look into, just thought about it since I saw the support thread about php-cgi .. I have been using exec('php some-script.php'); calls from *.xjs scripts successfully ... just always assumed sbbs->php->mysql just worked because of the way I use it ...

    There are two ways to run php:

    * php-cgi - this is like exec "php script.php" and is quite expensive. IE: Each time a php scripted that needs to executed, sbbs would need to exec it (an expensive OS operation).

    * php-fpm - this is like having php in daemon mode - where it is ready to run a php script. Its called over a socket or a TCP connection (normally to port 9000).

    php-fpm is by far the better way, its more effecient and way more scalable, but takes memory and (a little) cpu while waiting for work. But SBBS can do both.

    Deuce has just fixed the cgi method, there was a problem there (which is what I'm trying to use). It works, and I followed the wiki too. You'll need to recompile SBBS from today for those fixes.
    ...deon


    ... Don't hit me, Mr. Moderator! I'll go back on topic, I swear!

    ---
    þ Synchronet þ Alterant | an SBBS in Docker on Pi!
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Digital Man@1:103/705 to alter ego on Tue Mar 10 20:58:23 2020
    Re: Re: php-cgi
    By: alter ego to Mortifis on Wed Mar 11 2020 02:49 pm

    Deuce has just fixed the cgi method, there was a problem there (which is what I'm trying to use). It works, and I followed the wiki too. You'll need to recompile SBBS from today for those fixes.

    And that (now fixed) problem only affected sbbs when run non-daemonized.

    digital man

    This Is Spinal Tap quote #12:
    Nigel Tufnel: Well, I don't know - wh-wh-... what're the hours?
    Norco, CA WX: 58.1øF, 85.0% humidity, 2 mph SW wind, 0.42 inches rain/24hrs
    --- SBBSecho 3.10-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Mortifis@1:103/705 to alter ego on Wed Mar 11 21:48:34 2020
    Re: Re: php-cgi
    By: Mortifis to Digital Man on Tue Mar 10 2020 11:33 pm

    Hmmm... something to look into, just thought about it since I saw the support thread about php-cgi .. I have been using exec('php some-script.php'); calls from *.xjs scripts successfully ... just always assumed sbbs->php->mysql just worked because of the way I use
    it
    ...

    There are two ways to run php:

    * php-cgi - this is like exec "php script.php" and is quite expensive. IE: Each time a php scripted that needs to executed, sbbs would need to exec it (an expensive OS operation).

    * php-fpm - this is like having php in daemon mode - where it is ready to run a php script. Its called over a socket or a TCP connection (normally to port 9000).

    php-fpm is by far the better way, its more effecient and way more scalable, but takes memory and (a little) cpu while waiting for work. But SBBS can do both.


    Well, there are actually several ways to run php... as for SBBS related, there is a 3rd way ... for many years I have been executing php scripts from *.js, ssjs, xjs scripts using ... some php scripts I have run as timed events ie: SCFG->... COMMAND LINE php /sbbs/mods/blacklist.php ... just sayin

    Deuce has just fixed the cgi method, there was a problem there (which is what I'm trying to use). It works, and I followed the wiki too. You'll need to recompile SBBS from today for those fixes.
    ...deon

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From alterego@1:103/705 to Mortifis on Thu Mar 12 20:35:53 2020
    Re: Re: php-cgi
    By: Mortifis to alter ego on Wed Mar 11 2020 09:48 pm

    Well, there are actually several ways to run php... as for SBBS
    related,
    there is a 3rd way ... for many years I have been executing php scripts from *.js, ssjs, xjs scripts using ... some php scripts I have run as timed events ie: SCFG->... COMMAND LINE php /sbbs/mods/blacklist.php ... just sayin

    COMMAND LINE php, is php-cgi.
    ...deon

    ---
    þ Synchronet þ Alterant | an SBBS in Docker on Pi!
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Mortifis@1:103/705 to alterego on Thu Mar 12 07:54:27 2020
    Re: Re: php-cgi
    By: Mortifis to alter ego on Wed Mar 11 2020 09:48 pm

    Well, there are actually several ways to run php... as for SBBS related, there is a 3rd way ... for many years I have been executing php scripts from *.js, ssjs, xjs scripts using ... some php scripts I have run as timed events ie: SCFG->... COMMAND LINE php /sbbs/mods/blacklist.php ... just sayin

    COMMAND LINE php, is php-cgi.

    Sorry to disagree but they are not the same ...

    on my winbloz 7 system, and I am sure it is a common behavior for all,

    C:\php>php -v
    PHP 7.3.2 (cli) (built: Feb 5 2019 23:14:21) ( NTS MSVC15 (Visual C++ 2017) x86
    )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.3.2, Copyright (c) 1998-2018 Zend Technologies

    C:\php>php-cgi -v
    PHP 7.3.2 (cgi-fcgi) (built: Feb 5 2019 23:14:10)
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.3.2, Copyright (c) 1998-2018 Zend Technologies

    Refer to http://www.php-cli.com/php-cli-cgi.shtml

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From DaiTengu@1:103/705 to alterego on Thu Mar 12 09:29:06 2020
    Re: Re: php-cgi
    By: alterego to Mortifis on Thu Mar 12 2020 08:35 pm


    COMMAND LINE php, is php-cgi.

    command line php is php-cli it's definitely different.

    DaiTengu

    ... Most self-made men worship their creators.

    ---
    þ Synchronet þ War Ensemble BBS - The sport is war, total war - warensemble.com
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From alterego@1:103/705 to DaiTengu on Fri Mar 13 07:58:48 2020
    Re: Re: php-cgi
    By: DaiTengu to alterego on Thu Mar 12 2020 09:29 am

    COMMAND LINE php, is php-cgi.
    command line php is php-cli it's definitely different.

    Actually, I was talking in the context of execution. I can see how others may have read my original reply differently.

    Both php-cgi and php invoke php "scripts" via a command shell.

    php-fpm calls scripts by connecting to a socket - its a permanently running daemon.

    But yes, while each of the 3 methods "run a script", they do some things slighly differently when running said script.
    ...deon


    ... Obscenity is whatever gives a judge an erection.

    ---
    þ Synchronet þ Alterant | an SBBS in Docker on Pi!
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Mortifis@1:103/705 to Digital Man on Thu Mar 19 11:19:43 2020
    Re: Re: php-cgi
    By: Mortifis to Digital Man on Tue Mar 10 2020 08:03 pm

    Re: php-cgi
    By: Mortifis to All on Tue Mar 10 2020 10:01 am

    Running SBBS 3.17c Feb 21 2020 from, cvs update on Win_x86

    Error with php-cgi.exe

    3/10 09:54:59a 37132 Request: GET /cgi/test.php HTTP/1.1
    3/10 09:54:59a 37132 Executing FastCGI: C:\sbbs\etrucker\cgi\test.php
    3/10 09:55:00a 37132 Failure to send to FastCGI socket!
    3/10 09:55:00a 37132 !ERROR: 500 Internal Server Error (line 5876)

    test.php

    <?php

    echo "Hello World!";



    sbbs.ini, web_handler.ini, cgi_env.ini and webctrl.ini all setup
    as
    per http://wiki.synchro.net/howto:php

    Any ideas?

    Do you have php-fpm running?

    No, it isn't in my php7 distro

    Then your system doesn't support Fast CGI-PHP.

    digital man

    I finally got around to checking, the solution for me was to run php-cgi.exe -b
    127.0.0.1:9000 from a cmd shell :/

    ---
    þ Synchronet þ AlleyCat! BBS - http://alleycat.synchro.net:81
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)