SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy #!/usr/local/bin/php - setting string and .htaccess question.

    The existing host i'm with sent me the following info when I couldn't get a page with the following code to work:
    PHP Code:
    <?php
    phpinfo
    ();
    ?>
    "...For the php script to work you need to inidicate the path to php in the first line of the scripts (#!/usr/local/bin/php)...."

    Huh? This is a first for me (sure with Perl, or a shell script, but not PHP). Is there a way to set this value in an .htaccess file?

    Oh, and my attempt at an .htaccess file of the following contents, resulted in a error 500:
    Code:
    php_value include_path ".:/home/<cust#>/includes/"
    (both with and without quotes results in error 500) - still waiting to hear from 'em, but is this the only way to create an include path rule if I don't have access to php.ini?

  2. #2
    PHP manual bot bronze trophy Gaheris's Avatar
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You got it wrong, your PHP file must look like this.
    PHP Code:
    #!/usr/local/bin/php
    <?php
    phpinfo
    ();
    ?>
    It sucks though.

  3. #3
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you should be able to use ini_set...

    PHP Code:
    <?php
    $sep 
    = ( strstrstrtoupperPHP_OS ) , 'WIN' )  ) ? ';' ':' ;
    ini_set'include_path' ini_get('include_path') . $sep '/path/to/add' );
    ?>

  4. #4
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by firepages
    you should be able to use ini_set...
    PHP Code:
    <?php
    $sep 
    = ( strstrstrtoupperPHP_OS ) , 'WIN' ) ) ? ';' ':' ;
    ini_set'include_path' ini_get('include_path') . $sep '/path/to/add' );
    ?>
    is this for windows/IIS ?

    my host uses RH7.2 ... would the code above still apply?

    thanks,'

    hak

  5. #5
    PHP manual bot bronze trophy Gaheris's Avatar
    Join Date
    Oct 2003
    Location
    Germany
    Posts
    2,195
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It should work, it is coded to work with both, Win and Linux.

  6. #6
    Atomic Robot Man pezagent's Avatar
    Join Date
    Oct 2003
    Location
    New Zealand
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by hakalugi
    "...For the php script to work you need to inidicate the path to php in the first line of the scripts (#!/usr/local/bin/php)...."

    Huh? This is a first for me (sure with Perl, or a shell script, but not PHP). Is there a way to set this value in an .htaccess file?
    Yeah, me too. My remote host service sets that path automatically so I don't have to worry about it. Why would your host not have that set up? That's very strange.

    Johnny
    SQLZoo | ZVON Xlab
    May the Source Be With You
    When the app is ready, the oop will appear...

  7. #7
    SitePoint Zealot
    Join Date
    Aug 2002
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pezagent
    Yeah, me too. My remote host service sets that path automatically so I don't have to worry about it. Why would your host not have that set up? That's very strange. [img]images/smilies/crazy.gif[/img]

    Johnny [img]images/smilies/smile.gif[/img]
    as of now i'm "forced" to use this host, my first time working with them. if things become too difficult, I'll just move the site to a host I have several sites on...

    crazy, still waiting on how to get include(xyz.php); to work. They've escalated it (!) as a normal include call (with the path set in the .htaccess) causes a server error 500

  8. #8
    ********* Member website's Avatar
    Join Date
    Oct 2002
    Location
    Iceland
    Posts
    1,238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow, I've never neede to do this except perhaps when I am executing php scripts with crob job (so the script isn't really run from the web)
    - website


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •