Forum Moderators: coopster

Message Too Old, No Replies

[#!/usr/local/bin/php]

         

aktell

2:41 am on Jun 14, 2005 (gmt 0)

10+ Year Member



I have a question? When my php pages are showing they work fine in Apache, but I have the [#!/usr/local/bin/php] in the top left corner all the times showing? I can't remember what to do there as I did all this around two to three years ago and just starting up again. Any help is appreciated.

Thanks aktell

mcavic

3:38 am on Jun 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You should be able to take that line out, and it'll still work under apache.

freeflight2

4:16 am on Jun 14, 2005 (gmt 0)

10+ Year Member



#!/usr/bin/perl is an "active" comment for the Unix shells such as bash or tcsh - apache doesn't need these since it automatically activates the php engine once its handler is linked to .php (default) or whatever

StupidScript

4:44 pm on Jun 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As freeflight mentions, it's for scripts that would run under the shell, and not through the Apache module.

For example, if you have a script that dumps your logfiles into a database, you might want to run that script automatically each evening by executing it as a cronjob. Since you wouldn't be starting up a web browser and accessing the script (Apache), but rather telling your system to run the script under the shell, the shell would need to know where to find the appropriate program it needs to execute the script.

Apache knows, and doesn't need the line.
The shell does not know, and so it needs the line.
(also called a "bang" or "shebang")