Web based family history software

Question [SOLVED] 2.0.0-beta.3 - Server Warning

More
4 years 8 months ago #1 by JPS
2.0.0-beta.3 - Server Warning was created by JPS
In webtrees 2, installed in a shared webspace environment (PHP-version 7.3.6), i get the following warning...

The server’s temporary folder cannot be accessed.
sys_get_temp_dir() = "/tmp"
ini_get("open_basedir") = "/var/www/vhosts/PATH/WEBTREESFOLDER/:/tmp/:/var/lib/php5/sessions:/var/www/vhosts/PATH/tmp"

However, it seems, that anything is doing well.

Is there anything what I can do in webtrees to avoid this warning? I have no direct access to the php.ini.

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #2 by fisharebest
Replied by fisharebest on topic 2.0.0-beta.3 - Server Warning
there is an example custom module included with webtrees which shows how to fix this.

i am on holiday without my laptop so cannot help further until next week

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #3 by JPS
Replied by JPS on topic 2.0.0-beta.3 - Server Warning
Thanks, that's a good approach. I'll give it a try and if I'm stuck, I'll get back to you.
Have a nice holiday!

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #4 by JPS
Replied by JPS on topic 2.0.0-beta.3 - Server Warning

JPS wrote: Thanks, that's a good approach. I'll give it a try and if I'm stuck, I'll get back to you.
Have a nice holiday!


Quick win!

This entry is working well...

Code:
/** * Modify the PHP environment variables. */ private function phpEnvironment(): void { // Some servers block access to the system temporary folder using open_basedir... // // Create a temporary folder somewhere we have read/write access, and tell PHP to use it. //putenv('TMPDIR=' . $tmp); $tmp = __DIR__ . '/var/www/vhosts/PATH/NEW WEBTREES TEMP FOLDER'; //if (!is_dir($tmp)) { // mkdir($tmp); //} putenv('TMPDIR=' . $tmp); }

Thanks for support and again, enjoy your vacation.

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #5 by JPS
Replied by JPS on topic [SOLVED] 2.0.0-beta.3 - Server Warning
Problem solved.

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #6 by jprause
Replied by jprause on topic [SOLVED] 2.0.0-beta.3 - Server Warning
I have the same issue like JPS:

The server’s temporary folder cannot be accessed.
sys_get_temp_dir() = "/tmp"
ini_get("open_basedir") = "/hosting/www/jprodina.cz/:/hosting/public/:/tmp/:/hosting/session/jprodina.cz/"

May I ask for more detailed way of solution, please?

Josef

webhosting:-- webtrees 2.1.18, PHP version 8.1.16, MySQL 8.0.22, test site webtrees 2.1.18
local desktop:-- webtrees 2.1.18, PHP version 8.2.12, MySQL 8.0.28, Apache2 2.4.41, Linux Ubuntu 22.04 64bit

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago - 4 years 8 months ago #7 by JPS
Replied by JPS on topic [SOLVED] 2.0.0-beta.3 - Server Warning

jprause wrote: I have the same issue like JPS:

The server’s temporary folder cannot be accessed.
sys_get_temp_dir() = "/tmp"
ini_get("open_basedir") = "/hosting/www/jprodina.cz/:/hosting/public/:/tmp/:/hosting/session/jprodina.cz/"

May I ask for more detailed way of solution, please?


Hello Josef,

the problem is probably, that your temp-folder is write protected by your hoster.

My solution was to use the demo module "example-server-configuration.disable". I first renamed it to "server-configuration" and activated it. Then I added an individualual "webtreestemp" folder in the root directory which is writable and changed the module.php as shown above. Your entry has to be your individual direct path to the "webtreestemp" folder.

However, I recognized the following problems:

1. When I add this...

Code:
if (!is_dir($tmp)) { mkdir($tmp); }

...I get this errorcode:

Code:
mkdir(): No such file or directory …/modules_v4/server-configuration/module.php:112 #0 [internal function]: Fisharebest\webtrees\webtrees::Fisharebest\webtrees\{closure}(2, 'mkdir(): No suc...', '/var/www/vhosts...', 112, Array) #1 …/modules_v4/server-configuration/module.php(112): mkdir('/var/www/vhosts...') #2 …/modules_v4/server-configuration/module.php(74): class@anonymous->phpEnvironment() #3 [internal function]: class@anonymous->boot(Object(Fisharebest\webtrees\Services\ServerCheckService)) #4 …/app/Application.php(45): ReflectionMethod->invoke(Object(class@anonymous), Object(Fisharebest\webtrees\Services\ServerCheckService)) #5 …/app/Http/Middleware/BootModules.php(55): Fisharebest\webtrees\Application->dispatch(Object(class@anonymous), 'boot') #6 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\BootModules->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #7 …/app/Http/Middleware/UseTransaction.php(44): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #8 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseTransaction->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #9 …/app/Http/Middleware/CheckCsrf.php(63): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #10 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\CheckCsrf->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #11 …/app/Http/Middleware/DoHousekeeping.php(76): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #12 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\DoHousekeeping->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #13 …/app/Http/Middleware/UseTheme.php(70): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #14 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseTheme->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #15 …/app/Http/Middleware/CheckForMaintenanceMode.php(49): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #16 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\CheckForMaintenanceMode->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #17 …/app/Http/Middleware/UseLocale.php(51): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #18 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseLocale->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #19 …/app/Http/Middleware/UseTree.php(59): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #20 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseTree->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #21 …/app/Http/Middleware/UseSession.php(58): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #22 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseSession->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #23 …/app/Http/Middleware/UseFilesystem.php(49): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #24 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseFilesystem->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #25 …/app/Http/Middleware/UseCache.php(44): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #26 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseCache->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #27 …/app/Http/Middleware/UpdateDatabaseSchema.php(56): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #28 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UpdateDatabaseSchema->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #29 …/app/Http/Middleware/UseDebugbar.php(64): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #30 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseDebugbar->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #31 …/app/Http/Middleware/UseDatabase.php(85): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #32 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseDatabase->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #33 …/app/Http/Middleware/ReadConfigIni.php(62): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #34 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\ReadConfigIni->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #35 …/app/Http/Middleware/HandleExceptions.php(54): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #36 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\HandleExceptions->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #37 …/app/Http/Middleware/EmitResponse.php(52): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #38 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\EmitResponse->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #39 …/app/Http/Middleware/PhpEnvironment.php(46): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #40 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\PhpEnvironment->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #41 …/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #42 …/index.php(40): Middleland\Dispatcher->dispatch(Object(Nyholm\Psr7\ServerRequest)) #43 {main}

With this...

Code:
if (!is_dir($tmp)) { //mkdir($tmp); }

...the above error and the message "The server’s temporary folder cannot be accessed." are disappeared.

However, when I use the "Place hierarchy" and select a location with 635 individuals I get this error...

Code:
fwrite(): Unable to create temporary file, Check permissions in temporary files directory. …/vendor/nyholm/psr7/src/Stream.php:71 #0 [internal function]: Fisharebest\webtrees\webtrees::Fisharebest\webtrees\{closure}(2, 'fwrite(): Unabl...', '/var/www/vhosts...', 71, Array) #1 …/vendor/nyholm/psr7/src/Stream.php(71): fwrite(Resource id #2538, '\n<!DOCTYPE html...') #2 …/vendor/nyholm/psr7/src/Factory/Psr17Factory.php(28): Nyholm\Psr7\Stream::create('\n<!DOCTYPE html...') #3 …/app/Helpers/functions.php(133): Nyholm\Psr7\Factory\Psr17Factory->createStream('\n<!DOCTYPE html...') #4 …/app/Http/ViewResponseTrait.php(54): response('\n<!DOCTYPE html...', 200) #5 …/app/Http/Controllers/PlaceHierarchyController.php(128): Fisharebest\webtrees\Http\Controllers\AbstractBaseController->viewResponse('places-page', Array) #6 …/app/Module/PlaceHierarchyListModule.php(81): Fisharebest\webtrees\Http\Controllers\PlaceHierarchyController->show(Object(Nyholm\Psr7\ServerRequest), Object(Fisharebest\webtrees\Tree), Object(Fisharebest\webtrees\Services\SearchService)) #7 [internal function]: Fisharebest\webtrees\Module\PlaceHierarchyListModule->getListAction(Object(Nyholm\Psr7\ServerRequest), Object(Fisharebest\webtrees\Tree), Object(Fisharebest\webtrees\User)) #8 …/app/Application.php(45): ReflectionMethod->invoke(Object(Fisharebest\webtrees\Module\PlaceHierarchyListModule), Object(Nyholm\Psr7\ServerRequest), Object(Fisharebest\webtrees\Tree), Object(Fisharebest\webtrees\User)) #9 …/app/Http/RequestHandlers/ModuleAction.php(90): Fisharebest\webtrees\Application->dispatch(Object(Fisharebest\webtrees\Module\PlaceHierarchyListModule), 'getListAction') #10 …/app/Http/Middleware/RequestRouter.php(77): Fisharebest\webtrees\Http\RequestHandlers\ModuleAction->handle(Object(Nyholm\Psr7\ServerRequest)) #11 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\RequestRouter->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #12 …/app/Http/Middleware/ModuleMiddleware.php(75): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #13 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\ModuleMiddleware->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #14 …/app/Http/Middleware/BootModules.php(58): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #15 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\BootModules->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #16 …/app/Http/Middleware/UseTransaction.php(44): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #17 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseTransaction->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #18 …/app/Http/Middleware/CheckCsrf.php(63): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #19 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\CheckCsrf->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #20 …/app/Http/Middleware/DoHousekeeping.php(76): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #21 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\DoHousekeeping->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #22 …/app/Http/Middleware/UseTheme.php(70): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #23 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseTheme->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #24 …/app/Http/Middleware/CheckForMaintenanceMode.php(49): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #25 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\CheckForMaintenanceMode->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #26 …/app/Http/Middleware/UseLocale.php(51): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #27 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseLocale->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #28 …/app/Http/Middleware/UseTree.php(59): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #29 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseTree->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #30 …/app/Http/Middleware/UseSession.php(58): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #31 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseSession->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #32 …/app/Http/Middleware/UseFilesystem.php(49): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #33 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseFilesystem->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #34 …/app/Http/Middleware/UseCache.php(44): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #35 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseCache->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #36 …/app/Http/Middleware/UpdateDatabaseSchema.php(56): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #37 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UpdateDatabaseSchema->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #38 …/app/Http/Middleware/UseDebugbar.php(64): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #39 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseDebugbar->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #40 …/app/Http/Middleware/UseDatabase.php(85): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #41 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\UseDatabase->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #42 …/app/Http/Middleware/ReadConfigIni.php(62): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #43 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\ReadConfigIni->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #44 …/app/Http/Middleware/HandleExceptions.php(54): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #45 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\HandleExceptions->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #46 …/app/Http/Middleware/EmitResponse.php(52): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #47 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\EmitResponse->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #48 …/app/Http/Middleware/PhpEnvironment.php(46): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #49 …/vendor/oscarotero/middleland/src/Dispatcher.php(136): Fisharebest\webtrees\Http\Middleware\PhpEnvironment->process(Object(Nyholm\Psr7\ServerRequest), Object(Middleland\Dispatcher)) #50 …/vendor/oscarotero/middleland/src/Dispatcher.php(118): Middleland\Dispatcher->handle(Object(Nyholm\Psr7\ServerRequest)) #51 …/index.php(40): Middleland\Dispatcher->dispatch(Object(Nyholm\Psr7\ServerRequest)) #52 {main}

When I deactivate the "Server configuration" module, I get the message "The server’s temporary folder cannot be accessed." again but everything is working fine.

So I am not sure if I could really solve this problem. My present solution is to let the module deactivated.

Jens
Last edit: 4 years 8 months ago by JPS.

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #8 by fisharebest
Replied by fisharebest on topic [SOLVED] 2.0.0-beta.3 - Server Warning
> 1. When I add this...

Perhaps you specified a path with lots of subfolders?
The command mkdir('a/b/c') will only work if the folder 'a/b' already exists.

Perhaps you chose a folder where you do not have write permission?
The command mkdir('a/b/c') will only work if the folder 'a/b' has write permission.

> However, when I use the "Place hierarchy" and select a location with 635 individuals I get this error...

webtrees is asking PHP for some temporary storage.
When a small amount of storage is needed, PHP uses memory.
When a large amount of storage is needed, PHP uses a file - in the "sys_temp_dir" folder.

If you can set a temporary folder, then this error should disappear.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #9 by JPS
Replied by JPS on topic [SOLVED] 2.0.0-beta.3 - Server Warning

fisharebest wrote: > 1. When I add this...

Perhaps you specified a path with lots of subfolders?
The command mkdir('a/b/c') will only work if the folder 'a/b' already exists.

Perhaps you chose a folder where you do not have write permission?
The command mkdir('a/b/c') will only work if the folder 'a/b' has write permission.


Mmmh, I don't think so, this is my present tmp folder (in root)...



The permissions are set to 0777.
Attachments:

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #10 by JPS
Replied by JPS on topic [SOLVED] 2.0.0-beta.3 - Server Warning

fisharebest wrote: >

> However, when I use the "Place hierarchy" and select a location with 635 individuals I get this error...

webtrees is asking PHP for some temporary storage.
When a small amount of storage is needed, PHP uses memory.
When a large amount of storage is needed, PHP uses a file - in the "sys_temp_dir" folder.

If you can set a temporary folder, then this error should disappear.


So I think I have no problems without the tmp folder because my hosting is quite powerfull:

Guaranteed usable RAM: 8192 MB
PHP Memory Limit: 1024 MB
PHP Upload Filesize: 256 MB
PHP Execution Time: 180 s

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #11 by fisharebest
Replied by fisharebest on topic [SOLVED] 2.0.0-beta.3 - Server Warning
> Mmmh, I don't think so, this is my present tmp folder (in root)...

Instead of the root folder, try a subfolder inside the webtrees data folder?

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #12 by fisharebest
Replied by fisharebest on topic [SOLVED] 2.0.0-beta.3 - Server Warning
> So I think I have no problems without the tmp folder because my hosting is quite powerfull:

This size/power of the server makes no difference.
The problem is the configuration.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #13 by JPS
Replied by JPS on topic [SOLVED] 2.0.0-beta.3 - Server Warning

fisharebest wrote: > Mmmh, I don't think so, this is my present tmp folder (in root)...

Instead of the root folder, try a subfolder inside the webtrees data folder?


exactly the same behavior

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #14 by fisharebest
Replied by fisharebest on topic [SOLVED] 2.0.0-beta.3 - Server Warning
The TMPDIR variable is only used when there is no value specified in the php.ini.

But your server did specify a folder (/tmp) in the php.ini.

Are you allowed to use .htaccess files to modify your server configuration?
If so, then you can use this to set the sys_temp_dir.
If not, then I can't think of a solution to fix this.

Perhaps you need to raise a support ticket with your webhost.
Say that the settings for sys_temp_dir and open_basedir are incompatible.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #15 by JPS
Replied by JPS on topic [SOLVED] 2.0.0-beta.3 - Server Warning

fisharebest wrote: Perhaps you need to raise a support ticket with your webhost.


Thanks so far, I will check this with my hoster and come back.

Good night
Jens

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago - 4 years 8 months ago #16 by jprause
Replied by jprause on topic [SOLVED] 2.0.0-beta.3 - Server Warning
Here is my solution which seems to clear the issue (note: putenv(...) is uncommented, too):
Code:
/** * Modify the PHP environment variables. */ private function phpEnvironment(): void { // Some servers block access to the system temporary folder using open_basedir... // // Create a temporary folder somewhere we have read/write access, and tell PHP to use it. $tmp = __DIR__ . '/data/tmp4wt'; if (!is_dir($tmp)) { // mkdir($tmp); } putenv('TMPDIR=' . $tmp); }

At least the warning "The server’s temporary folder cannot be accessed..." at Control Panel disappeared.
Thank you Jens & Greg.

Josef

webhosting:-- webtrees 2.1.18, PHP version 8.1.16, MySQL 8.0.22, test site webtrees 2.1.18
local desktop:-- webtrees 2.1.18, PHP version 8.2.12, MySQL 8.0.28, Apache2 2.4.41, Linux Ubuntu 22.04 64bit
Last edit: 4 years 8 months ago by jprause. Reason: typo

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #17 by jprause
Replied by jprause on topic [SOLVED] 2.0.0-beta.3 - Server Warning
Now as to my previous post:
Though as I said the mentioned system warning disappeared from Control Panel, but now all media are seen as red coloured box with 500 in it.
The website error log shows

"error Cannot create thumbnail tempnam(): file created in the system's temporary directory".

Any idea please?

Josef

webhosting:-- webtrees 2.1.18, PHP version 8.1.16, MySQL 8.0.22, test site webtrees 2.1.18
local desktop:-- webtrees 2.1.18, PHP version 8.2.12, MySQL 8.0.28, Apache2 2.4.41, Linux Ubuntu 22.04 64bit

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #18 by JPS
Replied by JPS on topic [SOLVED] 2.0.0-beta.3 - Server Warning

JPS wrote: Thanks so far, I will check this with my hoster and come back.


So, this is, what my hoster says...

Please note that you only have the choice of 2 directories where you can apply open_basedir. These can be adjusted in your webhosting control panel under the -> PHP settings of the affected domain.

Please check the settings stored there and then try again.


What I can chose is this...




DOCROOT is my webtrees folder, WEBSPACEROOT my standard folder (root/httpdocs), which is unused...




I checked several setups with own temp-folders in the httpdocs-folder and the webtrees-folder. I also tryed to use the httpdocs-folder and the webtrees-folder without subfolders and again to use the root/tmp.

All setups show the same behavior als schown above.

Here are the other php-setup patameters...






Any further idea?
Attachments:

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #19 by JPS
Replied by JPS on topic [SOLVED] 2.0.0-beta.3 - Server Warning

jprause wrote: but now all media are seen as red coloured box with 500 in it.
The website error log shows

"error Cannot create thumbnail tempnam(): file created in the system's temporary directory".


I think your problem has a similar cause as my problem..

Please Log in or Create an account to join the conversation.

More
4 years 8 months ago #20 by jprause
Replied by jprause on topic [SOLVED] 2.0.0-beta.3 - Server Warning
File app/Services/ServerCheckService.php
private function checkSystemTemporaryFolder(): string {

sys_get_temp_dir() = "/tmp"
open_basedir contains "/tmp/" among others

The following hotfix solves the issue:
Code:
private function checkSystemTemporaryFolder(): string { $open_basedir = ini_get('open_basedir'); $open_basedirs = explode(PATH_SEPARATOR, $open_basedir); $sys_temp_dir = sys_get_temp_dir()."/"; // <------------------jprause/ONEbit hotfix if ($open_basedir === '' || Str::startsWith($sys_temp_dir, $open_basedirs)) { return ''; } $message = I18N::translate('The server’s temporary folder cannot be accessed.'); $message .= '<br>sys_get_temp_dir() = "' . e($sys_temp_dir) . '"'; $message .= '<br>ini_get("open_basedir") = "' . e($open_basedir) . '"'; return $message; }

Greg, can you comment?
Thanks, Josef

Josef

webhosting:-- webtrees 2.1.18, PHP version 8.1.16, MySQL 8.0.22, test site webtrees 2.1.18
local desktop:-- webtrees 2.1.18, PHP version 8.2.12, MySQL 8.0.28, Apache2 2.4.41, Linux Ubuntu 22.04 64bit

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
}