You are here: Re: how to use the PHP path to send something explicitly to the PHP parser? « PHP Programming Language « IT news, forums, messages
Re: how to use the PHP path to send something explicitly to the PHP parser?

Posted by Justin Koivisto on 11/02/05 01:13

lkrubner@geocities.com wrote:
> Hi. I'm messing around with some stuff in an .htaccess file. Among
> other things, I'd like to send my html files to the PHP parser. I'd
> also like to rewrite the urls using Apache mod_rewrite, so that the
> query string disappears, but the variables are still recorded. For all
> these tasks, I need to know the PHP path. When I run phpinfo, I see
> this listed as the Path:
>
> PATH /bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin

The path in php is where the interpreter will look for system commands
when a full path is not provided. For instance:
<?php $contents = `ls -fl`; ?>

PHP will look in each of the PATH directories for the ls command:
/bin/ls
/usr/bin/ls
/sbin/ls
/usr/sbin/ls
/usr/local/bin/ls
/usr/local/sbin/ls

If none of the above are found, then you will get an error...

> I'm not sure how to use that infomation. Do I use all of it? Some of
> it?

None of it?

..htaccess:
-----------
# Send all .html files through the php interpreter
AddType application/x-httpd-php .html


# mod rewrite to rewrite article/2005-10-03.html
# to article/view.php?date=2005-10-03 without
# changing any links in the site
RewriteEngine On
RewriteRule ^article/([^.]+)\.html$ article/view.php?date=$1 [L]
-----------

If you're trying to do something other than that, please explain it better.

--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация