SNIP is a powerful Open-Source PHP Pastebin, with the aim of keeping a simple and easy to use user interface.
SNIP allows you to easily share code and files with anyone you wish. Based on the original Stikked with lots of bug fixes and improvements.
Here are some features:
- Easy setup
- Syntax highlighting for many languages, including live syntax highlighting with CodeMirror
- Paste replies
- Diff view between the original paste and the reply
- An API
- Search pastes
- Trending pastes
- Encrypted pastes
- Burn on reading
- File upload and preview
- Anti-Spam features
- Themes support
- Multilanguage support
- SNIP client with support for client side encryption/decryption: gostikkit
- Another CLI tool requiring only curl program: pbin
- And many more...
- A web server: Apache, LiteSpeed, Nginx, Lighttpd, Cherokee.
- A database: MySQL / MariaDB, Postgres. OR a writable folder on your filesystem for SQLite.
- PHP version 7.0 - 8.3.
- PHP-GD for the creation of QR-codes and Captcha.
- Download SNIP from https://github.com/MercanoGlobal/SNIP/releases
- Create a user and database for SNIP
- Upload the contents of the htdocs folder to your web host
- Copy application/config/snip.php.dist to application/config/snip.php
- Edit configuration settings in application/config/snip.php - everything is described there
- You're done!
- The database structure will be created automatically if it doesn't exist.
- No special file permissions are needed by default. Optional: If you want to have the JavaScript and CSS files minified, the static/asset/ folder has to be writable.
- To ensure that pastes with an expiration set get cleaned up, define the cron key in the config and set up a cronjob, for example:
*/5 * * * * curl --silent http://yoursite.com/cron/[key]
- If you encounter errors with stylesheets and paths, make sure your base_url config value is not empty (see here).
- Be sure to also copy the .htaccess file when you move files around. This is a hidden file and easily overlooked.
docker-compose up
This automatically builds the docker-image and fires up Nginx, PHP and MariaDB. Access your SNIP instance at http://localhost/.
All files are served directly; the SNIP-configuration for Docker resides in docker/snip.php
In the doc/ folder, you will find:
- Web server example configurations for Apache, Nginx, Lighttpd, Cherokee
- A troubleshooting guide
- How to create your own theme
- How to translate SNIP into your language
- How to contribute and improve SNIP
- New theme: Bootstrap5 (13) - View Theme
- Various bug fixes and improvements
The snip.php config file was updated to support the new theme.
- Updated CodeIgniter to 3.1.13
- Updated the Geshi and PHPQRCode libraries
- Added the ability to upload files to pastes
- Added JS Cookie Consent in the footer
- Fixed PHP 8.1+ compatibility
- Fixed a couple of vulnerabilities
- Lots of various bug fixes and improvements
Note that, due to the vast amount of modifications, compatibility with older projects isn't guaranteed. Please backup & test on a dev instance first.
Copy your application/config/snip.php
/ stikked.php
/ stiqued.php
config file away. Upload the new version.
If you're upgrading from another project, compare the differences between stikked.php
/ stiqued.php
and the new snip.php
, and make the necessary adjustments.