Re: Three quickies anyone?
| From: | David Tulloh | Date: | Mon, 27 Mar 2006 15:07:13 +0000 |
| Subject: | Re: Three quickies anyone? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-232615@lists.php.net to get a copy of this message | ||
Ryan A wrote:
> ...
> 1.
> I start my CLI scripts with:
> #!/usr/local/etc/php
>
> as thats the path on my machine... the problem is some of these scripts will
> have to be installed on clients machines by them... any easy way for them
> to find out whats the path PHP is installed on their machine? (this q is
> more of a doubt really)
>
> is it the same as $_SERVER["include_path"]
>
I don't think I even have a $_SERVER["include_path"], I certainly
wouldn't count on it pointing to the php binary. As another user
pointed out,
which php is probably the safest way.
If you are concerned about a simple method for clients, a quick bash
script which finds php and adds the appropriate line to the top of the
file would be simple. Getting them to install a webpage to find out
where the php binary is seems excessive.
>
> 2.
> This ones more of an Apache question but related to my php script and I
> think its safe to assume everyone on this list has worked with Apache and
> some have a ****ing good understanding of the server.
>
> Basically I am trying to pipe some data into my php script by adding this to
> my .htaccess file:
> CustomLog "| /home/petpass/public_html/test/testing.php"
>
> but it gives me an error as I try to access the directory where the
> .htaccess file is in....
>
> it works perfectly fine when/if I add the exact same directive in my
> httpd.conf file though.... so, does the format need to be changed in some
> way to add it to my .htaccess file or is it simply not allowed in the
> htaccess file?
>
The logging directives including CustomLog can't be set in the .htaccess
file. You can set it in the server config or in a virtual host config.
>
>
> 3.
> This should be a rather simple question but I just confused myself after
> reading/searching google (i do that to myself sometimes, totally
> unintentional really)
> Can I run CLI/Shell scripts
> eg: scripts that began with the #!<php path>
> on machines that have PHP loaded as a CGI and as a module or only as a CGI
> or only as a module?
>
You can use the CGI executable to execute shell scripts however you will
get http headers like Content-type: and HTML versions of output from a
few functions such as phpinfo.
You can't execute scripts using the Apache module.
David