Page 1 of 1

installed ckfinder, but get an error: Warning: is_writable(): open_basedir restriction in effect.

Posted: Mon May 28, 2018 5:31 pm
by bobmeetin
Installing ckfinder is easy. All you do is set a path for the install. However it is failing to start and the full error is like the following:

Warning: is_writable(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/home/my_account/web/my-domain.com/public_html:/home/my_account/tmp) in /home/my_account/web/my-domain.com/public_html/ckfinder/core/connector/php/vendor/cksource/ckfinder/src/CKSource/CKFinder/Config.php on line 330

Fatal error: Uncaught exception 'CKSource\CKFinder\Exception\InvalidConfigException' with message 'The temporary folder is not writable for CKFinder' in /home/my_account/web/my-domain.com/public_html/ckfinder/core/connector/php/vendor/cksource/ckfinder/src/CKSource/CKFinder/Config.php:331 Stack trace: #0 /home/my_account/web/my-domain.com/public_html/ckfinder/core/connector/php/vendor/cksource/ckfinder/src/CKSource/CKFinder/Config.php(73): CKSource\CKFinder\Config->validate() #1 /home/my_account/web/my-domain.com/public_html/ckfinder/core/connector/php/vendor/cksource/ckfinder/src/CKSource/CKFinder/CKFinder.php(92): CKSource\CKFinder\Config->__construct('/home/my_account...') #2 /home/my_account/web/my-domain.com/public_html/ckfinder/core/connector/php/vendor/pimple/pimple/src/Pimple/Container.php(113): CKSource\CKFinder\CKFinder->CKSource\CKFinder\{closure}(Object(CKSource\CKFinder\CKFinder)) #3 /home/my_account/web/my-domain.com/public_html/ckfinder/core/connector/php/vendor/cksource/ckfinder/src/CKSource/CKFinder/CKFinder.php(187): Pi in /home/my_accounmy_account/web/my-domain.com/public_html/ckfinder/core/connector/php/vendor/cksource/ckfinder/src/CKSource/CKFinder/Config.php on line 331

I looked at the php.ini via Vesta CP. The open_basedir setting is:

;open_basedir =

To resolve the above error what would be the right syntax for open_basedir? Or - can this be fixed by modifying the .htaccess? How?

Re: installed ckfinder, but get an error: Warning: is_writable(): open_basedir restriction in effect.

Posted: Mon May 28, 2018 5:49 pm
by grayfolk
In Vesta apache templates open_basedir defined for each domain - see ~/conf/web folder.
You can change template - add /tmp to open_basedir or change CKEditor config for use another temporary folder.

Re: installed ckfinder, but get an error: Warning: is_writable(): open_basedir restriction in effect.

Posted: Mon May 28, 2018 9:56 pm
by bobmeetin
Please walk me through this. I opened VestaCP as root, signed into the account in question, $my_account, then as that user click on the WEB tab. There I select to edit '$my-domain.com'.

Web template is set to default. There is a basedir option from the dropdown. If I switch to basedir and save I see no additional options to add /tmp to open_basedir.

Re: installed ckfinder, but get an error: Warning: is_writable(): open_basedir restriction in effect.

Posted: Mon May 28, 2018 10:10 pm
by grayfolk
bobmeetin wrote:
Mon May 28, 2018 9:56 pm
Web template is set to default. There is a basedir option from the dropdown. If I switch to basedir and save I see no additional options to add /tmp to open_basedir.
I mean you can edit default Vesta templates manually. You can find it in /usr/local/vesta/data/templates/web/httpd/ - if you use Apache.

Re: installed ckfinder, but get an error: Warning: is_writable(): open_basedir restriction in effect.

Posted: Mon May 28, 2018 11:06 pm
by bobmeetin
Ah - okay I found the file. The line is set to:

php_admin_value open_basedir %docroot%:%home%/%user%/tmp

What does it need to be changed to, perhaps?

php_admin_value open_basedir %home%/%user%/tmp

Will this affect the operation of Vesta CP, for instance if it got messed up?

Re: installed ckfinder, but get an error: Warning: is_writable(): open_basedir restriction in effect.

Posted: Tue May 29, 2018 12:18 am
by grayfolk
Use : as paths separator:

Code: Select all

php_admin_value open_basedir %docroot%:%home%/%user%:/tmp
Save file then go to the Vesta users, select affected user(s) and make Rebuild Web. Then restart apache.
Also you can comment this line for disable open_basedir.