473,626 Members | 3,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1694
lk******@geocit ies.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=2 005-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.co m
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=2 005-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******@geocit ies.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=2 005-10-03 without
# changing any links in the site
RewriteEngi ne 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
"applicatio n/x-httpd-php" - which is where .php files are also sent.
x-httpd-php is the PHP interpreter...

--
Justin Koivisto, ZCE - ju****@koivi.co m
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
3898
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 in the os module got objectified properly (or at least with some semblance of OO propriety!) In the issues section:
70
4070
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 Python standard library, and Reinhold Birkenfeld started a discussion on it in python-dev <http://mail.python.org/pipermail/python-dev/2005-June/054438.html>. The upshot of the discussion was that many python-dev'ers wanted path added to the...
4
2455
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 Windows 2000 Server, but now under Server 2003 it seems that characters above 127 get converted somehow, and our code no longer produces the desired effect.
7
1555
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 CReplayBase::ReplayFillBuffer() { CFile* pFile = NULL;
4
2380
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" SelectCommand="SELECT * FROM " ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=D:/nrcweb2/db/contact.mdb"></wmx:AccessDataSourceControl>
6
1974
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 to create some directories (about 5000). While creating the directories the XML file that I'm parsing is alphabetically ordered not hierarchically and I can't allow the program to stock the path names for each brach on the directory tree. The...
34
3948
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 environment variable. Every time, I've had to go through and add this by hand, to have something resembling a usable Python installation. No such problems on Linux, whether it be Mandrake/Mandriva, Fedora Core, or Kubuntu. So why is the Windows...
11
26572
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 and PEAR is in c:\wamp\php\pear I modified php.ini in the c:\wamp\php directory to reflect the actual path, but even stopping and restarting my server shows the c: \php5\pear path. I can't change it no matter what I do I also tried the...
8
11481
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 file. each control has a border with another style, and each border has a unique path inside of it. I need to dynamically add these content controls using c# at runtime and am having trouble referencing the styles and adding the path into the...
0
8262
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8701
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7192
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6122
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5571
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2623
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1507
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.