Official ZPanel Community & Support Forum

Forums


Lost Password?
Register

 
Thread Rating:
  • 12 Votes - 3.33 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.uk - DDoS Protected ZPanelCP Pre-installed VPSs
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.uk - DDoS Protected ZPanelCP Pre-installed VPSs
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
  FTP - command not implemented chenjung 1 58 03-08-2014 09:34 AM
Last Post: chenjung
  Invalid command 'php_admin_value' modcar 4 3,103 28-07-2014 06:20 AM
Last Post: chris6273
  php Configure Command johnyp 0 60 25-07-2014 08:16 AM
Last Post: johnyp
  Daemon stops running when a create a cron job Richardkl 9 505 14-07-2014 06:58 AM
Last Post: TGates
  escapeshellcmd() Disabled sashkernel 5 145 23-06-2014 06:56 PM
Last Post: TGates

Forum Jump:


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