473,378 Members | 1,384 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,378 software developers and data experts.

Problem with PHP enviromental variables

I have set up PHP with Apache on windows xp.

However I notice that the SCRIPT_NAME & SCRIPT_FILENAME enviromental
variables are incorrectly being set to php.exe

Is there a way around this?

Thanks

Hamilton
Jul 17 '05 #1
3 1606
On Fri, 5 Mar 2004 11:50:22 +1300, "Spidah" <h.*********@eggstra.co.nz> wrote:
I have set up PHP with Apache on windows xp.

However I notice that the SCRIPT_NAME & SCRIPT_FILENAME enviromental
variables are incorrectly being set to php.exe

Is there a way around this?


Run PHP as an Apache module, not as CGI? You should also end up with better
performance that way.

(I've not tested running as CGI to see if this does set those two variables to
the php.exe executable, so it's just a guess, but it sounds reasonable that it
would do this when run as CGI)

Or use $_SERVER['PHP_SELF'] if you want the current script.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>
Jul 17 '05 #2
I have tried setting up php as an Apache Modlue. Followed the instructions
to the letter and it is loading ok.

However when I try to run a .php file IE wants to download it instead of
displaying it in the browser.

What have I done wrong?

Hamilton

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:o6********************************@4ax.com...
On Fri, 5 Mar 2004 11:50:22 +1300, "Spidah" <h.*********@eggstra.co.nz> wrote:
I have set up PHP with Apache on windows xp.

However I notice that the SCRIPT_NAME & SCRIPT_FILENAME enviromental
variables are incorrectly being set to php.exe

Is there a way around this?
Run PHP as an Apache module, not as CGI? You should also end up with

better performance that way.

(I've not tested running as CGI to see if this does set those two variables to the php.exe executable, so it's just a guess, but it sounds reasonable that it would do this when run as CGI)

Or use $_SERVER['PHP_SELF'] if you want the current script.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>

Jul 17 '05 #3
jn
"Spidah" <h.*********@eggstra.co.nz> wrote in message
news:TX******************@news.xtra.co.nz...
I have tried setting up php as an Apache Modlue. Followed the instructions
to the letter and it is loading ok.

However when I try to run a .php file IE wants to download it instead of
displaying it in the browser.

What have I done wrong?

Hamilton

"Andy Hassall" <an**@andyh.co.uk> wrote in message
news:o6********************************@4ax.com...
On Fri, 5 Mar 2004 11:50:22 +1300, "Spidah" <h.*********@eggstra.co.nz>

wrote:
I have set up PHP with Apache on windows xp.

However I notice that the SCRIPT_NAME & SCRIPT_FILENAME enviromental
variables are incorrectly being set to php.exe

Is there a way around this?


Run PHP as an Apache module, not as CGI? You should also end up with

better
performance that way.

(I've not tested running as CGI to see if this does set those two

variables to
the php.exe executable, so it's just a guess, but it sounds reasonable

that it
would do this when run as CGI)

Or use $_SERVER['PHP_SELF'] if you want the current script.

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>



You have to add lines similar to these in your Apache's http.conf:

LoadModule php4_module h:/php-4.2.1-Win32/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Jul 17 '05 #4

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

Similar topics

3
by: Gary | last post by:
I am having a strange problem that I cannot solve. I have an asp page that I use for a user to login and gain access to other pages. When the user logs in I set a couple of session variables like...
8
by: G-Factor | last post by:
Hi all Been learning C++ for about 5 weeks. I find that I create quite a lot of variables. Generally, is it better to create a new variable for every different thing that needs to be stored in...
15
by: Alfonso Morra | last post by:
Hi, I have some code from an example, that I want to retrofit into my project. The code from the example has the following line: SharedAppenderPtr myAppender( new...
6
by: Scott Zabolotzky | last post by:
I'm trying to pass a custom object back and forth between forms. This custom object is pulled into the app using an external reference to an assembly DLL that was given to me by a co-worker. A...
78
by: Josiah Manson | last post by:
I found that I was repeating the same couple of lines over and over in a function and decided to split those lines into a nested function after copying one too many minor changes all over. The only...
9
by: Jerim79 | last post by:
Here it is: <?php if($_SERVER=='POST'){ $Number=$_POST; $Email=$_POST; $Number2=0; $error=0;
6
by: efrenba | last post by:
Hi, I came from delphi world and now I'm doing my first steps in C++. I'm using C++builder because its ide is like delphi although I'm trying to avoid the vcl. I need to insert new features...
14
by: chromis | last post by:
Hi, I've been trying to implement a more OOP oriented approach to dealing with user security on one of my websites, and I am trying to validate the user against an array of roles, however I am...
8
by: chromis | last post by:
Hi, I'm writing a contacts section for a cms on a website, I've decided to write the section in OO code. So far I have my Contacts object and a page structure I would use for a procedural site. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.