Re: [PHP] re: ini_set() / Jason Wong / dynamically setting this?

2002-12-03 Thread David T-G
Matt --

...and then Matt Babineau said...
% 
% Hi everyone:

Hi!


...
% 
% I am working on a website, and I have a shared hosting account on a
% win2k machine. When I upload from my local machine to the shared hosting
% machine I have to change a variable on each of my pages that gives me
% the proper path to including the necessary files to execute the page
% properly. If I don't I get an error.

What I've done is put a bit of code in each of my scripts

  # this will let us figure out where we are and then always source the right include 
stuff!
  # it does not work with symlinks (__FILE__ reports the *target*)
  # you must have a full env tree in your devel tree; we now look exclusively in 
$DEVELDIR if set
  if ( ereg("/home/sites/\.php/",__FILE__) )# are we *somewhere* in our 
usual master tree?
{ $DEVELDIR = preg_replace("|/.*/home/sites/\.php(.*)/[^/]*$|","\\1",__FILE__) ; } 
 # get the working dir

and then I work from my base development tree with a

  include("/home/sites/.php$DEVELDIR/includestuff.inc");# include our various 
files
  require("/home/sites/.php$DEVELDIR/ImageInformation.class.php");

and away I go.  I replicate my build directory anywhere under the .php
dir and everything else knows where it is and thus where to find the
other files in the same version.

This may be helpful; good luck!


HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg88211/pgp0.pgp
Description: PGP signature


Re: [PHP] re: ini_set() / Jason Wong / dynamically setting this?

2002-12-02 Thread Jason Wong
On Tuesday 03 December 2002 01:20, Matt Babineau wrote:
> Hi everyone:
>
>
>
> I just read the reply from Jason Wong pretty much just about my
> question. Using the ini_set() command at the top of all my pages I think
> would work out ok, but when I upload my pages to the server, how can I
> dynamically set the include path to match the root of my web folder on
> the shared server?

Look at the output of phpinfo(), in particular the contents of $_SERVER, you 
should find what you need in there.

> I've included a link to the error message below. As an aside, I picked
> up this piece of software that lets me grab HTML or other content from
> web pages and puts it into its own window and gives me a link to it. I
> am finding it way handy for sharing these errors that I get with other
> people. They just click the link to view the error, rather then getting
> a ton of debug code in an email message. I highly recommend trying it
> out, makes my life a lot easier.

I disagree. If possible you should always post your error message/code to the 
list. I, for one, would not bother to go click on a link to see what the 
problem is, it's too much like hard work ;-) 

Plus it might be a bit of social engineering and the link leads to the latest 
Outlook exploit (which is why I don't use said program).

>  BB4>
> http://www.amplifytheweb.com/amplify/?13B53210-FD7A-4DDA-999E-993D243F4B
> B4

And another reason is all these posts are archived. Someone stumbling upon 
these posts in a few years time might not be able to reach the above link, 
thus they wouldn't have the faintest idea of what you are referring to.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
"What do you do when your real life exceeds your wildest fantasies?"
"You keep it to yourself."
-- Broadcast News
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] re: ini_set() / Jason Wong / dynamically setting this?

2002-12-02 Thread Matt Babineau
Hi everyone:

 

I just read the reply from Jason Wong pretty much just about my
question. Using the ini_set() command at the top of all my pages I think
would work out ok, but when I upload my pages to the server, how can I
dynamically set the include path to match the root of my web folder on
the shared server?

 

I am working on a website, and I have a shared hosting account on a
win2k machine. When I upload from my local machine to the shared hosting
machine I have to change a variable on each of my pages that gives me
the proper path to including the necessary files to execute the page
properly. If I don't I get an error.

 

I've included a link to the error message below. As an aside, I picked
up this piece of software that lets me grab HTML or other content from
web pages and puts it into its own window and gives me a link to it. I
am finding it way handy for sharing these errors that I get with other
people. They just click the link to view the error, rather then getting
a ton of debug code in an email message. I highly recommend trying it
out, makes my life a lot easier.

 

 

http://www.amplifytheweb.com/amplify/?13B53210-FD7A-4DDA-999E-993D243F4B
B4

 

So my question is, Is there a way to make a custom PHP.INI sort of thing
that works only for my site, that I can include in my pages so I don't
have to keep changing the dang path every time I want to do an upload?
I'm sure someone must have a solution to this. 

 

Thanks,

Matt