WebsiteBaker Community Forum

WebsiteBaker Support (2.10.x) => Modules => Topic started by: rumen on September 25, 2018, 10:50:31 AM

Title: Modul Jobs error
Post by: rumen on September 25, 2018, 10:50:31 AM
Hello, I have error in module jobs. I'm running WB 2.12 error message:

Code: [Select]
Warning: require(/opt/lampp/htdocs/config.php): failed to open stream: Няма такъв файл или директория in /opt/lampp/htdocs/212/modules/jobs/update.php on line 16

Fatal error: require(): Failed opening required '/opt/lampp/htdocs/config.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/212/modules/jobs/update.php on line 16

Line 16:
Code: [Select]
require($_SERVER['DOCUMENT_ROOT'].'/config.php');
What can be wrong?

Regards,

Rumen
Title: Re: Modul Jobs error
Post by: Ruud on September 25, 2018, 11:00:14 AM
Line 16 expects your WB to be installed in the root of the webspace.

Just replace line 16 with:
Code: [Select]
require('../../config.php');
Title: Re: Modul Jobs error
Post by: Gast on September 25, 2018, 11:00:36 AM
maybe your DOCUMENT_ROOT  ;-)

for example: if you work in a subfolder from your domain, it's possible, that your DOCUMENT_ROOT is not the WB-Root-Folder

to your special case:
compare the error messages

path to the file / path to WB is

/opt/lampp/htdocs/212/modules/jobs/update.php or /opt/lampp/htdocs/212/

your document-root is
/opt/lampp/htdocs/config.php

i'm missing the 212-folder
change it in your upgrade.php to

require('../../config.php');

Ruud was faster  (Y)
Title: Re: Modul Jobs error
Post by: rumen on September 25, 2018, 05:38:54 PM
I got same error

Code: [Select]
Warning: require(/opt/lampp/htdocs../../config.php): failed to open stream: No such file or directory in /opt/lampp/htdocs/212/modules/jobs/update.php on line 17

Fatal error: require(): Failed opening required '/opt/lampp/htdocs../../config.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/212/modules/jobs/update.php on line 17

It is set

Code: [Select]
require($_SERVER['DOCUMENT_ROOT'].'../../config.php');
It is row 17 because I keep copy of the original (as always) on row 16

Code: [Select]
// require($_SERVER['DOCUMENT_ROOT'].'/config.php');   ORIGINAL
If it is necessary I can move it to the host and try there.
Title: Re: Modul Jobs error
Post by: Gast on September 25, 2018, 06:45:25 PM
see answer from Ruud

replace line 16 with

Code: [Select]
require('../../config.php');
dont use $_SERVER['DOCUMENT_ROOT'] in a sub-folder for the locale test's or you have to correct the path everytime

this works on your locale server:
Code: [Select]
require($_SERVER['DOCUMENT_ROOT'].'/212/config.php'); but not longer, if you move from your locale server to another one
Title: Re: Modul Jobs error
Post by: rumen on September 25, 2018, 08:38:01 PM
Thanks, it works now!   

I got the logic.