#1  
Old 1st November 2006, 23:48
richj1232003 richj1232003 is offline
Junior Member
 
Join Date: Nov 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Windows PHP script problem

Hi.

I have created a windows PHP script which I place it in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs. My question is can I write a windows PHP script and inside the script it will connect to a UNIX server and then run the Korn shell script? If so, what are the commands?

Thank you.
Rich
Reply With Quote
Sponsored Links
  #2  
Old 2nd November 2006, 09:01
Ben Ben is offline
Moderator
 
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts
Default

Just for the access and executing commands you do not need php on the windows box, because running commands on the linux box you can simply do with an ssh client.
This command will list files older than 30 days in the specified dir... nearly the same way you could run a script.

Quote:
ssh 1.2.3.4 find /export/home/*.dmp -ctime +30
But sometimes you need to source your userprofile first, before executing any script:
Quote:
ssh 1.2.3.4 ". /usr/local/etc/profile; /export/home/local/service stop; sleep 20; /export/home/local/service start\"
So this example shows how to run more than one command in a sequence.

If you now wish to run systemcommands out of your php script, you can e.g. do that with `` (backtiks), exec(), system(), etc... for more see the crosslinks to that commands on www.php.net

EDIT: And that thread (http://www.howtoforge.com/forums/showthread.php?t=7853) gives you an example how you can directly do an ssh connection with php...

Last edited by Ben; 2nd November 2006 at 09:03.
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
Freebsd 6.1 support misterm Installation/Configuration 10 9th April 2009 09:29
Slightly Confused (DNS & Server Help) JohnnyBGoode Installation/Configuration 26 14th August 2007 09:54
VirtualHosts marra87 General 9 12th September 2006 04:09
Downgrade php5 to php4.4.2 llizards Installation/Configuration 4 13th March 2006 23:58
all my site go to /var/www/ Absolusteph Installation/Configuration 14 11th March 2006 21:27


All times are GMT +2. The time now is 13:30.


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