Announcement

Collapse
No announcement yet.

Is This Correct? (Shebang Line)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Is This Correct? (Shebang Line)

    I sent the following message to my host (1&1), which vB staff told me uses PHP compiled as CGI and requires a shebang line. The example shebang line given on the member downloads page is a little confusing because I've never seen one with /php on the end before:

    I've just learnt that the reason for the 500 server error I had running certain aspects of vBulletin 3 is because PHP under 1&1 runs as CGI (compiled as a CGI Module). Now in order to get the proper revision of vB3 for this I need the CGI shebang line, the example given by the vB team (e.g: #!/usr/bin/php) is different to the usual PERL path at the top of .CGI scripts (e.g: #!/usr/bin/perl).

    I can only assume that PHP compiled as CGI needs a special /php aspect, but could somebody confirm the exact path to use?
    Their responce was this, which doesn't help me and is exactly as I expected - a typically generic reply without any certainty:

    Both our Business and Professional packages have the rights to run cgi and perl files.

    These files have to have an extension of either .pl or .cgi and then have there permissions set to execute (chmod 755 filename.pl).

    You can run scripts from a directory called cgi-bin if you make this directory in your root folder. If you do this then .html files stored in or below the cgi-bin directory will not be accessable.

    It is best to just create a folder not called cgi-bin in which you store your scripts or to just have the scripts in any folder.


    Some common configuration options are :

    Document Root (the absolute path to your web) ->
    $ENV{'DOCUMENT_ROOT'} (Perl) or $DOCUMENT_ROOT (PHP)
    File extension for Perl scripts : .pl
    File extension for PHP scripts : .php3 / .php4
    Perl location : /usr/bin/perl
    Sendmail location : /usr/sbin/sendmail
    Python location : /usr/bin/python
    MySQL location : /usr/bin/mysql

    Perl is version 5.00502
    MySQL Version 3.23.51
    PHP Version 4.2.3
    Apache 1.3.3
    Python version 2.2

    And the following for more information on the php installation :
    http://rtb.me.uk/check.php
    Yes.. yes I know all that, but the vB example of the path has a /php on the end and that's not listed. Can somebody give me a little clarity, the vB team have only offered generic and unspecific replies.. I need something I can use.

  • #2
    Did you try it without the shebang? It seems, that you didn't specify a shebang for the phpinfo-File. I've never added any shebang to my files and everything is running fine and I'm on 1&1, too.

    Do you have Shell-Access, too? Then try find /usr/bin/ -name php\*
    On my server the path should be #!/usr/bin/php3 (Not tested) But try it without the shebang first.
    Hints & Tips:
    [[vB3] More Spiders / Indexers / Archives for vB3 - list]|[List of one-time-emails to ban]


    http://sfx-images.mozilla.org/affili...efox_80x15.png

    Comment


    • #3
      You'll need to ask you host the correct path to PHP on this server.
      Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
      Change CKEditor Colors to Match Style (for 4.1.4 and above)

      Steve Machol Photography


      Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


      Comment


      • #4
        Found it: Its /usr/local/bin/php4 on my 1&1-webspace. Should be the same on yours

        Anyway PHP works fine without the shebang. At least on my 1&1-webspace and its compiled as a CGI-Binary, too.
        Hints & Tips:
        [[vB3] More Spiders / Indexers / Archives for vB3 - list]|[List of one-time-emails to ban]


        http://sfx-images.mozilla.org/affili...efox_80x15.png

        Comment


        • #5
          My own personal PHPInfo. is here:

          http://www.ispreview.co.uk/talk/phpinfo.php

          Basically I highlighted that following a 500 error on the Add/Modify forum section (added a forum, then later when to click 'Modify' and got the 500 error) and a member of vB's staff told me that was caused because my PHP had been compiled as CGI and that I needed the shebang.

          I don't think you need it for EVERY PHP, since I have many other PHP systems and all have worked without such errors. Indeed vB3 worked without such errors until that one and it might just be that 'one' that needs it. Silly, but all I know is what the vB team tell me.

          The find search reported:

          /usr/bin/php-config
          /usr/bin/php3
          /usr/bin/phpextdist
          /usr/bin/phpize
          /usr/bin/phptar

          Since the server uses PHP4, shouldn't there be a /php4 instead of /php3? Or is it fine to use /php3 with a system that needs PHP4?

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X