Jump to content

Cannot create product


Recommended Posts

Error message has been shown when create a new product as followings:

 

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

Link to comment
Share on other sites

it's issue related to the server restrictions (related to the safety) that you've got defined in your local server.

in this case you have to configure your php configuration file. so open the php.ini file and search for:

 

open_basedir =

 

now you have two solutions:

  • change the open_basedir path (to "/" for example)
  • add semicolon before open_basedir:

;open_basedir =

 

 

then restart your local server and try again

Link to comment
Share on other sites

  • 3 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 an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...