Prestashop: Install fails with open_basedir and NTS PHP on Windows

Created on 25 Aug 2020  路  14Comments  路  Source: PrestaShop/PrestaShop

related with previous issue https://github.com/PrestaShop/PrestaShop/issues/16736

how to replicate

issue present when installing from CLI using NTS PHP with open_basedir set, steps to replicate:

  1. download NTS PHP for Windows (ex https://windows.php.net/downloads/releases/php-7.4.9-nts-Win32-vc15-x64.zip )
  2. clone the latest PrestaShop develop and run composer install
  3. install from CLI using php -d open_basedir="PrestaShop_directory" admin-dev/index_cli.php

currently, the install does not succeed and it emits a php warning:

Warning: is_file(): open_basedir restriction in effect. File(C:\xxx\ps_php8\ps_17_php8\app/Resources/views/C:/xxx/ps_php8/ps_17_php8/mails/themes/modern/core/account.html.twig) is not within the allowed path(s): (C:\xxx\ps_php8)

some template path is built wrongly, ie. absolute file path is prefixed with a directory path

local workaround

(to make install passing for development purposes)

delete mails/themes/modern/ folder

1.7.5.2 1.7.6.7 1.7.7.x Bug IN Minor To Do

Most helpful comment

@PierreRambaud,

As report here
_Trivial_

The bug doesn鈥檛 affect any functionality or data. It does not impact productivity or efficiency. It is only an inconvenience without functional impact and it does not even need a workaround.

I think Minor is the best one.

Thanks!

All 14 comments

Thanks for opening this issue! We will help you to keep its state consistent

Hi @mvorisek,

This issue is fixed in the 177x branch.
Could you please try to reproduce the issue in the 177x branch, check and feedback.

Thanks!

This issue is fixed in the 177x branch.

this isssue is related to the previous one, but the issue is different and also the output is different

Could you please try to reproduce the issue in the 177x branch, check and feedback.

reproduced now on 1.7.7.x, so at least 1.7.7.x and develop branches are affected

@mvorisek, Thanks for your feedback.
I need to prepare a similar environment to reproduce the issue.
I will check and feedback.

Thanks!

@khouloudbelguith can you please prioritize this issue and get someone looked into it?

Ping @PrestaShop/prestashop-core-developers can you check this issue in the meantime, I will prepare such environment.

Thanks!

Hi,
C:\xxx\ps_php8\ps_17_php8\app/Resources/views/C:/xxx/ps_php8/ps_17_php8/mails/themes/modern/core/account.html.twig聽
regarding the generated path, it looks like something went wrong. Does it happen only on Windows?
Also, you need to take in consideration PHP 7.4.9 is not supported yet.

Does it happen only on Windows?

@PierreRambaud I think yes as paths are combined very differently on other platforms in php interpreter and it is maybe even related with https://github.com/php/php-src/pull/5001

My best guess is:

  • it is reproducible on any Windows with NTS PHP
  • it may be presented in 1.7.7.x as well

as 7.4 is expected to be supported very soon, I think the issue should be traced and fixed, help wanted

I don't have Windows, I'm not the one who will be able to help you :sweat_smile:

Hi @mvorisek,

I manage to reproduce the issue with PS1.7.7.x, 1767 and 1752
177x
image
1767
image
1752
image

I鈥檒l add this to the debug roadmap so that it鈥檚 fixed. If you have already fixed it on your end or if you think you can do it, please do send us a pull request!
Thanks!

I鈥檒l add this to the debug roadmap so that it鈥檚 fixed. If you have already fixed it on your end or if you think you can do it, please do send us a pull request!

Thanks - I have no fix, waiting for it :)

As this prevents install to complete on Windows when open basedir is set, it affects a lot of users, I belive, it should be fixed asap and labeled with higher priority than "Minor".

@PrestaShop/prestashop-product-team what do you think of the severity of this issue?

Thanks!

@PrestaShop/prestashop-product-team what do you think of the severity of this issue?

Thanks!

It must be Trivial since Windows is only supported for development and the open_basedir configuration is rarely used.

@PierreRambaud,

As report here
_Trivial_

The bug doesn鈥檛 affect any functionality or data. It does not impact productivity or efficiency. It is only an inconvenience without functional impact and it does not even need a workaround.

I think Minor is the best one.

Thanks!

Was this page helpful?
0 / 5 - 0 ratings