1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/local/bin/php
<?php
/*
This script will chroot via the builder system to test
the local php setup. If we can perform a series of
small tests to ensure the php environment is sane.
*/
require_once('util.inc');
require_once('xmlparse.inc');
require_once('config.lib.inc');
$config = parse_config();
$passed_tests = true;
// Test config.inc
if ($config['system']['hostname'] == '') {
$passed_tests = false;
}
// Test for php-fcgi
$php_cgi = trim(`php-cgi -v | grep cgi-fcgi`);
if (stristr($php_cgi, 'cgi-fcgi')) {
echo 'FCGI-PASSED ';
} else {
echo 'FCGI-FAILED ';
exit(1);
}
if ($passed_tests) {
echo 'PASSED';
exit(0);
}
echo 'FAILED';
exit(1);