R
R
romankulish52015-04-15 17:13:46
linux
romankulish5, 2015-04-15 17:13:46

Error when running sh script with creating openvz server via php, how to fix?

Hello.
Please help me understand what's wrong. I run the sh script via php exec ("sh /var/www/users/$username/user.sh &");, and in the Apache logs I get the following error:
Container config file does not exist
Unable to open /dev/vzctl: Permission denied
Please check that vzdev kernel module is loaded and you have sufficient permissions to access t he file.
But when I run it manually like: sh /var/www/users/$username/user.sh , everything works without problems. Can you point me in the right direction, so to speak? What could possibly be the problem? Perhaps, in order for openvz to run through php, you need to install some kind of add-on?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Puma Thailand, 2015-04-15
@romankulish5

Apache has no rights to vzctl
use

K
Kirill Timofeev, 2015-04-15
@IRC

Your web server must be running under the www-data user. Check that this user has read and execute access to /var/www/users/$username/user.sh and all files/devices described in user.sh.

V
Vasily Alibabaevich, 2015-04-15
@dimitrius86

Check if the exec function is disabled in the php.ini config, often disabled for greater security

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question