1
cm2339
XOOPS_ROOT_PATH: Absolute v/s Dynamic
  • 2006/5/22 19:34

  • cm2339

  • Just popping in

  • Posts: 32

  • Since: 2005/2/21


A learning Xoopster here...

We were investigating a blank screen problem. Sometimes the site would show fine, other times it would be "blank." Our host's servers "failed over" and the location of our XOOPS root was inherently different on the two (or more) servers they use. As a result of the different machines handling our XOOPS site, the load balanced environment caused blank screens for our site.

My question:

In mainfile.php an absolute path is set for XOOPS_ROOT_PATH. Would it be possible to use the PHP function getcwd() (http://us3.php.net/getcwd ) instead?

Alternatives to the getcwd() could combine $_SERVER['SCRIPT_NAME'] with $_SERVER['SCRIPT_FILENAME'] or a combination of both.

Just curious, and may give it a try to see what happens. has anyone tried it with success?

Thanks for any help!
C

2
leostotch
Re: XOOPS_ROOT_PATH: Absolute v/s Dynamic
  • 2006/5/22 19:49

  • leostotch

  • Just popping in

  • Posts: 76

  • Since: 2006/4/1 1


This works most of the times:

define('XOOPS_ROOT_PATH'str_replace("\""/",dirname __FILE__)) );

3
cm2339
Re: XOOPS_ROOT_PATH: Absolute v/s Dynamic
  • 2006/5/22 20:03

  • cm2339

  • Just popping in

  • Posts: 32

  • Since: 2005/2/21


Will you give an example on when it does NOT work? Do you simple receive a blank screen or do you have other problems?

Thanks!
C

4
leostotch
Re: XOOPS_ROOT_PATH: Absolute v/s Dynamic
  • 2006/5/22 20:11

  • leostotch

  • Just popping in

  • Posts: 76

  • Since: 2006/4/1 1


Quote:
Will you give an example on when it does NOT work?


Honnestly, I never had any problem with it, I just wanted to stay prudent

5
cm2339
Re: XOOPS_ROOT_PATH: Absolute v/s Dynamic
  • 2006/5/22 21:17

  • cm2339

  • Just popping in

  • Posts: 32

  • Since: 2005/2/21


Ha ha ha ha... I understand!

It's quitting time here today. Tomorrow, I'll test the snippet of code you gave on some of our test instances of XOOPS and report back.

Thanks again for your help and suggestions.

C

6
cm2339
Re: XOOPS_ROOT_PATH: Absolute v/s Dynamic
  • 2006/5/24 16:19

  • cm2339

  • Just popping in

  • Posts: 32

  • Since: 2005/2/21


A little later than expected...

We tried several versions of a script to get the Dymanic path and will stick to what you provided.

Thanks, this will save us some headaches as we build sites for people using shared hosting.

THANKS!
C

7
skenow
Re: XOOPS_ROOT_PATH: Absolute v/s Dynamic
  • 2006/8/4 3:15

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


Awesome! This solved my Xoops on a Stick problem!

Login

Who's Online

429 user(s) are online (330 user(s) are browsing Support Forums)


Members: 0


Guests: 429


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits