Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-11-09 19:30:53

Derekstaff
Member
Registered: 2014-10-23
Posts: 28

config.php file and the "txpath" and "doc_root" values

I’m new to developing with Textpattern (or any CMS, all just html and css prior), and would appreciate any pointers I could get. I’ve moved my Textpattern installation to my server (Comcast) according to the instructions in the “Moving Installation from one Host to Another” page in the Textpattern docs. I created a database on the server, imported my local database, uploaded the installation via ftp to the server, and am now trying to adjust the config.php as instructed. However, The instructions note that:

“The following two values may require you to contact Support to find them out:

$txpcfg[‘txpath’] = ‘/home/.some_name/site_username/yourname.com/textpattern’;

$txpcfg[‘doc_root’] = ‘/home/.some_name/site_username/yourname.com/’; “

However, Comcast web support did not know what “txpath” or “doc_root” were. They surmised that “doc_root” would be the directory in which the index.php file would be located, but had no idea about “txpath.” Can anyone help me out? Are they correct about “doc_root”? How would I go about determining what “txpath” is?

Thanks for any advice.
- Derek

Offline

#2 2014-11-09 20:23:04

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: config.php file and the "txpath" and "doc_root" values

Derekstaff wrote #285616:

“doc_root” would be the directory in which the index.php file would be located

Yes, that is a correct assumption. On shared hosts it may be /var/www/[account_name]/ or, more typically, /home/[account_name]. On cpanel, for example, your home directory is usually displayed in the left-hand sidebar when you log into the host’s control panel. Sometimes if you check your FTP software in which you uploaded Textpattern to your server, you may be able to find the full path there.

On my hosting account, they have assigned me an account name which is under /home. Beneath my account name are a bunch of folders, one of which is httpdocs (and there’s also a www which is a symlink to httpdocs). In there is where Apache expects to find my websites. I’ve organised my domains so that each one is a sub-directory under this Apache folder, so for any particular site (e.g. stefdawson.com), the full path that config.php expects for doc_root is:

/home/[my-account]/httpdocs/stefdawson.com/

Where of course [my-account] is the account name I’m not going to divulge here! That’s where I upload the Textpattern core files for that domain. Then, my txpath value becomes:

/home/[my-account]/httpdocs/stefdawson.com/textpattern

i.e. the same path, with just textpattern added to it.

Hope that helps.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2014-11-09 21:58:15

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,596
Website

Re: config.php file and the "txpath" and "doc_root" values

I normally make a text file with the following content:

 <?php phpinfo(); ?>

and then rename it to whatever.php and upload it to the ftp server where you’re installing textpattern (the one with the index.php in it and the textpattern directory).

Then call up www.youdomain.com/whatever.php (or wherever you have it, if it’s in a subdirectory) in your browser and search on that long page with lots of server details page for the text “document_root”. You’ll probably find a location that looks a little similar to what Stef/Bloke described. That’s your doc_root. Stick textpattern on the end like Stef described and you have txpath.

IMPORTANT: Afterwards, delete your whatever.php from the ftp server to prevent divulging this information publicly.


TXP Builders – finely-crafted code, design and txp

Offline

#4 2014-11-10 00:13:29

Derekstaff
Member
Registered: 2014-10-23
Posts: 28

Re: config.php file and the "txpath" and "doc_root" values

Thanks for the suggestions. Unfortunately, things still aren’t working. I created the whatever.php script you suggested, Jakob, and uploaded it. It successfully created the phpinfo page. The “document_root” path it listed was primarily numbers instead of directory names (similar to “/home/55/55/5555555/web”). Would this be an accurate doc_root value? I entered it into the config file, the same with “/textpattern” for the txpath value, but I’m still getting a “database unavailable” when I try to enter the web address on my web browser.

Also, I have the textpattern installation (and the whatever.php file) in a subdirectory “/test/” which I created to use for development before the site was ready to go public. Why wouldn’t that directory be listed in the doc_root value listed on the phpinfo page?

Thanks again for guidance.

Offline

#5 2014-11-10 12:38:31

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,304

Re: config.php file and the "txpath" and "doc_root" values

The reason for “database unavailable” is usually one of the first four entries in config.php. You’ve to adapt these to the ones of your online account. Please check the entries for
  • db (name of the database as displayed in your database administration. In phpMyAdmin it’s on top of the page: localhost >> DB name)
  • user (the name you use to login to your database administration, not to confuse with your own client-name you might have)
  • pass (the password for the database, not to confuse with FTP- or client-passwords)
  • host (usually “localhost”)

In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#6 2014-11-10 13:26:07

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: config.php file and the "txpath" and "doc_root" values

Derekstaff wrote #285627:

The “document_root” path it listed was primarily numbers instead of directory names (similar to “/home/55/55/5555555/web”). Would this be an accurate doc_root value?

If phpinfo says so, then that’s what Comcast has set as your account home, so yes it’s most likely correct for the server’s docroot. The fact it hasn’t displayed the test subdirectory is probably a symptom of the way phpinfo extracts information from Apache or the environment (it may only check as far as the server’s docroot, not necessarily the specific directory in which whatever.php resides. I’ve not checked how it works, so this is a slightly educated guess).

Since you know that you’ve put everything in the test sub-directory, add that to config.php’s doc_root value so it reads:

/home/55/55/5555555/web/test/

and then set your txpath value to the same directory, with textpattern appended to it.

EDIT: if you’re upgrading to the most recent version of Textpattern, the doc_root value is no longer used — in fact it hasn’t been used for a long time — so you can remove it from config.php as it’s set internally by Textpattern. txpath is the only path value you need nowadays.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#7 2014-11-11 03:02:54

Derekstaff
Member
Registered: 2014-10-23
Posts: 28

Re: config.php file and the "txpath" and "doc_root" values

Well, I looked at the most recent comments, and while I appreciate them, I’m still having problems.

Here is what I have in my config file:

<?php
$txpcfg['db'] = '**The name of the database as listed on the phpMyAdmin page**';
$txpcfg['user'] = '**the username with which I log into phpMyAdmin**';
$txpcfg['pass'] = '**the password with which I log into phpMyAdmin**';
$txpcfg['host'] = 'localhost'; (as suggested by Uli)
$txpcfg['table_prefix'] = '';
$txpcfg['txpath'] = '/home/55/55/5555555/web/test/textpattern';
$txpcfg['dbcharset'] = 'utf8';
?>

Because I appear to be using the most recent version of Textpattern (4.5.7), I left out doc_root.

What am I not understanding here?

Offline

#8 2014-11-11 03:18:16

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: config.php file and the "txpath" and "doc_root" values

In phpMyAdmin, do you see Current Server (top left)? If it’s shown then use that value rather than “localhost”.

The DB server is also in the middle of the title of the web page, here’re two examples:

winton.myownserver.net / localhost | phpMyAdmin 4.2.9

202.59.108.32:9113 / 10.16.42.12 | phpMyAdmin 4.0.9

The latter requires “10.16.42.12” in config.php

Offline

#9 2014-11-11 03:40:03

Derekstaff
Member
Registered: 2014-10-23
Posts: 28

Re: config.php file and the "txpath" and "doc_root" values

Yes! That did it, Gomedia. Thanks so much for the help, everyone!

Offline

Board footer

Powered by FluxBB