FORUM HOME | WHUK BLOG   
WEB HOSTING UK AFFORDABLE WEBSITE HOSTING SERVICES IN UNITED KINGDOM
PHP LINUX SHARED HOSTING WINDOWS ASP.NET HOSTING PACKAGES
ECOMMERCE HOSTING ASP MSSQL MS ACCESS ODBC FRONTPAGE HOSTING
CPANEL WHM FANTASTICO RESELLER DEDICATED SERVER WEB HOSTING
CHEAP PLESK CPANEL HTML MYSQL BEST UK VPS HOSTING COMPANY
CHEAP RELIABLE UK HOSTING PROVIDER SINCE 2001
MANAGED WEB HOSTING SERVICE
AFFORDABLE WEBSITE HOSTING SERVICES IN UNITED KINGDOM

Web Hosting UK Forums | Linux Windows Dedicated Server and cPanel VPS Hosting Forum » Technical Support » PHP Hosting

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 25-08-09, 01:11 PM
Senior Member
 
Join Date: Dec 2006
Posts: 684
Send a message via MSN to karimali831
Default Using SSH with PHP?

Not sure if this is such thing but can you manipulate SSH commands using php? I want this so my members can stop/start servers without the need of a client or login root access.
Reply With Quote

  #2 (permalink)  
Old 25-08-09, 01:36 PM
Dan's Avatar
Dan Dan is offline
Got root?
 
Join Date: Aug 2007
Location: England, UK.
Posts: 1,340
Send a message via ICQ to Dan Send a message via AIM to Dan Send a message via MSN to Dan Send a message via Yahoo to Dan Send a message via Skype™ to Dan
Default

I know it's definitely possible as a friend of mine created a shoutcast script which manipulates the commands of SSH inside PHP. I'm not sure where to find some good examples though.
__________________
Webhosting.UK.com || cPanel VPS Hosting || Reseller Hosting

Sales: 0808-262-0855
Support: 0800-612-8725
International: +44 191 303 8191
Reply With Quote

  #3 (permalink)  
Old 25-08-09, 04:01 PM
Hexosphere's Avatar
Senior Member
 
Join Date: Jul 2009
Location: Usually sat at this Beastie
Posts: 156
Default

Quote:
Originally Posted by karimali831 View Post
Not sure if this is such thing but can you manipulate SSH commands using php? I want this so my members can stop/start servers without the need of a client or login root access.
It would all depend on exactly what it is you're after achieving. PHP can use either the system() call, or the exec() call but would require to be enabled in the php.ini, though given the security risks, these functions are usually disabled.

PHP Code:
system('/home/user/shoutcast/sc_serv sc_serv.ini > /dev/null 2>&1'// Start Shoutcast server - output to /dev/null 
PHP Code:
system('/home/user/shoutcast/sc_serv sc_serv.ini')  // Start Shoucast server - output all to web browser 

PHP Code:
exec('/home/user/shoutcast/sc_serv sc_serv.ini'$status// Start Shoutcast server - output to variable $status ($status will become an array containing every line of output from the command) 
I've only used shoutcast as an example as Dan mentioned it in the post above, but these are all possible ways of achieving it.
__________________
Hexo
-------
The man that knows how, is always working for the man that knows why

Last edited by Hexosphere; 25-08-09 at 04:05 PM.
Reply With Quote

  #4 (permalink)  
Old 26-08-09, 07:32 PM
Senior Member
 
Join Date: Dec 2006
Posts: 684
Send a message via MSN to karimali831
Default

I use PHP Shell now. It's very much like using the SSH client but on a web page

You set custom login details without using the website login info.
Reply With Quote

Reply

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT. The time now is 08:08 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Copyright 2001-2010 Web Hosting UK. All rights reserved.
Web Hosting UK Forum





Site Map

Shared Cloud
Shared Cloud From £1

Affiliate Program
Earn up to £300 Per Sale

Dedicated Servers
Dedicated Server Hosting

Cloud Hosting
Cloud Server Hosting

Load Balanced Server
Load Balancing Server

VPS Hosting
Linux VPS Hosting

Windows VPS
Windows 2003 VPS

Zimbra Hosting
Zimbra Email Hosting

cPanel Hosting
Shared Linux Hosting

Windows Hosting
Shared Windows Hosting

Coldfusion Hosting
Windows Coldfusion Hosting

cPanel Reseller Hosting
Shared Windows Hosting

Windows Reseller
Windows Reseller Hosting

Email Web Hosting
Email Hosting

Semi-Dedicated Server
Semi-Dedicated Hosting

Remote Backup Plans
Offsite Backup Service


cpanel hosting
Knowledgebase Articles

Pre-Sales Question
Web Hosting FAQ's

Dedicated Hosting
Dedicated Server FAQ's

Virtual Private Servers
VPS Hosting

PHP MySQL Hosting
cPanel Hosting

Windows Hosting
ASP MSSQL Hosting

Domain Name
Domain registration FAQ's

CMS Hosting
CMS Hosting FAQ's

Payment Gateways
Payment FAQ's


Support Tutorials

cPanel Tutorials
cPanel Flash Tutorials

Wordpress Tutorials
Wordpress Flash Tutorials

Plesk Tutorials
Plesk Flash Tutorials

PhpMyadmin Tutorials
PhpMyadmin Flash Tutorials

Drupal Tutorials
Drupal Flash Tutorials

Mambo Tutorials
Mambo Flash Tutorials

Joomla Tutorials
Joomla Flash Tutorials

More Hosting Tutorials