2 //required for normal operation because of recent changes in PHP:
5 //turn off PHP compatibility warnings
6 ini_set("session.bug_compat_warn","off");
10 $defhost = 'localhost';
11 $state = $_POST["state"];
13 //Below section is only for variables that require a path.
14 // The $manualPath variable can be edited by 3rd party
15 // installation scripts to manually set path. (this will
16 // allow straightforward use of this script by 3rd party
19 $dumpfile = $manualPath."sql/database.sql";
20 $icd9 = $manualPath."sql/icd9.sql";
21 $conffile = $manualPath."library/sqlconf.php";
22 $conffile2 = $manualPath."interface/globals.php";
23 $gaclConfigFile1 = $manualPath."gacl/gacl.ini.php";
24 $gaclConfigFile2 = $manualPath."gacl/gacl.class.php";
25 $docsDirectory = $manualPath."documents";
26 $billingDirectory = $manualPath."edi";
27 $gaclWritableDirectory = $manualPath."gacl/admin/templates_c";
28 $requiredDirectory1 = $manualPath."interface/main/calendar/modules/PostCalendar/pntemplates/compiled";
29 $requiredDirectory2 = $manualPath."interface/main/calendar/modules/PostCalendar/pntemplates/cache";
30 $gaclSetupScript1 = $manualPath."gacl/setup.php";
31 $gaclSetupScript2 = $manualPath."acl_setup.php";
33 //These are files and dir checked before install for
34 // existence and correct permissions.
35 $writableFileList = array($conffile, $conffile2, $gaclConfigFile1, $gaclConfigFile2);
36 $writableDirList = array($docsDirectory, $billingDirectory, $gaclWritableDirectory, $requiredDirectory1, $requiredDirectory2);
39 include_once($conffile);
43 <TITLE
>OpenEMR Setup Tool
</TITLE
>
44 <LINK REL
=STYLESHEET HREF
="interface/themes/style_blue.css">
48 <span
class="title">OpenEMR Setup
</span
>
53 if (strtolower(ini_get('register_globals')) != 'off' && (bool) ini_get('register_globals')) {
54 echo "It appears that you have register_globals enabled in your php.ini\n" .
55 "configuration file. This causes unacceptable security risks. You must\n" .
56 "turn it off before continuing with installation.\n";
65 <p
>Congratulations
! OpenEMR is now successfully installed
.
68 <li
>Please restore secure permissions on the four configuration files
: /openemr
/interface/globals
.php
,
69 /openemr
/library
/sqlconf
.php
, /openemr
/gacl
/gacl
.ini
.php
, and /openemr
/gacl
/gacl
.class.php files
.
70 In linux
, recommend changing file permissions with the
'chmod 644 filename' command
.</li
>
71 <li
>In order to take full advantage of the patient documents capability you must make sure
72 your PHP
installation (normally set in your php
.ini file
) has
73 "file_uploads enabled", that
"upload_max_filesize" is appropriate
for your
74 use and that
"upload_tmp_dir" is set to a correct value
if the
default of
"/tmp"
75 won
't work on your system.</li>
76 <li>Access controls (php-GACL) are installed for fine-grained security, and can be administered in
77 OpenEMR's admin
->acl menu
.</li
>
78 <li
>Reading openemr
/includes
/config
.php
and openemr
/interface/globals
.php is a good idea
. These files
79 contain many options to choose from including themes
.</li
>
80 <li
>There
's much information and many extra tools bundled within the OpenEMR installation directory.
81 Please refer to openemr/Documentation. Many forms and other useful scripts can be found at openemr/contrib.</li>
82 <li>To ensure a consistent look and feel through out the application using
83 <a href='http
://www.mozilla.org/products/firefox/'>Firefox</a> is recommended.</li>
85 <p
>The
"openemrwebroot/documents" and "openemrwebroot/edi" contain patient information
, and
86 it is important to secure these directories
. This can be done by placing pertinent
.htaccess
87 files in these directories
or by pasting the below in your apache configuration file
:<br
>
88 <
;Directory
"<?php echo realpath($docsDirectory);?>">
;<br
>
91 <
;/Directory
>
;<br
>
92 <
;Directory
"<?php echo realpath($billingDirectory);?>">
;<br
>
95 <
;/Directory
>
;<br
>
97 <b
>The initial OpenEMR user is
"<?php echo $iuser; ?>" and the password is
"pass".</b
>
98 You should change this password
!
101 <a href
='./'>Click here to start using OpenEMR
. </a
>
111 $server = $_POST["server"];
112 $port = $_POST["port"];
113 $dbname = $_POST["dbname"];
114 $root = $_POST["root"];
115 $login = $_POST["login"];
116 $pass = $_POST["pass"];
117 $loginhost = $_POST["loginhost"];
118 $rootpass = $_POST["rootpass"];
119 $iuser = $_POST["iuser"];
120 $iuname = $_POST["iuname"];
121 $igroup = $_POST["igroup"];
122 $openemrBasePath = $_POST["openemrBasePath"];
123 $openemrWebPath = $_POST["openemrWebPath"];
127 if (($config == 1) && ($state != 4)) {
128 echo "OpenEMR is already configured. If you wish to re-configure the SQL server, edit $conffile, or change the 'config' variable to 0, and re-run this script.<br>\n";
134 echo "<b>Step $state</b><br><br>\n";
135 echo "Now I need to know whether you want me to create the database on my own or if you have already created the database for me to use. For me to create the database, you will need to supply the MySQL root password.\n
136 <span class='title'> <br />NOTE: clicking on \"Continue\" may delete or cause damage to data on your system. Before you continue please backup your data.</span>
138 <FORM METHOD='POST'>\n
139 <INPUT TYPE='HIDDEN' NAME='state' VALUE='2'>\n
140 <INPUT TYPE='RADIO' NAME='inst' VALUE='1' checked>Have setup create the database<br>\n
141 <INPUT TYPE='RADIO' NAME='inst' VALUE='2'>I have already created the database<br>\n
143 <INPUT TYPE='SUBMIT' VALUE='Continue'><br></FORM><br>\n";
147 echo "<b>Step $state</b><br><br>\n";
148 echo "Now you need to supply the MySQL server information and path information.
151 <INPUT TYPE='HIDDEN' NAME='state' VALUE='3'>
152 <INPUT TYPE='HIDDEN' NAME='inst' VALUE='$inst'>
154 <TR VALIGN='TOP'><TD COLSPAN=2><font color='red'>MYSQL SERVER:</font></TD></TR>
155 <TR VALIGN='TOP'><TD><span class='text'>Server Host: </span></TD><TD><INPUT TYPE='TEXT' VALUE='$defhost' NAME='server' SIZE='30'></TD><TD><span class='text'>(This is the IP address of the machine running MySQL. If this is on the same machine as the webserver, leave this as 'localhost'.)</span><br></TD></TR>
156 <TR VALIGN='TOP'><TD><span class='text'>Server Port: </span></TD><TD><INPUT TYPE='TEXT' VALUE='3306' NAME='port' SIZE='30'></TD><TD><span class='text'>(The default port for MySQL is 3306.)</span><br></TD></TR>
157 <TR VALIGN='TOP'><TD><span class='text'>Database Name: </span></TD><TD><INPUT TYPE='TEXT' VALUE='openemr' NAME='dbname' SIZE='30'></TD><TD><span class='text'>(This is the name of the OpenEMR database in MySQL - 'openemr' is the recommended)</span><br></TD></TR>
158 <TR VALIGN='TOP'><TD><span class='text'>Login Name: </span></TD><TD><INPUT TYPE='TEXT' VALUE='openemr' NAME='login' SIZE='30'></TD><TD><span class='text'>(This is the name of the OpenEMR login name in MySQL - 'openemr' is the recommended)</span><br></TD></TR>
159 <TR VALIGN='TOP'><TD><span class='text'>Password: </span></TD><TD><INPUT TYPE='PASSWORD' VALUE='' NAME='pass' SIZE='30'></TD><TD><span class='text'>(This is the Login Password for when PHP accesses MySQL - it should be at least 8 characters long and composed of both numbers and letters)</span><br></TD></TR>\n";
161 echo "<TR VALIGN='TOP'><TD><span class='text'>Name for Root Account: </span></TD><TD><INPUT TYPE='TEXT' VALUE='root' NAME='root' SIZE='30'></TD><TD><span class='text'>(This is name for MySQL root account. For localhost, it is usually ok to leave it 'root'.)</span><br></TD></TR>
162 <TR VALIGN='TOP'><TD><span class='text'>Root Pass: </span></TD><TD><INPUT TYPE='PASSWORD' VALUE='' NAME='rootpass' SIZE='30'></TD><TD><span class='text'>(This is your MySQL root password. For localhost, it is usually ok to leave it blank.)</span><br></TD></TR>\n";
163 echo "<TR VALIGN='TOP'><TD><span class='text'>User Hostname: </span></TD><TD><INPUT TYPE='TEXT' VALUE='$defhost' NAME='loginhost' SIZE='30'></TD><TD><span class='text'>(If you run Apache/PHP and MySQL on the same computer, then leave this as 'localhost'. If they are on separate computers, then enter the IP address of the computer running Apache/PHP.)</span><br></TD></TR>";
165 echo "<TR VALIGN='TOP'><TD> </TD></TR>";
166 echo "<TR VALIGN='TOP'><TD COLSPAN=2><font color='red'>OPENEMR USER:</font></TD></TR>";
167 echo "<TR VALIGN='TOP'><TD><span class='text'>Initial User:</span></TD><TD><INPUT SIZE='30' TYPE='TEXT' NAME='iuser' VALUE='admin'></TD><TD><span class='text'>(This is the login name of user that will be created for you. Limit this to one word.)</span></TD></TR>
168 <TR VALIGN='TOP'><TD><span class='text'>Initial User's Name:</span></TD><TD><INPUT SIZE='30' TYPE='TEXT' NAME='iuname' VALUE='Administrator'></TD><TD><span class='text'>(This is the real name of the 'initial user'.)</span></TD></TR>
169 <TR VALIGN='TOP'><TD><span class='text'>Initial Group:</span></TD><TD><INPUT SIZE='30' TYPE='TEXT' NAME='igroup' VALUE='Default'></TD><TD><span class='text'>(This is the group that will be created for your users. This should be the name of your practice.)</span></TD></TR>
171 echo "<TR VALIGN='TOP'><TD> </TD></TR>";
172 echo "<TR VALIGN='TOP'><TD COLSPAN=2><font color='red'>OPENEMR PATHS:</font></TD></TR>";
173 echo "<TR VALIGN='TOP'><TD COLSPAN=3></TD></TR>
174 <TR VALIGN='TOP'><TD><span class='text'>Absolute Path:</span></TD><TD><INPUT SIZE='30' TYPE='TEXT' NAME='openemrBasePath' VALUE='".realpath('./')."'></TD><TD><span class='text'>(This is the full absolute directory path to openemr. The value here is automatically created, and should not need to be modified. Do not worry about direction of slashes; they will be automatically corrected.)</span></TD></TR>
175 <TR VALIGN='TOP'><TD><span class='text'>Relative HTML Path:</span></TD><TD><INPUT SIZE='30' TYPE='TEXT' NAME='openemrWebPath' VALUE='/openemr'></TD><TD><span class='text'>(Set this to the relative html path, ie. what you would type into the web browser after the server address to get to OpenEMR. For example, if you type 'http://127.0.0.1/clinic/openemr/ to load OpenEMR, set this to '/clinic/openemr' without the trailing slash. Do not worry about direction of slashes; they will be automatically corrected.)</span></TD></TR>
179 <INPUT TYPE='SUBMIT' VALUE='Continue'><br></FORM><br>";
186 if ($login == "" ||
!isset($login)) {
187 echo "ERROR. Please pick a proper 'Login Name'.<br>\n";
188 echo "Click Back in browser to re-enter.<br>\n";
191 if (strpbrk($iuser,' ')) {
192 echo "ERROR. The 'Initial User' field can only contain one word and no spaces.<br>\n";
193 echo "Click Back in browser to re-enter.<br>\n";
196 if ($pass == "" ||
!isset($pass)) {
197 echo "ERROR. Please pick a proper 'Password'.<br>\n";
198 echo "Click Back in browser to re-enter.<br>\n";
202 echo "<b>Step $state</b><br><br>\n";
203 echo "Configuring OpenEMR...<br><br>\n";
207 echo "Connecting to MySQL Server...\n";
209 if ($server == "localhost")
210 $dbh = mysql_connect("$server","$root","$rootpass");
212 $dbh = mysql_connect("$server:$port","$root","$rootpass");
214 echo "ERROR. Check your login credentials.\n";
215 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
220 echo "Creating database...\n";
222 if (mysql_query("create database $dbname",$dbh) == FALSE) {
223 echo "ERROR. Check your login credentials.\n";
224 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
229 echo "Creating user with permissions for database...\n";
231 if (mysql_query("GRANT ALL PRIVILEGES ON $dbname.* TO '$login'@'$loginhost' IDENTIFIED BY '$pass'",$dbh) == FALSE) {
232 echo "ERROR when granting privileges to the specified user.\n";
233 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
239 echo "Reconnecting as new user...\n";
243 echo "Connecting to MySQL Server...\n";
245 if ($server == "localhost")
246 $dbh = mysql_connect("$server","$login","$pass");
248 $dbh = mysql_connect("$server:$port","$login","$pass");
251 echo "ERROR. Check your login credentials.\n";
252 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
257 echo "Opening database...";
259 if (mysql_select_db("$dbname",$dbh) == FALSE) {
260 echo "ERROR. Check your login credentials.\n";
261 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
268 echo "Creating initial tables...\n";
269 mysql_query("USE $dbname",$dbh);
271 $fd = fopen($dumpfile, 'r');
273 echo "ERROR. Could not open dumpfile '$dumpfile'.\n";
280 $line = fgets($fd,1024);
281 $line = rtrim($line);
282 if (substr($line,0,2) == "--") // Kill comments
284 if (substr($line,0,1) == "#") // Kill comments
288 $query = $query.$line; // Check for full query
289 $chr = substr($query,strlen($query)-1,1);
290 if ($chr == ";") { // valid query, execute
291 $query = rtrim($query,";");
292 mysql_query("$query",$dbh);
299 echo "Adding Initial User...\n";
301 //echo "INSERT INTO groups VALUES (1,'$igroup','$iuser')<br>\n";
302 if (mysql_query("INSERT INTO groups (id, name, user) VALUES (1,'$igroup','$iuser')") == FALSE) {
303 echo "ERROR. Could not run queries.\n";
304 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
308 if (mysql_query("INSERT INTO users (id, username, password, authorized, lname,fname) VALUES (1,'$iuser','1a1dc91c907325c69271ddf0c944bc72',1,'$iuname','')") == FALSE) {
309 echo "ERROR. Could not run queries.\n";
310 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
316 /* echo "Inserting ICD-9-CM Codes into Database...\n";
318 $fd = fopen($icd9, 'r');
320 echo "ERROR. Could not open dumpfile.\n";
321 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
328 $line = fgets($fd,1024);
329 $line = rtrim($line);
330 if (substr($line,0,2) == "--") // Kill comments
332 if (substr($line,0,1) == "#") // Kill comments
336 $query = $query.$line; // Check for full query
337 $chr = substr($query,strlen($query)-1,1);
338 if ($chr == ";") { // valid query, execute
339 $query = rtrim($query,";");
340 mysql_query("$query",$dbh);
349 echo "<br>Writing SQL Configuration...<br>";
350 @touch
($conffile); // php bug
351 $fd = @fopen
($conffile, 'w');
355 // Referenced from sql.inc
359 $it_died = 0; //fmg: variable keeps running track of any errors
361 fwrite($fd,$string) or $it_died++
;
362 fwrite($fd,"\$host\t= '$server';\n") or $it_died++
;
363 fwrite($fd,"\$port\t= '$port';\n") or $it_died++
;
364 fwrite($fd,"\$login\t= '$login';\n") or $it_died++
;
365 fwrite($fd,"\$pass\t= '$pass';\n") or $it_died++
;
366 fwrite($fd,"\$dbase\t= '$dbname';\n") or $it_died++
;
372 $sqlconf["host"]= $host;
373 $sqlconf["port"] = $port;
374 $sqlconf["login"] = $login;
375 $sqlconf["pass"] = $pass;
376 $sqlconf["dbase"] = $dbase;
377 //////////////////////////
378 //////////////////////////
379 //////////////////////////
380 //////DO NOT TOUCH THIS///
381 $config = 1; /////////////
382 //////////////////////////
383 //////////////////////////
384 //////////////////////////
387 ?
><?
// done just for coloring
389 fwrite($fd,$string) or $it_died++
;
391 //it's rather irresponsible to not report errors when writing this file.
393 echo "ERROR. Couldn't write $it_died lines to config file '$conffile'.\n";
399 echo "Successfully wrote SQL configuration.<BR><br>";
401 echo "Writing OpenEMR webserver paths to config file...<br>";
402 //edit interface/globals.php
403 //first, ensure slashes are in correct direction (windows specific fix)
404 $openemrBasePath = str_replace('\\\\', '/', $openemrBasePath);
405 $openemrBasePath = str_replace('\\', '/', $openemrBasePath);
406 $openemrWebPath = str_replace('\\\\', '/', $openemrWebPath);
407 $openemrWebPath = str_replace('\\', '/', $openemrWebPath);
409 $data = file($conffile2) or die("Could not read ".$conffile2." file.");
412 foreach ($data as $line) {
414 if ((strpos($line,"\$webserver_root = \"")) === false) {
419 $finalData .= "\$webserver_root = \"$openemrBasePath\";\n";
421 if ((strpos($line,"\$web_root = \"")) === false) {
426 $finalData .= "\$web_root = \"$openemrWebPath\";\n";
432 $fd = @fopen
($conffile2, 'w') or die("Could not open ".$conffile2." file.");
433 fwrite($fd, $finalData);
436 echo "Successfully wrote OpenEMR webserver paths to config file<br><br>";
439 echo "<FONT COLOR='red'>ERROR</FONT> writing openemr webserver root paths to config file ($conffile2). ($isCount)<br><br>\n";
442 echo "\n<br>Next step will install and configure access controls (php-GACL).<br>\n";
445 <FORM METHOD='POST'>\n
446 <INPUT TYPE='HIDDEN' NAME='state' VALUE='4'>
447 <INPUT TYPE='HIDDEN' NAME='host' VALUE='$server'>
448 <INPUT TYPE='HIDDEN' NAME='dbname' VALUE='$dbname'>
449 <INPUT TYPE='HIDDEN' NAME='port' VALUE='$port'>
450 <INPUT TYPE='HIDDEN' NAME='login' VALUE='$login'>
451 <INPUT TYPE='HIDDEN' NAME='pass' VALUE='$pass'>
452 <INPUT TYPE='HIDDEN' NAME='iuser' VALUE='$iuser'>
453 <INPUT TYPE='HIDDEN' NAME='iuname' VALUE='$iuname'>
455 <INPUT TYPE='SUBMIT' VALUE='Continue'><br></FORM><br>\n";
461 echo "<b>Step $state</b><br><br>\n";
462 echo "Installing and Configuring Access Controls (php-GACL)...<br><br>";
464 //first, edit two gacl config files
465 echo "Writing php-GACL configuration settings to config files...<br>";
467 $data = file($gaclConfigFile1) or die("Could not read ".$gaclConfigFile1." file.");
469 foreach ($data as $line) {
471 if ((strpos($line,"db_host")) === false) {
475 $finalData .= "db_host = \"${host}\"\n";
477 if ((strpos($line,"db_user")) === false) {
481 $finalData .= "db_user = \"${login}\"\n";
483 if ((strpos($line,"db_password")) === false) {
487 $finalData .= "db_password = \"${pass}\"\n";
489 if ((strpos($line,"db_name")) === false) {
493 $finalData .= "db_name = \"${dbname}\"\n";
499 $fd = @fopen
($gaclConfigFile1, 'w') or die("Could not open ".$gaclConfigFile1." file.");
500 fwrite($fd, $finalData);
503 // edit gacl.class.php
504 $data = file($gaclConfigFile2) or die("Could not read ".$gaclConfigFile2." file.");
506 foreach ($data as $line) {
508 if ((strpos($line,"var \$_db_host = ")) === false) {
512 $finalData .= "var \$_db_host = '$host';\n";
514 if ((strpos($line,"var \$_db_user = ")) === false) {
518 $finalData .= "var \$_db_user = '$login';\n";
520 if ((strpos($line,"var \$_db_password = ")) === false) {
524 $finalData .= "var \$_db_password = '$pass';\n";
526 if ((strpos($line,"var \$_db_name = ")) === false) {
530 $finalData .= "var \$_db_name = '$dbname';\n";
536 $fd = @fopen
($gaclConfigFile2, 'w') or die("Could not open ".$gaclConfigFile2." file.");
537 fwrite($fd, $finalData);
539 echo "Finished writing php-GACL configuration settings to config files.<br><br>";
541 //second, run gacl config scripts
542 require $gaclSetupScript1;
543 require $gaclSetupScript2;
546 //third, give the administrator user admin priviledges
547 $groupArray = array("Administrators");
548 set_user_aro($groupArray,$iuser,$iuname,"","");
549 echo "Gave the '$iuser' user (password is 'pass') administrator access.<br><br>";
551 echo "Done installing and configuring access controls (php-GACL). Click 'continue' to see further instructions.";
553 echo "<br><FORM METHOD='POST'>\n
554 <INPUT TYPE='HIDDEN' NAME='state' VALUE='5'>\n
555 <INPUT TYPE='HIDDEN' NAME='iuser' VALUE='$iuser'>\n
557 <INPUT TYPE='SUBMIT' VALUE='Continue'><br></FORM><br>\n";
563 echo "Welcome to OpenEMR. This utility will step you through the configuration of OpenEMR for your practice. Before proceeding, be sure that you have a properly installed and configured MySQL server available, and a PHP configured webserver.<br><br>\n";
565 echo "Detailed installation instructions can be found in the <a href='INSTALL' target='_blank'><span STYLE='text-decoration: underline;'>'INSTALL'</span></a> manual file.<br><br>";
567 Echo "If you are upgrading from a previous version, do NOT use this script. Please read the 'Upgrading' section found in the <a href='INSTALL' target='_blank'><span STYLE='text-decoration: underline;'>'INSTALL'</span></a> manual file.<br><br>";
569 echo "We will now ensure correct file permissions and directories before starting installation:<br><br>\n";
570 echo "<FONT COLOR='green'>Ensuring following files are world-writable...</FONT><br>\n";
572 foreach ($writableFileList as $tempFile) {
573 if (is_writable($tempFile)) {
574 echo "'".realpath($tempFile)."' file is <FONT COLOR='green'><b>ready</b></FONT>.<br>";
577 echo "<br><FONT COLOR='red'>UNABLE</FONT> to open file '".realpath($tempFile)."' for writing.<br>";
578 echo "(configure file permissions; see below for further instructions)<br>";
582 if ($errorWritable) {
583 echo "<br><FONT COLOR='red'>You can't proceed until all above files are ready (world-writable).</FONT><br>";
584 echo "In linux, recommend changing file permissions with the 'chmod 666 filename' command.<br>";
585 echo "Fix above file permissions and then click the 'Check Again' button to re-check files.<br>";
586 echo "<FORM METHOD='POST'><INPUT TYPE='SUBMIT' VALUE='Check Again'><br></FORM><br>\n";
590 echo "<br><FONT COLOR='green'>Ensuring following directories exist...</FONT><br>\n";
592 foreach ($writableDirList as $tempDir) {
593 if (file_exists($tempDir)) {
594 echo "'".realpath($tempDir)."' directory <FONT COLOR='green'><b>exists</b></FONT>.<br>";
597 $tempPath = realpath($tempDir);
598 if ($tempPath == "") {
599 //this is a fix specific to microsoft windows
600 $tempPath = realpath('./').DIRECTORY_SEPARATOR
.$tempDir;
601 $tempPath = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR
, $tempPath);
603 echo "<br><FONT COLOR='red'>UNABLE</FONT> to find directory '".$tempPath."'.<br>";
604 echo "(please create directory; see below for further instructions)<br>";
608 if ($errorWritable) {
609 echo "<br><FONT COLOR='red'>You can't proceed until all above directories exist.</FONT><br>";
610 echo "In linux, recommend using the 'mkdir directory_name' command<br>\n";
611 echo "Add above marked directories and then click the 'Check Again' button to re-check for directories.<br>";
612 echo "<FORM METHOD='POST'><INPUT TYPE='SUBMIT' VALUE='Check Again'><br></FORM><br>\n";
616 echo "<br><FONT COLOR='green'>Ensuring following directories have proper permissions...</FONT><br>\n";
618 foreach ($writableDirList as $tempDir) {
619 if (is_writable($tempDir)) {
620 echo "'".realpath($tempDir)."' directory is <FONT COLOR='green'><b>ready</b></FONT>.<br>";
623 echo "<br><FONT COLOR='red'>UNABLE</FONT> to open directory '".realpath($tempDir)."' for writing by web server.<br>";
624 echo "(configure directory permissions; see below for further instructions)<br>";
628 if ($errorWritable) {
629 echo "<br><FONT COLOR='red'>You can't proceed until all directories are ready.</FONT><br>";
630 echo "In linux, recommend changing owners of these directories to the web server. For example, in many linux OS's the web server user is 'apache', 'nobody', or 'www-data'. So if 'apache' were the web server user name, could use the command 'chown -R apache:apache directory_name' command.<br>\n";
631 echo "Fix above directory permissions and then click the 'Check Again' button to re-check directories.<br>";
632 echo "<FORM METHOD='POST'><INPUT TYPE='SUBMIT' VALUE='Check Again'><br></FORM><br>\n";
636 echo "<br>All required files and directories have been verified. Click to continue installation.<br>\n";
637 echo "<FORM METHOD='POST'><INPUT TYPE='HIDDEN' NAME='state' VALUE='1'><INPUT TYPE='SUBMIT' VALUE='Continue'><br></FORM><br>";