root/dev/install/install_step2.php @ 434

Revision 434, 4.8 KB (checked in by kovell, 11 years ago)

Fixes: incorrect installation error message removed

Line 
1<?php
2if(!$installrunning) {header('Location: index.php');die();}
3$stoppage = false;
4
5// graphics
6echo '<div class="block-header2">Graphics</div>';
7if (function_exists('imagecreatefromstring'))
8{
9    echo 'GD is available.<br/>';
10    if (!function_exists('imagecreatetruecolor'))
11    {
12        echo 'Your GD is outdated though and will cause problems, please contact your system administrator to upgrade to GD 2.0 or higher.<br/>';
13    }
14    echo 'Now let\'s see if you got the FreeType library needed for painting TrueType .ttf fonts onto images<br/>';
15    if (function_exists('imagettftext'))
16    {
17        echo 'I found FreeType support, this is needed by the signature mod. Good!<br/>';
18    }
19    else
20    {
21        echo 'Unfortunately I was unable to locate FreeType support so you cannot use all available signatures. :(<br/>';
22    }
23}
24else
25{
26    echo 'GD is NOT available.<br/>The Killboard will be unable to output character portraits or corporation logos, please speak with your system administrator to install GD 2.0 or higher.<br/>';
27    echo 'You can continue the installation but the Killboard might not run smoothly.<br/>';
28}
29
30// directorys
31echo '<br/><div class="block-header2">Directory structure</div>';
32function checkdir($dir)
33{
34    if (!file_exists($dir))
35    {
36        echo 'Creating '.$dir.' for you...<br/>';
37        mkdir($dir);
38        chmod($dir, 0777);
39    }
40    if (is_writeable($dir))
41    {
42        echo 'Directory '.$dir.' is there and writeable, excellent.<br/>';
43    }
44    else
45    {
46        echo 'I cannot write into '.$dir.', you need to fix that for me before you can continue.<br/>';
47        echo 'Please issue a "chmod 777 '.$dir.'" on the commandline inside of this directory<br/>';
48        global $stoppage;
49        $stoppage = true;
50    }
51}
52
53if (is_writeable('../cache'))
54{
55    echo 'Cache directory is writeable, testing for subdirs now:<br/>';
56    checkdir('../cache/cache');
57    checkdir('../cache/api');
58    checkdir('../cache/corps');
59    checkdir('../cache/data');
60    checkdir('../cache/map');
61    checkdir('../cache/mails');
62    checkdir('../cache/portraits');
63    checkdir('../cache/templates_c');
64}
65else
66{
67    $stoppage = true;
68    echo 'I cannot write into ../cache, you need to fix that for me before you can continue.<br/>';
69    echo 'Please issue a "chmod 777 ../cache" and "chmod 777 ../cache/*" on the commandline inside of this directory<br/>';
70}
71
72echo '<br/><div class="block-header2">Config</div>';
73if (!file_exists('../kbconfig.php'))
74{
75    $stoppage = true;
76    echo 'Please create the file \'kbconfig.php\' and make it writeable by the webserver.<br/>';
77}
78elseif (is_writeable('../kbconfig.php'))
79{
80    echo 'The config file \'../kbconfig.php\' is there and writeable, excellent!<br/>';
81}
82else
83{
84    $stoppage = true;
85    echo 'I cannot write into ../kbconfig.php, you need to fix that for me before you can continue.<br/>';
86    echo 'Please issue a "chmod 777 ../kbconfig" on the commandline inside of this directory<br/>';
87}
88
89echo '<br/><div class="block-header2">Connectivity</div>';
90// connectivity
91$url = 'http://www.eve-dev.net/logo.png';
92if (ini_get('allow_url_fopen'))
93{
94    echo 'allow_url_fopen is on, I will try to fetch a testpage from "'.$url.'".<br/>';
95    if (count(file($url)))
96    {
97        echo 'Seems to be ok, I got the file.<br/>';
98    }
99    else
100    {
101        echo 'I could not get the file this might be a firewall related issue or the eve-dev server is not available.<br/>';
102    }
103}
104else
105{
106    include('../common/includes/class.http.php');
107    echo 'allow_url_fopen is disabled, nethertheless I will try a socket connect now.<br/>';
108
109    $http = new http_request($url);
110    if ($http->get_content())
111    {
112        echo 'Seems to be ok, I got the file.<br/>';
113    }
114    else
115    {
116        echo 'I could not get the file. This might be a firewall related issue or the eve-dev server is not available.<br/>';
117    }
118}
119
120if (file_exists('../kbconfig.php'))
121{
122        include('../kbconfig.php');
123        if(defined('KB_SITE') && defined('DB_HOST') && defined('DB_USER')
124                && defined('DB_NAME') && defined('DB_PASS'))
125        {
126                $conn = mysql_connect(DB_HOST.':'.DB_PORT, DB_USER, DB_PASS);
127                mysql_select_db(DB_NAME);
128                $res = mysql_query("SELECT * FROM kb3_config WHERE cfg_site = '".KB_SITE."'", $conn);
129                if($res && mysql_num_rows($res))
130                {
131                        echo '<br/><div class="block-header2">EVE Development Killboard Installed</div>';
132                        echo 'EVE Development Killboard is already installed. Proceeding with install may damage the existing installation.<br/>';
133                        echo 'If you do not wish to install then remove the /install directory from your EVE Development Killboard installation to ensure it is not run again.';
134                }
135        }
136}
137
138?>
139
140<?php if ($stoppage)
141{
142    return;
143}?>
144<p><a href="?step=<?php echo ($_SESSION['state']+1); ?>">Next Step</a></p>
Note: See TracBrowser for help on using the browser.