Using spip_loader

« Spip_loader » is a script that allows to install or to update your SPIP site automatically without uploading all the files by ftp.

Current version of spip_loader : 6.1.7

Using spip_loader to install SPIP automatically

spip_loader requires at least PHP 5.6

  1. Check the php compatibility of your host by following the table at: Supported Versions
  2. Download the script
  3. Set this file via SFTP in the directory where you want to install SPIP (generally at the root of your server). Caution: configure your client software in binary mode for this transfer [1].
  4. Call the script from your browser http://www.mysite.tld/spip_loader.php
  5. The script checks if your hosting meets the necessary requirements then indicates the SPIP version you are going to install or update (usually the latest version).
  6. Choose your version and start the automatic installation.

Leave the script online
Once SPIP installed, you can safely leave the script spip_loader.php on the server. Only the authorised and authenticated administrators will be able to access it. The benefit is to be able, in case of a problem, to update SPIP very easily.

Detailed explanations
spip_loader detects its new versions and offers to update itself without the need for an FTP transfer.

  • a drop-down list allows to choose the version to be installed
  • if no SPIP is installed :
    • the drop-down list selects the latest stable version
  • if a SPIP is already installed :
    • the drop-down list is positioned by default on the latest version of the same branch as the site (if it is still referenced).
    • files that are obsolete after the update (i.e. that have been removed between the current site version and the installed version) are stored in a directory fichiers_obsoletes_{date} where date is replaced by the current date and time. This applies only to the directories: ecrire, prive, squelettes-dist and plugins-dist (and the old directory extensions).
    • corollary to the previous point, if plugins had been added to the plugins-dist/ directory (therefore not belonging to the zip provided by SPIP), they will also be moved to this directory of obsolete files, unless they contain a .spip_loader_keep file.
  • It is possible to use a configuration file to manage the defines and keep them from one update to another with spip_loader_config.php

As of version v5.2.0, spip_loader.php is in compressed phar binary format, which also includes translations. If you need to use defines, you need to create a configuration file spip_loader_config.php

As of version 6.0.0, customisation constants are deprecated. The configuration file spip_loader_config.php must return an array, as shown in the example below.

Using spip_loader to execute an update

To update SPIP, proceed the same way:

  1. Access the SPIP private area
  2. Upload the script to your server (if not already done)
  3. Call the script from your browser http://www.mysite.tld/spip_loader.php
  4. Choose the version you want to install
  5. Launch the automatic installation process

Before calling the script you should be identified as a webmaster.

Customize the authors authorized to perform an update

By default, only the author n°1 can perform this update.

If you want to add other authors, you need to create a configuration file spip_loader_config.php (at the root) which will be included automatically. This way your settings are preserved when updating spip_loader.

Example of file spip_loader_config.php :

<?php

return [
   'authorized.users' => [5, 6, 8],
];

Frequently encountered errors

I run spip_loader and get an error "SHA512 signature could not be verified: broken signature.."

You haven’t transferred the spip_loader.php to your server properly: you need to transfer the file in Binary mode from your FTP software. Cf. #Utiliser-spip_loader-pour-installe...

When I go to mysite/spip_loader.php: I get a 403 - File Access Denied

Often there is a slash/ at the end of mysite/spip_loader.php inherited from previous usage. Removing this slash is often enough to remove the error and allow spip_loader.php to do its job.

What to do in case of failure?

spip_loader can fail to upload files. Generally it is caused by permissions issues on the server. In this case you will have to install SPIP:

  • either by transferring manually the files via FTP
  • or by using git (for advanced users)

Technical notes

-  The spip-loader sources are in the development area:
https://git.spip.net/spip-contrib-outils/spip_loader

Footnotes

Author jack Published : Updated : 09/06/23

Translations : English, français, Nederlands, Português, українська