News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Newbie Integrator here - chasing down errors.

Started by zewtastic, July 24, 2015, 02:33:33 PM

Previous topic - Next topic

zewtastic

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?

Kindred

it would appear that your source directory is not set correctly...

so ---   try putting in the absolute path rather than the dirname(__FILE__)  line
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

zewtastic

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.

Illori

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.

Kindred

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
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

zewtastic

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

zewtastic

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.

zewtastic

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?

zewtastic

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.

zewtastic

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.

zewtastic

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.

:)

Kindred

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....
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

zewtastic

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.

Kindred

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.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

zewtastic

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.

Advertisement: