Simple Machines Community Forum

Customizing SMF => Bridges and Integrations => Topic started by: zewtastic on July 24, 2015, 02:33:33 PM

Title: Newbie Integrator here - chasing down errors.
Post by: zewtastic on July 24, 2015, 02:33:33 PM
I am trying to use the SSI.php as described but getting an error I am unable to resolve.

my forums are below my main site

site/forums/SSI.php

I have included:
require(dirname(__FILE__) . '/forums/SSI.php');

but it throws an error trying to open one of the files in SSI.php

PHP Fatal error:  ... require_once(): Failed opening required '/QueryString.php' (include_path='.:/usr/share/pear:/local/PEAR/') in ... g/forums/SSI.php on line 62, ...

That is this line in SSI.php

// Load the important includes.
require_once($sourcedir . '/QueryString.php');
require_once($sourcedir . '/Subs.php');
require_once($sourcedir . '/Errors.php');
require_once($sourcedir . '/Load.php');
require_once($sourcedir . '/Security.php');

Any clues on what I am doing wrong?
Title: Re: Newbie Integrator here - chasing down errors.
Post by: Kindred on July 24, 2015, 02:35:56 PM
it would appear that your source directory is not set correctly...

so ---   try putting in the absolute path rather than the dirname(__FILE__)  line
Title: Re: Newbie Integrator here - chasing down errors.
Post by: zewtastic on July 24, 2015, 02:48:20 PM
Sorry I did not mention that, I did check that setting first,

I am running on AWS, here is what I have set in the Settings.php

########## Directories/Files ##########
# Note: These directories do not have to be changed unless you move things.
$boarddir = '/home/ec2-user/websites/xxx/forums';      # The absolute path to the forum's folder. (not just '.'!)
$sourcedir = '/home/ec2-user/websites/xxx/forums/Sources';      # Path to the Sources directory.
$cachedir = '/home/ec2-user/websites/xxx/forums/cache';      # Path to the cache directory.
Title: Re: Newbie Integrator here - chasing down errors.
Post by: Illori on July 24, 2015, 02:51:59 PM
kindred means in the code you posted, not in Settings.php. put in the whole path to SSI.php and then it may start working better for you.
Title: Re: Newbie Integrator here - chasing down errors.
Post by: Kindred on July 24, 2015, 02:53:41 PM
from the error message - your system is looking in a system directory... /usr/share/pear:/local/PEAR/

which means -- for some reason, it can not find the defined source dir...

1- is SSI.php in the root directory of your forum?
2- is the call for SSI form within the same domain?

Quote from: Kindred on July 24, 2015, 02:35:56 PM
try putting in the absolute path rather than the dirname(__FILE__)  line
Title: Re: Newbie Integrator here - chasing down errors.
Post by: zewtastic on July 24, 2015, 03:10:45 PM
This is what I used from my main site page in a higher directory than my forums:

require(dirname(__FILE__) . '/forums/SSI.php');

1- is SSI.php in the root directory of your forum?
Yes - /site/forums/SSI.php

2- is the call for SSI form within the same domain?
Not sure I understand
Title: Re: Newbie Integrator here - chasing down errors.
Post by: zewtastic on July 24, 2015, 03:24:03 PM
Quoteit would appear that your source directory is not set correctly...

so ---   try putting in the absolute path rather than the dirname(__FILE__)  line

I did use the absolute path as well, same error.

It sees and loads the SSI.php file, it's when it tries to process and hits the reference to:

// Load the important includes.
require_once($sourcedir . '/QueryString.php');

where it fails.
Title: Re: Newbie Integrator here - chasing down errors.
Post by: zewtastic on July 24, 2015, 03:29:38 PM
So this works.

I hard coded the absolute path:

// Load the important includes.
//require_once($sourcedir . '/QueryString.php');
require_once('/home/ec2-user/websites/xxx/forums/Sources/QueryString.php');

And it moves to the next require.

So why is my $sourcedir incorrect?
Title: Re: Newbie Integrator here - chasing down errors.
Post by: zewtastic on July 24, 2015, 03:43:18 PM
I added this echo to the SSI.php:

echo dirname(__FILE__) . '/Settings.php';

and it does echo out the correct absolute path.

/home/ec2-user/websites/xxx/forums/Settings.php

But when I echo out:
echo $sourcedir;

I get nothing.

It is not reading the Settings.php file for some reason.

// Get the forum's settings for database and file paths.
require_once(dirname(__FILE__) . '/Settings.php');


is not working, no idea why.
Title: Re: Newbie Integrator here - chasing down errors.
Post by: zewtastic on July 24, 2015, 03:48:01 PM
Ok sorry for all the spam, I think I found the issue, but not a solution - yet.

I am running a plugin WP2SMFBridge-master, that registers users to SMF from my main web site.

I changed:
Quoterequire_once(dirname(__FILE__) . '/Settings.php');

to

Quoterequire(dirname(__FILE__) . '/Settings.php');

And it loaded the Settings file.

But now I get errors from the plugin.
Title: Re: Newbie Integrator here - chasing down errors.
Post by: zewtastic on July 24, 2015, 04:03:20 PM
Ok got it working, it seems.

Had to comment out a couple things in the SSI.php that conflicted with the other plugin, but I do not think I will need them.

Thank you for the prompt responses and help.

:)
Title: Re: Newbie Integrator here - chasing down errors.
Post by: Kindred on July 24, 2015, 09:24:06 PM
well, that's your first problem.... in general WordPress sucks up all of the system and assumes that it is the only thing running.
There are KNOWN conflicts with WordPress and SMF in terms of variables, etc...

in short, it is not recommended to run the two together....
Title: Re: Newbie Integrator here - chasing down errors.
Post by: zewtastic on July 24, 2015, 09:28:46 PM
I have read that before here but I am not having any issues and have been using WP as a backend for my custom sites for a while now.

I generally only use WP for a registration engine. My sites are built on top of WP and I do not use much of WP beyond user/group management.
Title: Re: Newbie Integrator here - chasing down errors.
Post by: Kindred on July 24, 2015, 09:30:15 PM
SMF has ***MUCH*** better security and group management than WP.

If you are only using it for that, then I would recommend dropping WP and using SMF for the whole site.
Title: Re: Newbie Integrator here - chasing down errors.
Post by: zewtastic on July 24, 2015, 09:32:30 PM
I have read that here before also.

I am not going to reverse what I have already built, but on my next project I am going to investigate using the SMF tool set.