PHP Wrapper Script for linkchecker to check multiple URLs and send reports via mail if errors or warnings are found.
Access to the proc_open
PHP function is required.
It uses PHPMailer for email sending and Process for executing command line programs.
- PHP >= 8.1
- enabled proc_open function
- linkchecker executable
- Clone this repo
git clone https://github.com/e-dschungel/checklinks
- Install dependencies using composer
composer install --no-dev
- Rename
config/config.dist.php
toconfig/config.conf.php
and edit it according to your needs - Create url specific configuration (named like url, dots replaced with underscores, e.g. http://example.com => example_com.conf). Rename
example_com.dist.conf
and edit accordingly.)
- Download
checklinks.zip
(NOTSource Code (zip)
orSource Code (tar.gz)
) from https://github.com/e-dschungel/checklinks/releases/latest - Extract and upload it to your webserver
- Rename
config/config.dist.php
toconfig/config.conf.php
and edit it according to your needs - Create url specific configuration (named like url, dots replaced with underscores, e.g. http://example.com => example_com.conf). Rename
example_com.dist.conf
and edit accordingly.)
The configuration is specific for a given URL (dots replaced with underscores).
variable | description |
---|---|
$cl_config['linkcheckerPath'] | path to linkchecker executable |
$cl_config['URLs'] | Array of URLs to check |
$cl_config['subject'] | Subject of the email |
$cl_config['body'] | Text of the email body |
$cl_config['emailTo'] | email adress of the recipient |
$cl_config['emailFrom'] | email adress shown as sender of the dump |
$cl_config['emailBackend'] | email backend,can be smtp oder sendmail |
$cl_config['SMTPHost'] | SMTP hostname |
$cl_config['SMTPAuth'] | use SMTP authentication? true or false |
$cl_config['SMTPUsername'] | SMTP username |
$cl_config['SMTPPassword'] | SMTP password |
$cl_config['SMTPSecurity'] | type of SMTP security setting, can be "starttls" or "smtps" |
$cl_config['SMTPPort'] | SMTP port |
- first public release
- update PHPMailer to 6.9.1
- update dev dependencies
- remove shared configuration for all URLs
- update dev dependencies
- update process to 5.4.36
- update minimal PHP version to 8.1
- update Process to 6.4.8