Official ZPanel Community & Support Forum

Forums


Lost Password?
Register

 
Thread Rating:
  • 3 Votes - 3.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP - Running shell command in PHP like escapeshellcmd() and exec()
13-10-2012, 07:44 PM (This post was last modified: 15-10-2012 11:52 AM by marksel93.)
Post: #1
PHP - Running shell command in PHP like escapeshellcmd() and exec()
Hello everyone!

First I'd like to say that I love zPanel. Installed it a few days ago and I just love the ease!

But now... I've run into a problem. This might be a total noob-problem (I don't know haha), but I'd appreciate it if anyone could answer it for me.

I've got some PHP scripts to check the whois information of domains, used before installing zPanel, but they seem to break on shell commands like Exec() and escapeshellcmd(). I've looked into the php.ini but they are not in the disable_commands and neither is safe-mode on.

Is there any way I can execute these commands?

Thank you in advance for the support.
Quote
14-10-2012, 06:37 PM
Post: #2
PHP - Running shell command in PHP like escapeshellcmd() and exec()
Basically open the V-host file and look for the domain name where your running the php script and remove the exec and escapeshellcmd from the disable list I THINK

WARNING not recommend as you can do ALOT of damage to the server with exec etc thats why we disable them by default

Sam

ZPanel Developer
WWW
Quote
15-10-2012, 11:16 AM
Post: #3
PHP - Running shell command in PHP like escapeshellcmd() and exec()
There is a better way to do this, please do not just edit the vhosts file anymore.

In zpanel go to : Module Admin - Apache Config - Override a domain

You can turn the suhosin blacklist off on set domains / subdomains.

Once you have disabled the blacklist option then go to : Zpanel config - run daemon

This will rewrite the vhosts file.

Kevin Andrews ~ ZPanel Core and Module Developer | Follow me for ZPanel updates
Software Developer for Influential Software
Runs zVPS.co.uk - Support Zpanel and Buy your VPS with us!
Follow us on twitter for news on VPS offers and ZPanelX updates!
WWW
Quote
15-10-2012, 11:51 AM
Post: #4
PHP - Running shell command in PHP like escapeshellcmd() and exec()
Thanks, that fixed it Smile

I'm only enabling the exec commands etc. for my main website.
Quote
15-10-2012, 12:07 PM
Post: #5
PHP - Running shell command in PHP like escapeshellcmd() and exec()
Cool, just be careful as exec etc can be a very large security hole!

Kevin Andrews ~ ZPanel Core and Module Developer | Follow me for ZPanel updates
Software Developer for Influential Software
Runs zVPS.co.uk - Support Zpanel and Buy your VPS with us!
Follow us on twitter for news on VPS offers and ZPanelX updates!
WWW
Quote
15-10-2012, 04:24 PM
Post: #6
PHP - Running shell command in PHP like escapeshellcmd() and exec()
Caffeine Addict Wrote:There is a better way to do this, please do not just edit the vhosts file anymore.

In zpanel go to : Module Admin - Apache Config - Override a domain

You can turn the suhosin blacklist off on set domains / subdomains.

Once you have disabled the blacklist option then go to : Zpanel config - run daemon

This will rewrite the vhosts file.

Are cool cool will take note of that Smile
Is that becuase daemon will over write it??

Sam

ZPanel Developer
WWW
Quote
15-10-2012, 04:55 PM
Post: #7
PHP - Running shell command in PHP like escapeshellcmd() and exec()
Yes that is indeed the reason, I tried your approach but every time the daemon ran, the functions were disabled again Smile. Thanks for the help!
Quote
15-10-2012, 10:05 PM
Post: #8
PHP - Running shell command in PHP like escapeshellcmd() and exec()
No probs. Are fort as much cheers pal Big Grin

Sam

ZPanel Developer
WWW
Quote


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Daemon stops running when a create a cron job Richardkl 7 171 24-03-2014 04:01 AM
Last Post: TGates
  [SOLVED] Problems with exec function diegosolo 4 206 22-03-2014 04:46 PM
Last Post: diegosolo
  [Please help] Another MySQL daemon already running with the same unix socket haminhgiap 17 27,071 22-02-2014 06:05 PM
Last Post: joshwho420
  [SOLVED]setzadmin command not found jacobg830 4 274 31-01-2014 04:51 PM
Last Post: jacobg830
  Can access FTP from shell but not FTP app mattspaeth 0 182 11-12-2013 02:39 AM
Last Post: mattspaeth

Forum Jump:


User(s) browsing this thread: 1 Guest(s)