PHP FTP Synchronizer. Website

Free program for updating the website from local files. PHP FTP Synchronizer recursively scans the directory tree and updates the equivalent directory on the site, replacing modified files. It tests broken links on the page and updates the site map.

PHP FTP Synchronizer is a script with source code in the Script language and creates an executable PHP file. A Script 2 compiler is required to compile the source.
It works on the command line.

Program specifics

Compared to various existing and mostly commercial programs, the synchronizer offers acceleration options:

In addition, the executable program is a PHP script, so it works on all systems, Windows, Linux, Mac... And you can empower it if you need to.

How the program works

Since the useful parameters are given (see below), the program has the path to your files, the name of the site (ftp.xxx.tld), your login and password, the path to the hosting, if you do not copy to the root, as well as the selected parameters.
It reads each file by recursively scanning the directory and subdirectories, compares it to the deleted one if it exists, and copies or replaces it.
If the acceleration option is selected, it compares the file with the backup when on a specific date or content of choice, and then, if they are different, downloads the file, copies it to the backup, and synchronizes the date of the backup file with the date of the source.

Installation

Download PHP and extract it to a directory, for example:

 c:\php\

On Windows, this directory must be included in the PATH variable.

Type "env" in the search box on the taskbar, select "path" and click the edit button. Add this line:

c:\php\.

In the php directory, rename php.ini-production to php.ini

Add ftp extension. Edit this php.ini file to remove ";" before ftp in the extension list.

Using a Round

The links test is faster with curl and also allows you to check links to https .

To enable curl, delete ";" before the curl extension in php.ini.
To verify that this ini file is considered, type:

php --ini  

This will give the path to the loaded ini file .

Memory limitation

If PHP tells you that the memory is saturated ("exported"), you can also increase the limit in php.ini:

memory_limit = 1024M  

Using PHP FTP Synchronizer

The command line opens on Windows or the console opens on Linux or Mac.
We place an order in the form:

solp ftpsync [options] [paramètres] url

or directly in PHP:

php ftpsync.php [options] [paramètres] url

Texts enclosed in square brackets [] are optional.

Example:

php ftpsync.php -v -llogin -pmotdepass -fftp.example.com -dw:\example\ -bf:\example\ -wwww.example.com

The options detailed in the manual allow you to pass all the necessary parameters. If a parameter is missing, the program requests it. But if a parameter is selected that requires configuration, it must be specified in the command, the program does not ask for it, which in this case gives an error.

Program and Management

Guide to using PHP FTP Synchronizer.

Download PHP FTP organizer


Possible problems


Discussion board

ftpsync [options] [options] dirsource [

url]
15-11-2008 15:45:31

phillag

I don't understand how the php command can have this syntax. Where are the "?" and "&" characters for passing parameters? How can the php interpreter understand parentheses? Where is the syncroniser bookstore declaration? at the top of the php page? in the php.ini file and in what form? thank you for all of your help.
19-11-2008 14:51:47

webmaster

Use the ftpsync.php command on the command line. Therefore, the parameters are extracted directly by the program from the list of arguments of the main function:
function main($argc, $argv)
while it is called at the root of the script:
main($argc, $argv)
these variables are global variables that are determined automatically. Only when calling a script using http (POST) commands, & etc. Parentheses are for guidance, not for programming. They are an optional parameter. In the actual order, the parentheses and their contents are replaced by the parameter.

Purpose and source

15-11-2008 14:57:58

phillag

Hi, I would like to use ftp synchronization, but I don't understand doc. I use the apache server locally with easyphp and want to send a set of files contained in the local directory to a site hosted by a mutual host. ftpsync [options] [options] dirsource [url] I don't understand where the target and source are in this syntax. dirsource [url]???? Is this a URL or URI? Why does she have a uniform ftp.iqlevsha.ru? while it should be the source? In my case, the source files (those that should be sent to the ftp server) are located locally, so the form: http://localhost/rep/sous_rep/ or h :/rep/subrep/which of the two forms is used? and where do I put it? in dirsource [url] or in dwww? Then the target files (resulting from copying the source files to localhost) are in the zone accessible by: ftp.donhost.co.uk login: monlogin passes: monpasse ftp.donhost.co.uk?? Where do I put it? in dirsource [url] or in dwww? thank you for all of your help
19-11-2008 14:47:11

webmaster

Good morning Let's assume that the contents of the site are in the www directory Let the sources be in the local file h :/rep/sourep/This command should work .
php ftpsync.php h:/rep/sourep/ -llogin -pmonpasse -dwww ftp.example.com
A URL is recognized as such if it starts with ftp.

Flip the job

11-11-2009 18:43:03

hugo69

Hello, I find FTP Sync at the top and wondered if it could be turned around. The goal for me is for the deleted files to be the source, and the local ones to be overwritten. So, if I post an update to the site, all posts that will be periodically searched on the site will be able to make their update. Tx!
13-11-2009 13:30:41

webmaster

Hello, in principle we should replace the function ftp_put
if ftp_put(connection, rmt, src, $(FTP_BINARY)) = true
via the ftp_get function. But this will be accompanied by many other changes to the program. I am now too overwhelmed to think about this work myself...
13-11-2009 13:34:38

hugo69

in principle, the function should be replaced ftp_put
if ftp_put(connection, rmt, src, $(FTP_BINARY)) = true
via the ftp_get function. But this will be accompanied by many other changes to the program. I am now too overwhelmed to think about this work myself...
Yes, I thought about it, but the problem is that all lust and checks are different locally and remotely... Therefore, you need to make a lot of changes... And instead of spending a few hours changing that scenario, I thought qqun must have had the same problem, t already adapted it or found a similar scenario... It would be so good, it would be better...