Run PHP Script on Another Server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thepeel
Forum Newbie
Posts: 2
Joined: Mon Sep 17, 2007 4:22 pm

Run PHP Script on Another Server

Post by thepeel »

I've seen similar questions asked before but they either do not fit my situation or went unanswered.

Basically we have a PHP script running on a server on our intranet that creates directories based on client name and job number. In an effort to simplify things for the account reps setting these up, I would like it to also add the same directories on our client site. I'm wondering what the best way to do this would be.

I'm envisioning it looking something like this (removing other functions of the script):

Computer A (Intranet) ->Run PHP Admin Script -> Calls script on Computer B and passes info to it -> Takes info creates new directories

Where I'm struggling is what sort of limitations I will have on the remote server to pass variables and have it run the script and create the directories.

I hope this made sense.

Thanks in advance,

-peel
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

You might be interested in rsync.
http://en.wikipedia.org/wiki/Rsync
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post by Zoxive »

Another thing to look at would be SOAP.
thepeel
Forum Newbie
Posts: 2
Joined: Mon Sep 17, 2007 4:22 pm

Post by thepeel »

Thanks for the replies. I hadn't thought about rsync but in the interest of keeping things simple I left out some of what was going on that would somewhat preclude rsync from working.

The server running the intranet also hosts our client file server. This is our collab server that everyone in the office works from. We are a creative firm so it is a huge drive and is filled with tons of files. So when we create a new project in our project management software, the script creates a new project folder for the specified client and then creates a series of subdirectories that help manage the project workflow. Our client web server on the remote machine is just for showing comps and letting the clients upload things. What I want to do is modify the part of the script that creates the directories on the local client share so it simply creates a project folder and a couple of comp folders on the client web site. So it would basically be the same script but it would be creating two different sets of directories. So in that scenario rsync wouldn't work.

The two Servers are setup something like this:

Intranet
Script
Client
Project
Images
Comps
Source
Illustrator
Etc.

Client Website
Script
Client
Project
Comps
Final
Uploads


I hadn't looked into SOAP and will probably spend a little more time messing around with getting my php idea to work before doing so. As you can tell I'm still a noob when it comes to php so learning something else right now isn't exactly on the radar.

So keeping in mind the above does anyone have a suggestion on how this would work using only php?

Thanks again,

-peel
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

There are many solutions. You could mount the client site's directory as a NFS share on you intranet server. You could use software like rsync or FTP. Or jsut make some kind of HTTP request to the client server to a remote script to create the directories. It could be as simple as a GET/POST, maybe using HTTP authentication. Or something fancy like SOAP.
(#10850)
Post Reply