473,387 Members | 3,684 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,387 software developers and data experts.

probably stupid problem

hi,

i installed php on my XP Prof. PC (including IIS, Mysql)

a basic command like $PHPLIB_DIR = $_SERVER['DOCUMENT_ROOT'] .
'/phplib';

is not working in php

what's wrong ?
Jul 17 '05 #1
3 1466
Snah wrote:
i installed php on my XP Prof. PC (including IIS, Mysql)

a basic command like $PHPLIB_DIR = $_SERVER['DOCUMENT_ROOT'] .
'/phplib';

is not working in php

what's wrong ?


*HOW* is it not working?
What does the basic command do? and what did you expect it to do?

Is there an error message? A warning? A notice?
[ enable notices by issuing ]

<?php ini_set('error_reporting', E_ALL); ?>

[ at the top of your scripts or, perhaps ]
[ better, by reconfiguring php.ini ]

I remember a long time ago when I had PHP working under IIS. Some
$_SERVER indexes available for Apache are not available for IIS (and
vice-versa); I don't remember which.
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2

"Pedro Graca" <he****@hotpop.com> wrote in message
news:c1*************@ID-203069.news.uni-berlin.de...
Snah wrote:
i installed php on my XP Prof. PC (including IIS, Mysql)

a basic command like $PHPLIB_DIR = $_SERVER['DOCUMENT_ROOT'] .. '/phplib';

is not working in php

what's wrong ?


*HOW* is it not working?
What does the basic command do? and what did you expect it to do?

Is there an error message? A warning? A notice?
[ enable notices by issuing ]

<?php ini_set('error_reporting', E_ALL); ?>

[ at the top of your scripts or, perhaps ]
[ better, by reconfiguring php.ini ]

I remember a long time ago when I had PHP working under IIS. Some
$_SERVER indexes available for Apache are not available for IIS (and
vice-versa); I don't remember which.
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--


Your right that's the problem, in the meantime i discovered the phpinfo()
function call. This allows me easily to compare the different platforms.
Thanks for your tip
Jul 17 '05 #3
Snah wrote:
Your right that's the problem, in the meantime i discovered the phpinfo()
function call. This allows me easily to compare the different platforms.
Thanks for your tip


You can print all the variables in $_SERVER with

<?php
echo '<pre>';
print_r($_SERVER);
echo '</pre>';
?>

for both servers, and print/compare the output.
It's easier than the output of phpinfo() :)
I also remember I ended up doing something like:

<?php // config.inc.php
if (stristr(php_sapi_name(), 'apache') {
$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
$OTHER_VARS = $_SERVER['OTHER_VARS'];
} else { // IIS
$DOCUMENT_ROOT = $_SERVER['ROOT_DIRECTORY']; // probably wrong
$OTHER_VARS = $_SERVER['EXTRA_VARS'];
}
?>

and then require that file (which had more things in it) and using

$DOCUMENT_ROOT (instead of $_SERVER['DOCUMENT_ROOT'])

for scripts running on apache or IIS.
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #4

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

Similar topics

119
by: rhat | last post by:
I heard that beta 2 now makes ASP.NET xhtml compliant. Can anyone shed some light on what this will change and it will break stuff as converting HTML to XHTML pages DO break things. see,...
9
by: noone | last post by:
I have a database file that I use an autonumber field as the primary key index. Because of some rearrangements in the past, this index does not match the order that I would like it to be in, that...
4
by: Andy Proctor | last post by:
I hope there is an answer out there.... I have a simple database structured like this (non relevant tables and fields omitted) Members table memberID memberFname memberLname memberNokID
2
by: Lampa Dario | last post by:
Hi, where is this stupid error in this program? When I execute it, i receive a segmentation fault error. #include <stdio.h> int main(int argc, char *argv, char *env) { int i=0; int l=0; int...
3
by: Catweasel | last post by:
I'm new to C++ and have been chucked in at the deep-end. I have a C++ console app that works fine. All I want to do is write to file however as soon as I include the fstream library and try to...
5
by: Guoqi Zheng | last post by:
I think I have this kind of problem very often, now it is really making me crazy. VS.NET always want to change my html code. Ok, that is fine as long as Vs.Net can ask my confirmaton first. For...
3
by: Rob Mayo | last post by:
This is a stupid problem to have, but here goes. I wanted to make like an Outlook-looking app. Multiple splitters, panes, etc. If I ... 1. Take a Form, add a TreeView, dock it Left. 2. Add a...
1
by: Stef Mientki | last post by:
Does anyone know the equivalent of the MatLab "diff" function. The "diff" functions calculates the difference between 2 succeeding elements of an array. I need to detect (fast) the falling edge of...
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:
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...

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.