473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

how to use the PHP path to send something explicitly to the PHP parser?

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
I'm not sure how to use that infomation. Do I use all of it? Some of
it?

Nov 1 '05 #1
3 1684
lk******@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 - ju****@koivi.com
http://koivi.com
Nov 1 '05 #2

Justin Koivisto wrote:
.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]
-----------


Thanks much for the reply. I take that this line:

AddType application/x-httpd-php .html

can be read as something like "add the html type to the php
application"??? What does "x-httpd-php" mean?

Nov 2 '05 #3
lk******@geocities.com wrote:
Justin Koivisto wrote:
.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]
-----------


Thanks much for the reply. I take that this line:

AddType application/x-httpd-php .html

can be read as something like "add the html type to the php
application"??? What does "x-httpd-php" mean?


That line tells apache to treat all the .html files as the
"application/x-httpd-php" - which is where .php files are also sent.
x-httpd-php is the PHP interpreter...

--
Justin Koivisto, ZCE - ju****@koivi.com
http://koivi.com
Nov 2 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

31
by: John Roth | last post by:
I'm adding a thread for comments on Gerrit Holl's pre-pep, which can be found here: http://tinyurl.com/2578q Frankly, I like the idea. It's about time that all of the file and directory stuff...
70
by: Michael Hoffman | last post by:
Many of you are familiar with Jason Orendorff's path module <http://www.jorendorff.com/articles/python/path/>, which is frequently recommended here on c.l.p. I submitted an RFE to add it to the...
4
by: Mark J. McGinty | last post by:
Greets, Part of the content of one of our web pages uses wingdings and Chr(239) through Chr(242) (which are little arrow outlines, though that's not really important.) It worked just fine in...
7
by: Michael Kennedy [UB] | last post by:
Hi, I am back with more bug reports from Visual Studio.NET 2003's C++ compiler (unmanaged). Consider the following method: --------------------------------------------- __forceinline bool...
4
by: Mostafa | last post by:
Hello, I need to use a relative URL path instead of the system path inside the <wmx:> tag in the following code: <wmx:AccessDataSourceControl id="AccessDataSourceControl1" runat="server"...
6
by: Sigmathaar | last post by:
Hi, while making an XML parser for the creation of an entire directory list I got this problem and I'm having trouble solving it. The program (not yet written) goes through an XML Schema Instance...
34
by: Ben Sizer | last post by:
I've installed several different versions of Python across several different versions of MS Windows, and not a single time was the Python directory or the Scripts subdirectory added to the PATH...
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
8
by: moondaddy | last post by:
I'm posting code for a user control ( FunctionConnectorSelector) below which has 3 content controls in it. each content control uses a style from a resource dictionary merged into the app.xaml...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.