erakenz Posted December 11, 2013 Share Posted December 11, 2013 Hello everyone, would you please help me to fix this problem. When i press on New Product, it's returned an error like this PHP Warning: file_exists(): open_basedir restriction in effect. File(/js/tiny_mce/langs/vn.js) is not within the allowed path(s): (C:/Inetpub/vhosts/xxxxx.com\;C:\Windows\Temp\) in C:\Inetpub\vhosts\xxxx.com\yyyyyy.vn\controllers\admin\AdminProductsController.php on line 3366 Thanks in advance ! P/s: I purchase an host (windows server) and install Prestashop 1.5 on this host. Link to comment Share on other sites More sharing options...
Radu Posted December 11, 2013 Share Posted December 11, 2013 I can't imagine why file_exists is for vn.js like above: /js/.... because this is a relative url path... Link to comment Share on other sites More sharing options...
erakenz Posted December 11, 2013 Author Share Posted December 11, 2013 [solved] The problem is PHP setting. It's fine when I changed value open_basedir = {root};\ Link to comment Share on other sites More sharing options...
nanobyt3 Posted August 9, 2017 Share Posted August 9, 2017 (edited) It seems you have open_basedir config value set in php.ini which is limiting the access. As a quick fix, If you disable open_basedir setting in php.ini, all would work well. But, that being said, my understanding is that the code itself might not be correct for windows environment. _PS_JS_DIR_ should contain an absolute path path of local filesystem which in-turn would require __PS_BASE_URI__ to have local path. So, you could either not use file_exist in this manner or make adjustment to the code to use correctly built path so as to not conflict with open_basedir setting. An approach would be to edit 'controllers/admin/AdminProductsController.php' and replace the line (which appears twice in the file) $iso_tiny_mce = (file_exists(_PS_JS_DIR_.'tiny_mce/langs/'.$iso_tiny_mce.'.js') ? $iso_tiny_mce : 'en'); with $iso_tiny_mce = (file_exists(_PS_ROOT_DIR_.'/js/tiny_mce/langs/'.$iso_tiny_mce.'.js') ? $iso_tiny_mce : 'en'); Edited August 10, 2017 by nanobyt3 (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts