Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2024-05-06 18:34:01

Ace
New Member
Registered: 2024-05-06
Posts: 3

Fatal error: Uncaught Error: Class ‘Trace’ not found

Warning: include(/textpattern/lib/class.trace.php): Failed to open stream: No such file or directory in /index.php on line 50

Warning: include(): Failed opening ‘/textpattern/lib/class.trace.php’ for inclusion (include_path=’.:/usr/share/pear:/usr/share/php’) in /index.php on line 50

Fatal error: Uncaught Error: Class “Trace” not found in /index.php:51 Stack trace: #0 {main} thrown in /var/www/html/blog/index.php on line 51

https://postimg.cc/bDYqXCVT

The file is definitely there. Everything is owned by apache, 755.

I fixed it by changing the textpattern directory name back to the default, even without changing the txtpath in config.php back to the default. So either that configuration isn’t working as it should, or I completely misunderstood it.

Last edited by Ace (2024-05-06 18:34:30)

Offline

#2 2024-05-06 20:27:35

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

Re: Fatal error: Uncaught Error: Class ‘Trace’ not found

Hi Ace and welcome!

Not sure if I understood you fully, but your txpath site path does have to be:

$txpcfg['txpath'] = '/path/to/your/public-folder/textpattern';

with index.php, css.php, .htaccess and the /files/, /images/ and /themes/ folders residing in the public-folder. You can’t change the name of the /textpattern/ admin folder with the regular setup.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2024-05-06 20:30:41

Ace
New Member
Registered: 2024-05-06
Posts: 3

Re: Fatal error: Uncaught Error: Class ‘Trace’ not found

I just like to change the URL of the login page as a security measure. So I changed the name of the folder and changed the txpath in the config.php file to match it. But I suppose that isn’t supported in textpattern.

Offline

#4 2024-05-07 08:01:36

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

Re: Fatal error: Uncaught Error: Class ‘Trace’ not found

Yes, I hear where you’re coming from. It’s currently not possible by renaming the directory, but see this thread and this tip from many years ago.


TXP Builders – finely-crafted code, design and txp

Offline

#5 2024-07-14 08:06:13

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: Fatal error: Uncaught Error: Class ‘Trace’ not found

Hijacking this post I’m having the same errors (screenshot). All files are in place. Paths to Textpattern and database are alright and I didn’t do any fancy stuff except trying to upgrade a plugin (adi_notes > 1.4.1). What to do? Fresh install Textpattern? And yes, I have cleared the browser cache dozens of times … :o

Last edited by RedFox (2024-07-14 08:32:11)

Offline

#6 2024-07-18 13:36:32

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

Re: Fatal error: Uncaught Error: Class ‘Trace’ not found

RedFox wrote #337404:

Hijacking this post I’m having the same errors (screenshot). All files are in place. Paths to Textpattern and database are alright and I didn’t do any fancy stuff except trying to upgrade a plugin (adi_notes > 1.4.1). What to do? Fresh install Textpattern? And yes, I have cleared the browser cache dozens of times … :o

Joop, it looks like you got this working in the meantime, but I suspect it has something to do with your second installation being in the /test/ subfolder while the txpcfg['txpath'] in your config.php and/or your site prefs are missing the /test/ in the path. Possibly a mismatch is/was causing the trace file to be not found.


TXP Builders – finely-crafted code, design and txp

Offline

#7 2024-07-18 13:53:40

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

Re: Fatal error: Uncaught Error: Class ‘Trace’ not found

Ace wrote #337142:

I just like to change the URL of the login page as a security measure. So I changed the name of the folder and changed the txpath in the config.php file to match it. But I suppose that isn’t supported in textpattern.

Coming back to this, it looks like you can change the /textpattern/ to be something else with a minor change to /index.php file in your webroot folder. I tried the following with a fresh installation of the current dev version (4.9) and it appears to work. I’ve not put it through extensive testing, and there’s a chance that some plugins might have hard-coded /textpattern into their file paths rather than using txpath, but you might want to try that out. It may work with txp 4.8.8 too, I’ve not checked.

Anyhow, this is what I did:

  • Fresh install of the dev branch of Textpattern from GitHub as usual
  • Rename /textpattern directory to /admin.
  • Open admin/config.php and change the following:
$txpcfg['txpath'] = '/path/to/your/site/admin';
  • Open index.php in the webroot folder and change the end of this line from /textpattern to /admin.

Now the admin area is available at https://yoursite.com/admin/.

——

@devs

If config.php were to be relocated to another folder not within /textpattern as discussed in this GitHub issue, then index.php could get txpath from config.php first (shifting it up a few lines), and the rest follows from there. The config.php include currently in /textpattern/index.php also needs changing to pick up the new position of config.php. That works too in cursory testing with /config/config.php as the location, which means you have been very good in using txpath throughout in the core 👍


TXP Builders – finely-crafted code, design and txp

Offline

#8 2024-07-18 14:22:25

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

Re: Fatal error: Uncaught Error: Class ‘Trace’ not found

Shuffling files around into a structure like this is highly desirable so, yes, on the list. If it works with only one line change in index.php today then we’re already 60% of the way there! Plugins that have hardcoded paths notwithstanding.


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

#9 2024-07-18 16:07:05

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

Re: Fatal error: Uncaught Error: Class ‘Trace’ not found

jakob wrote #337415:

Joop, it looks like you got this working in the meantime, but I suspect it has something to do with your second installation being in the /test/ subfolder while the txpcfg['txpath'] in your config.php and/or your site prefs are missing the /test/ in the path. Possibly a mismatch is/was causing the trace file to be not found.

I checked the path several times, but I couldn’t find one that was wrong. But it happens that you overlook things like that, doesn’t it?

:o

I did a fresh install … :)

Last edited by RedFox (2024-07-18 16:07:29)

Offline

Board footer

Powered by FluxBB