Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Setup: server path agnostic txp config
In order to avoid dependencies on absolute server paths which are changed by certain ISPs during server upgrades/repairs quite indeliberately (seen that twice during the last 6 months or so), I’d suggest that Txp builds config.php during setup using $_SERVER[‘DOCUMENT_ROOT’] as a base for $txpcfg[‘txpath’] whenever available.
Resulting entries in config.php would then rather be
$txpcfg['txpath'] = $_SERVER['DOCUMENT_ROOT'].'/textpattern';
than
$txpcfg['txpath'] = '/var/www/vhosts/example.com/subdomains/anotherone/httpdocs/textpattern';
-
Offline
#2 2007-01-02 20:41:08
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Setup: server path agnostic txp config
$_SERVER['DOCUMENT_ROOT']
does not always exist.
Offline
Re: Setup: server path agnostic txp config
But this would be determinable on setup, wouldn’t it?
Offline
#4 2007-01-02 21:16:07
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Setup: server path agnostic txp config
True, yes, it should be.
I’m not sure that it would really solve more troubleshooting problems than it might cause. If these hosts are inadvertantly changing something so important, how do we know $_SERVER['DOCUMENT_ROOT']
should still be trusted (it gets the info from httpd.conf)?
Offline
Re: Setup: server path agnostic txp config
That’s true, I wasn’t aware that there are server setups that lack this variable.
I just got around it as a) one host changed DOCUMENT_ROOT as a follow-up to a hardware failure/rebuild (it was a small company so they probably had no established procedure for this), and b) as a result of changing hosting companies for a site. In both instances it would have eliminated one reason of displeasure.
Offline
Re: Setup: server path agnostic txp config
A more reliable variable is to use automagic constant __FILE__
. IIRC this is already done in crockery.
Last edited by Sencer (2007-01-03 10:16:52)
Offline
Re: Setup: server path agnostic txp config
Is there still a need for a user-defined $txpcfg['txpath']
in config.php, since setup determines it?
Offline
Re: Setup: server path agnostic txp config
No, see SVN changeset 2772
Offline