Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 11th January 2010, 19:27
DUCKFACE DUCKFACE is offline
Member
 
Join Date: Dec 2008
Location: Bulgaria
Posts: 92
Thanks: 2
Thanked 2 Times in 2 Posts
Default exec not working

im trying to amke kind of plugin .. but i stuck here ...

so .. got $file_data[dir''] ... and i want to copy some files in it ...

$source = "/usr/local/ispconfig/interface/web/bss/content";
$target = $file_data['dir'].'/web';
exec("cp -r ".$source." ".$target);
exec("chmod -R a+r ".$target );
but exec not working ...
any idea ?
ispconf3
________
No2 Vaporizer
________
Charlie Sheen Intern

Last edited by DUCKFACE; 17th March 2011 at 19:34.
Reply With Quote
Sponsored Links
  #2  
Old 11th January 2010, 21:38
Ben Ben is offline
Moderator
 
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts
Default

What is the errormessage you get? Depending on your log_level err message may not be displayed but stored to the webserver's logfile.

Might be, that either safe mode is disallowing the usage of exec or the function is disbaled in general in your php.ini.

Just another thing, whereever the content of $file_data['dir'], carfully verify it's content for validity.
Reply With Quote
  #3  
Old 12th January 2010, 10:03
DUCKFACE DUCKFACE is offline
Member
 
Join Date: Dec 2008
Location: Bulgaria
Posts: 92
Thanks: 2
Thanked 2 Times in 2 Posts
Default error not visible

the error msg is not visible probably of the log level.. but im wonder how exec is working when u add own error pages and in this case is not workin
________
Ram
________
CORVETTE C5-R
________
BARBIEGIRRL

Last edited by DUCKFACE; 12th May 2011 at 03:07.
Reply With Quote
  #4  
Old 13th January 2010, 08:46
Ben Ben is offline
Moderator
 
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts
Default

Normally the default error level is to display all except notices or even including notices in some cases. So if this is not changed it should be either logged to the webserver's logfile or to your display.

Are you talking about the same vhost where exec in custom errorpages is working and when you are trying to run your script? As you can influence / override some default settings on a vhost basis.

Another issue could be that exec is working but the code passed throguh is wrong. So do you see any difference when warpping a var_dump() around the exec part as exec returns the last line of the command's result.
Reply With Quote
  #5  
Old 13th January 2010, 10:40
DUCKFACE DUCKFACE is offline
Member
 
Join Date: Dec 2008
Location: Bulgaria
Posts: 92
Thanks: 2
Thanked 2 Times in 2 Posts
Default just copy it

i copy the command for insert custom error pages .. to see is the problem from my script and it wont work again,
for more clear view i put error_reporting(E_ALL);
ini_set('display_errors', '1');
and still no errors
var_dump of source and target is string(46) "/usr/local/ispconfig/interface/web/bss/content" string(34) "/var/www/clients/client6/web10/web"
finaly i have to exec cp -r /usr/local/ispconfig/interface/web/bss/content /var/www/clients/client6/web10/web
when i execute rhis one from shell (as a root) ... its workin ...
when i try to execute trought ispconfig ... no error .. no nothin .. even when im using the same script that puts custom error pages. i have no idea whats happened

apache log:
cp: cannot create directory `/var/www/clients/client6/web10/web/content': Permission denied
chmod: changing permissions of `/var/www/clients/client6/web10/web': Operation not permitted
chmod: cannot read directory `/var/www/clients/client6/web10/web': Permission denied

if i have rights to cp error pages why i dont have rights to cp other?

Last edited by DUCKFACE; 13th January 2010 at 11:01.
Reply With Quote
  #6  
Old 13th January 2010, 13:53
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,727 Times in 2,565 Posts
Default

Please make sure that PHP Safe Mode is disabled.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 13th January 2010, 13:58
DUCKFACE DUCKFACE is offline
Member
 
Join Date: Dec 2008
Location: Bulgaria
Posts: 92
Thanks: 2
Thanked 2 Times in 2 Posts
Default just asking myself

Quote:
Originally Posted by falko View Post
Please make sure that PHP Safe Mode is disabled.
why copying of error page is working with no problems .. but if u want to copy somethin esle with the same methods its not working ... what am i missing or is there any other limits for disable copy
________
New jersey marijuana dispensary
________
Walter Hayes
________
Brunette Cam

Last edited by DUCKFACE; 12th May 2011 at 03:07.
Reply With Quote
  #8  
Old 13th January 2010, 22:41
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,461
Thanks: 813
Thanked 5,240 Times in 4,108 Posts
Default

You mix up interface and server. You can not use exec in the ispconfig interface as the interface runs under a non priviliged user for security reasons and does not has access to the customer websites. You have to write a server plugin if you want to run commands as root user.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
DUCKFACE (13th January 2010)
  #9  
Old 13th January 2010, 23:28
DUCKFACE DUCKFACE is offline
Member
 
Join Date: Dec 2008
Location: Bulgaria
Posts: 92
Thanks: 2
Thanked 2 Times in 2 Posts
Default thanks

Quote:
Originally Posted by till View Post
You mix up interface and server. You can not use exec in the ispconfig interface as the interface runs under a non priviliged user for security reasons and does not has access to the customer websites. You have to write a server plugin if you want to run commands as root user.
thanks till

can anyone help with creating server plugin ?
________
Ford Ma Concept Car
________
BLOWJOB VIDS
________
New Jersey Marijuana Dispensaries

Last edited by DUCKFACE; 12th May 2011 at 03:07.
Reply With Quote
  #10  
Old 15th January 2010, 13:18
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,461
Thanks: 813
Thanked 5,240 Times in 4,108 Posts
 
Default

Take a look at the existing server plugins in /usr/local/ispconfig/server/plugins-available to get an idea how they work. Every plugin must have a unique name. These plugins are event based, so depending on the event that you want to execute your code, write a new plugin which subscribes to the events. To activate the plugin, create a symlink in the plugins-enabled directory to the file in the plugins-available directory.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to install ISPConfig bdonecker Installation/Configuration 21 26th May 2009 08:20
fail2ban not working linuxwannabe Installation/Configuration 1 25th January 2009 06:09
DNS stop working MZH General 3 22nd February 2008 11:10
spamassassin stop working after woody to sarge update shark_tico Server Operation 1 19th October 2006 14:01
ftp not working pesja Installation/Configuration 3 17th July 2006 12:37


All times are GMT +2. The time now is 01:28.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.