Jump to content

error while adding new product or editing existing product


Recommended Posts

I am getting following error while i am trying to add new product through admin

or edit existing product through admin.

 

PHP Warning: file_exists(): open_basedir restriction in effect. File(/demo6/js/tiny_mce/langs/en.js) is not within the allowed path(s): (C:/Inetpub/vhosts/shoppingcartatdollar10.com\;C:\Windows\Temp\) in C:\Inetpub\vhosts\shoppingcartatdollar10.com\httpdocs\demo6\controllers\admin\AdminProductsController.php on line 3478

using stable prestashop 1.5.4.1 version.

 

please help

Link to comment
Share on other sites

  • 4 years later...

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 by nanobyt3 (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...