Koozali.org: home of the SME Server
Contribs.org Forums => Koozali SME Server 10.x => Topic started by: wdepot on March 24, 2024, 01:21:13 AM
-
In my attempt to create an updated web site I need to be able to copy images from the original site using PHP since some images are going to be in new locations and the images on the old site are constantly changing as items are added and deleted. Unfortunately I am getting the following error from the PHP copy commands:
Warning: copy(): open_basedir restriction in effect. File(/home/e-smith/files/ibays/oldsite/html/images/imagename) is not within the allowed path(s):
As open_basedir is supposed to be settable anywhere according to the PHP manuals I have tried the following in my conversion program which is in the new ibay:
$tmp = ini_get('open_basedir');
$tmp .= ':/home/e-smith/files/ibays/oldsite/';
ini_set('open_basedir', $tmp);
However I still get the copy failure and when I do another ini_get after doing the ini_set I find that open_basedir hasn't been changed for some reason. I'm running PHP 8.3 on the new ibay. Anyone have any ideas for a workaround that will allow me to do what I'm trying to do? Maybe a temporary custom template for the settings on the new ibay that I can remove once the conversion is finalized?
-
ibays are protected from each other
, and folders outside of the ibay too, to avoid one malicious script from doing harm everywhere on the server. this is called open_basedir
you can add some folder in the open_basedir list. i suggest using smeserver-webhosting panel to alter this value for your need
-
ibays are protected from each other
, and folders outside of the ibay too, to avoid one malicious script from doing harm everywhere on the server. this is called open_basedir
you can add some folder in the open_basedir list. i suggest using smeserver-webhosting panel to alter this value for your need
Thanks for the pointer. I had looked at Web Hosting but failed to notice the Basedir setting at the very bottom, perhaps because it defaults to blank which loads the default values I was seeing in ini_get.
-
Remember that setting is there for your protection so make sure you don't forget to turn it off again!