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 $state = $_POST["state"];
12 //If having problems with file and directory permission
13 // checking, then can be manually disabled here.
14 $checkPermissions = "TRUE";
16 //Below section is only for variables that require a path.
17 // The $manualPath variable can be edited by 3rd party
18 // installation scripts to manually set path. (this will
19 // allow straightforward use of this script by 3rd party
22 $dumpfile = $manualPath."sql/database.sql";
23 $icd9 = $manualPath."sql/icd9.sql";
24 $conffile = $manualPath."library/sqlconf.php";
25 $conffile2 = $manualPath."interface/globals.php";
26 $gaclConfigFile1 = $manualPath."gacl/gacl.ini.php";
27 $gaclConfigFile2 = $manualPath."gacl/gacl.class.php";
28 $docsDirectory = $manualPath."documents";
29 $billingDirectory = $manualPath."edi";
30 $billingDirectory2 = $manualPath."era";
31 $billingLogDirectory = $manualPath."library/freeb";
32 $lettersDirectory = $manualPath."custom/letter_templates";
33 $gaclWritableDirectory = $manualPath."gacl/admin/templates_c";
34 $requiredDirectory1 = $manualPath."interface/main/calendar/modules/PostCalendar/pntemplates/compiled";
35 $requiredDirectory2 = $manualPath."interface/main/calendar/modules/PostCalendar/pntemplates/cache";
36 $gaclSetupScript1 = $manualPath."gacl/setup.php";
37 $gaclSetupScript2 = $manualPath."acl_setup.php";
39 //These are files and dir checked before install for
40 // correct permissions.
41 $writableFileList = array($conffile, $conffile2, $gaclConfigFile1, $gaclConfigFile2);
42 $writableDirList = array($docsDirectory, $billingDirectory, $billingDirectory2, $billingLogDirectory, $lettersDirectory, $gaclWritableDirectory, $requiredDirectory1, $requiredDirectory2);
45 include_once($conffile);
49 <TITLE
>OpenEMR Setup Tool
</TITLE
>
50 <LINK REL
=STYLESHEET HREF
="interface/themes/style_blue.css">
54 <span
class="title">OpenEMR Setup
</span
>
59 if (strtolower(ini_get('register_globals')) != 'off' && (bool) ini_get('register_globals')) {
60 echo "It appears that you have register_globals enabled in your php.ini\n" .
61 "configuration file. This causes unacceptable security risks. You must\n" .
62 "turn it off before continuing with installation.\n";
71 <p
>Congratulations
! OpenEMR is now installed
.</p
>
74 <li
>If applicable
, please restore secure permissions on the four configuration files
: /openemr
/interface/globals
.php
,
75 /openemr
/library
/sqlconf
.php
, /openemr
/gacl
/gacl
.ini
.php
, and /openemr
/gacl
/gacl
.class.php files
.
76 In linux
, recommend changing file permissions with the
'chmod 644 filename' command
.</li
>
77 <li
>Access
controls (php
-GACL
) are installed
for fine
-grained security
, and can be administered in
78 OpenEMR
's admin->acl menu.</li>
79 <li>Reading openemr/includes/config.php and openemr/interface/globals.php is a good idea. These files
80 contain many options to choose from including themes.</li>
81 <li>There's much information
and many extra tools bundled within the OpenEMR installation directory
.
82 Please refer to openemr
/Documentation
. Many forms
and other useful scripts can be found at openemr
/contrib
.</li
>
83 <li
>To ensure a consistent look
and feel through out the application using
84 <a href
='http://www.mozilla.org/products/firefox/'>Firefox
</a
> is recommended
.</li
>
85 <li
>The OpenEMR project home page
and wiki can be found at
<a href
= "http://www.oemr.org" target
="_blank">http
://www.oemr.org</a></li>
86 <li
>The OpenEMR forums can be found at
<a href
= "http://sourceforge.net/projects/openemr" target
="_blank">http
://sourceforge.net/projects/openemr</a></li>
87 <li
>We pursue grants to help fund the future development of OpenEMR
. To apply
for these grants
, we need to estimate how many times this program is installed
and how many practices are evaluating
or using this software
. It would be awesome
if you would email us at
<a href
="mailto:drbowen@charter.net">drbowen@charter
.net
</a
> if you have installed this software
. The more details about your plans with this software
, the better
, but even just sending us an email stating you just installed it is very helpful
.</li
>
90 We recommend you
print these instructions
for future reference
.
93 <b
>The initial OpenEMR user is
"<?php echo $iuser; ?>" and the password is
"pass".</b
>
94 You should change this password
!
97 If you edited the PHP
or Apache configuration files during this installation process
, then we recommend you restart your Apache server before following below OpenEMR link
.
100 <a href
='./'>Click here to start using OpenEMR
. </a
>
110 $server = $_POST["server"];
111 $port = $_POST["port"];
112 $dbname = $_POST["dbname"];
113 $root = $_POST["root"];
114 $login = $_POST["login"];
115 $pass = $_POST["pass"];
116 $loginhost = $_POST["loginhost"];
117 $rootpass = $_POST["rootpass"];
118 $iuser = $_POST["iuser"];
119 $iuname = $_POST["iuname"];
120 $igroup = $_POST["igroup"];
121 $openemrBasePath = $_POST["openemrBasePath"];
122 $openemrWebPath = $_POST["openemrWebPath"];
126 if (($config == 1) && ($state < 4)) {
127 echo "OpenEMR has already been installed. If you wish to force re-installation, then edit $conffile(change the 'config' variable to 0), and re-run this script.<br>\n";
133 echo "<b>Step $state</b><br><br>\n";
134 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
135 <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>
137 <FORM METHOD='POST'>\n
138 <INPUT TYPE='HIDDEN' NAME='state' VALUE='2'>\n
139 <INPUT TYPE='RADIO' NAME='inst' VALUE='1' checked>Have setup create the database<br>\n
140 <INPUT TYPE='RADIO' NAME='inst' VALUE='2'>I have already created the database<br>\n
142 <INPUT TYPE='SUBMIT' VALUE='Continue'><br></FORM><br>\n";
146 echo "<b>Step $state</b><br><br>\n";
147 echo "Now you need to supply the MySQL server information and path information. Detailed instructions on each item can be found in the <a href='INSTALL' target='_blank'><span STYLE='text-decoration: underline;'>'INSTALL'</span></a> manual file.
150 <INPUT TYPE='HIDDEN' NAME='state' VALUE='3'>
151 <INPUT TYPE='HIDDEN' NAME='inst' VALUE='$inst'>
153 <TR VALIGN='TOP'><TD COLSPAN=2><font color='red'>MYSQL SERVER:</font></TD></TR>
154 <TR VALIGN='TOP'><TD><span class='text'>Server Host: </span></TD><TD><INPUT TYPE='TEXT' VALUE='localhost' NAME='server' SIZE='30'></TD><TD><span class='text'>(If you run MySQL and Apache/PHP on the same computer, then leave this as 'localhost'. If they are on separate computers, then enter the IP address of the computer running MySQL.)</span><br></TD></TR>
155 <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'>(This is the MySQL port. The default port for MySQL is 3306.)</span><br></TD></TR>
156 <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>
157 <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>
158 <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";
160 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>
161 <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";
162 echo "<TR VALIGN='TOP'><TD><span class='text'>User Hostname: </span></TD><TD><INPUT TYPE='TEXT' VALUE='localhost' 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>";
164 echo "<TR VALIGN='TOP'><TD> </TD></TR>";
165 echo "<TR VALIGN='TOP'><TD COLSPAN=2><font color='red'>OPENEMR USER:</font></TD></TR>";
166 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>
167 <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>
168 <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>
170 echo "<TR VALIGN='TOP'><TD> </TD></TR>";
171 echo "<TR VALIGN='TOP'><TD COLSPAN=2><font color='red'>OPENEMR PATHS:</font></TD></TR>";
172 echo "<TR VALIGN='TOP'><TD COLSPAN=3></TD></TR>
173 <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>
174 <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>
178 <INPUT TYPE='SUBMIT' VALUE='Continue'><br></FORM><br>";
185 if ($login == "" ||
!isset($login)) {
186 echo "ERROR. Please pick a proper 'Login Name'.<br>\n";
187 echo "Click Back in browser to re-enter.<br>\n";
190 if (strpos($iuser, " ")) {
191 echo "ERROR. The 'Initial User' field can only contain one word and no spaces.<br>\n";
192 echo "Click Back in browser to re-enter.<br>\n";
195 if ($pass == "" ||
!isset($pass)) {
196 echo "ERROR. Please pick a proper 'Password'.<br>\n";
197 echo "Click Back in browser to re-enter.<br>\n";
201 echo "<b>Step $state</b><br><br>\n";
202 echo "Configuring OpenEMR...<br><br>\n";
206 echo "Connecting to MySQL Server...\n";
208 if ($server == "localhost")
209 $dbh = mysql_connect("$server","$root","$rootpass");
211 $dbh = mysql_connect("$server:$port","$root","$rootpass");
213 echo "ERROR. Check your login credentials.\n";
214 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
219 echo "Creating database...\n";
221 if (mysql_query("create database $dbname",$dbh) == FALSE) {
222 echo "ERROR. Check your login credentials.\n";
223 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
228 echo "Creating user with permissions for database...\n";
230 if (mysql_query("GRANT ALL PRIVILEGES ON $dbname.* TO '$login'@'$loginhost' IDENTIFIED BY '$pass'",$dbh) == FALSE) {
231 echo "ERROR when granting privileges to the specified user.\n";
232 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
238 echo "Reconnecting as new user...\n";
242 echo "Connecting to MySQL Server...\n";
244 if ($server == "localhost")
245 $dbh = mysql_connect("$server","$login","$pass");
247 $dbh = mysql_connect("$server:$port","$login","$pass");
250 echo "ERROR. Check your login credentials.\n";
251 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
256 echo "Opening database...";
258 if (mysql_select_db("$dbname",$dbh) == FALSE) {
259 echo "ERROR. Check your login credentials.\n";
260 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
267 echo "Creating initial tables...\n";
268 mysql_query("USE $dbname",$dbh);
270 $fd = fopen($dumpfile, 'r');
272 echo "ERROR. Could not open dumpfile '$dumpfile'.\n";
279 $line = fgets($fd,1024);
280 $line = rtrim($line);
281 if (substr($line,0,2) == "--") // Kill comments
283 if (substr($line,0,1) == "#") // Kill comments
287 $query = $query.$line; // Check for full query
288 $chr = substr($query,strlen($query)-1,1);
289 if ($chr == ";") { // valid query, execute
290 $query = rtrim($query,";");
291 mysql_query("$query",$dbh);
298 echo "Adding Initial User...\n";
300 //echo "INSERT INTO groups VALUES (1,'$igroup','$iuser')<br>\n";
301 if (mysql_query("INSERT INTO groups (id, name, user) VALUES (1,'$igroup','$iuser')") == FALSE) {
302 echo "ERROR. Could not run queries.\n";
303 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
307 if (mysql_query("INSERT INTO users (id, username, password, authorized, lname,fname) VALUES (1,'$iuser','1a1dc91c907325c69271ddf0c944bc72',1,'$iuname','')") == FALSE) {
308 echo "ERROR. Could not run queries.\n";
309 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
315 /* echo "Inserting ICD-9-CM Codes into Database...\n";
317 $fd = fopen($icd9, 'r');
319 echo "ERROR. Could not open dumpfile.\n";
320 echo "<p>".mysql_error()." (#".mysql_errno().")\n";
327 $line = fgets($fd,1024);
328 $line = rtrim($line);
329 if (substr($line,0,2) == "--") // Kill comments
331 if (substr($line,0,1) == "#") // Kill comments
335 $query = $query.$line; // Check for full query
336 $chr = substr($query,strlen($query)-1,1);
337 if ($chr == ";") { // valid query, execute
338 $query = rtrim($query,";");
339 mysql_query("$query",$dbh);
348 echo "<br>Writing SQL Configuration...<br>";
349 @touch
($conffile); // php bug
350 $fd = @fopen
($conffile, 'w');
354 // Referenced from sql.inc
358 $it_died = 0; //fmg: variable keeps running track of any errors
360 fwrite($fd,$string) or $it_died++
;
361 fwrite($fd,"\$host\t= '$server';\n") or $it_died++
;
362 fwrite($fd,"\$port\t= '$port';\n") or $it_died++
;
363 fwrite($fd,"\$login\t= '$login';\n") or $it_died++
;
364 fwrite($fd,"\$pass\t= '$pass';\n") or $it_died++
;
365 fwrite($fd,"\$dbase\t= '$dbname';\n") or $it_died++
;
371 $sqlconf["host"]= $host;
372 $sqlconf["port"] = $port;
373 $sqlconf["login"] = $login;
374 $sqlconf["pass"] = $pass;
375 $sqlconf["dbase"] = $dbase;
376 //////////////////////////
377 //////////////////////////
378 //////////////////////////
379 //////DO NOT TOUCH THIS///
380 $config = 1; /////////////
381 //////////////////////////
382 //////////////////////////
383 //////////////////////////
386 ?
><?php
// done just for coloring
388 fwrite($fd,$string) or $it_died++
;
390 //it's rather irresponsible to not report errors when writing this file.
392 echo "ERROR. Couldn't write $it_died lines to config file '$conffile'.\n";
398 echo "Successfully wrote SQL configuration.<BR><br>";
400 echo "Writing OpenEMR webserver paths to config file...<br>";
401 //edit interface/globals.php
402 //first, ensure slashes are in correct direction (windows specific fix)
403 $openemrBasePath = str_replace('\\\\', '/', $openemrBasePath);
404 $openemrBasePath = str_replace('\\', '/', $openemrBasePath);
405 $openemrWebPath = str_replace('\\\\', '/', $openemrWebPath);
406 $openemrWebPath = str_replace('\\', '/', $openemrWebPath);
408 $data = file($conffile2) or die("Could not read ".$conffile2." file.");
411 foreach ($data as $line) {
413 if ((strpos($line,"\$webserver_root = \"")) === false) {
418 $finalData .= "\$webserver_root = \"$openemrBasePath\";\n";
420 if ((strpos($line,"\$web_root = \"")) === false) {
425 $finalData .= "\$web_root = \"$openemrWebPath\";\n";
431 $fd = @fopen
($conffile2, 'w') or die("Could not open ".$conffile2." file.");
432 fwrite($fd, $finalData);
435 echo "Successfully wrote OpenEMR webserver paths to config file<br><br>";
438 echo "<FONT COLOR='red'>ERROR</FONT> writing openemr webserver root paths to config file ($conffile2). ($isCount)<br><br>\n";
441 echo "\n<br>Next step will install and configure access controls (php-GACL).<br>\n";
444 <FORM METHOD='POST'>\n
445 <INPUT TYPE='HIDDEN' NAME='state' VALUE='4'>
446 <INPUT TYPE='HIDDEN' NAME='server' VALUE='$server'>
447 <INPUT TYPE='HIDDEN' NAME='dbname' VALUE='$dbname'>
448 <INPUT TYPE='HIDDEN' NAME='port' VALUE='$port'>
449 <INPUT TYPE='HIDDEN' NAME='login' VALUE='$login'>
450 <INPUT TYPE='HIDDEN' NAME='pass' VALUE='$pass'>
451 <INPUT TYPE='HIDDEN' NAME='iuser' VALUE='$iuser'>
452 <INPUT TYPE='HIDDEN' NAME='iuname' VALUE='$iuname'>
454 <INPUT TYPE='SUBMIT' VALUE='Continue'><br></FORM><br>\n";
460 echo "<b>Step $state</b><br><br>\n";
461 echo "Installing and Configuring Access Controls (php-GACL)...<br><br>";
463 //first, edit two gacl config files
464 echo "Writing php-GACL configuration settings to config files...<br>";
466 $data = file($gaclConfigFile1) or die("Could not read ".$gaclConfigFile1." file.");
468 foreach ($data as $line) {
470 if ((strpos($line,"db_host")) === false) {
474 if ($server == "localhost") {
475 $finalData .= "db_host = \"${server}\"\n";
478 $finalData .= "db_host = \"${server}:${port}\"\n";
481 if ((strpos($line,"db_user")) === false) {
485 $finalData .= "db_user = \"${login}\"\n";
487 if ((strpos($line,"db_password")) === false) {
491 $finalData .= "db_password = \"${pass}\"\n";
493 if ((strpos($line,"db_name")) === false) {
497 $finalData .= "db_name = \"${dbname}\"\n";
503 $fd = @fopen
($gaclConfigFile1, 'w') or die("Could not open ".$gaclConfigFile1." file.");
504 fwrite($fd, $finalData);
507 // edit gacl.class.php
508 $data = file($gaclConfigFile2) or die("Could not read ".$gaclConfigFile2." file.");
510 foreach ($data as $line) {
512 if ((strpos($line,"var \$_db_host = ")) === false) {
516 if ($server == "localhost") {
517 $finalData .= "var \$_db_host = '$server';\n";
520 $finalData .= "var \$_db_host = '$server:$port';\n";
523 if ((strpos($line,"var \$_db_user = ")) === false) {
527 $finalData .= "var \$_db_user = '$login';\n";
529 if ((strpos($line,"var \$_db_password = ")) === false) {
533 $finalData .= "var \$_db_password = '$pass';\n";
535 if ((strpos($line,"var \$_db_name = ")) === false) {
539 $finalData .= "var \$_db_name = '$dbname';\n";
545 $fd = @fopen
($gaclConfigFile2, 'w') or die("Could not open ".$gaclConfigFile2." file.");
546 fwrite($fd, $finalData);
548 echo "Finished writing php-GACL configuration settings to config files.<br><br>";
550 //second, run gacl config scripts
551 require $gaclSetupScript1;
552 require $gaclSetupScript2;
555 //third, give the administrator user admin priviledges
556 $groupArray = array("Administrators");
557 set_user_aro($groupArray,$iuser,$iuname,"","");
558 echo "Gave the '$iuser' user (password is 'pass') administrator access.<br><br>";
560 echo "Done installing and configuring access controls (php-GACL).<br>";
561 echo "Next step will configure PHP.";
563 echo "<br><FORM METHOD='POST'>\n
564 <INPUT TYPE='HIDDEN' NAME='state' VALUE='5'>\n
565 <INPUT TYPE='HIDDEN' NAME='iuser' VALUE='$iuser'>\n
567 <INPUT TYPE='SUBMIT' VALUE='Continue'><br></FORM><br>\n";
572 echo "<b>Step $state</b><br><br>\n";
573 echo "Configuration of PHP...<br><br>\n";
574 echo "We recommend making the following changes to your PHP installation, which can normally be done by editing the php.ini configuration file:\n";
577 if (version_compare(PHP_VERSION
, '5.2.4', '>=')) {
578 $phpINIfile = php_ini_loaded_file();
580 echo "<li><font color='green'>Your php.ini file can be found at ".$phpINIfile."</font></li>\n";
584 echo "<li>To ensure proper functioning of OpenEMR you must make sure that settings in php.ini file include \"short_open_tag = On\", \"display_errors = Off\", \"register_globals = Off\", \"magic_quotes_gpc = On\", \"max_execution_time\" set to at least 60, \"max_input_time\" set to at least 90, and \"memory_limit\" set to at least \"128M\".</li>\n";
585 echo "<li>In order to take full advantage of the patient documents capability you must make sure that settings in php.ini file include \"file_uploads = On\", that \"upload_max_filesize\" is appropriate for your use and that \"upload_tmp_dir\" is set to a correct value that will work on your system.</li>\n";
587 echo "<li>If you are having difficulty finding your php.ini file, then refer to the <a href='INSTALL' target='_blank'><span STYLE='text-decoration: underline;'>'INSTALL'</span></a> manual for suggestions.</li>\n";
591 echo "<br>We recommend you print these instructions for future reference.<br><br>";
592 echo "Next step will configure Apache web server.";
594 echo "<br><FORM METHOD='POST'>\n
595 <INPUT TYPE='HIDDEN' NAME='state' VALUE='6'>\n
596 <INPUT TYPE='HIDDEN' NAME='iuser' VALUE='$iuser'>\n
598 <INPUT TYPE='SUBMIT' VALUE='Continue'><br></FORM><br>\n";
603 echo "<b>Step $state</b><br><br>\n";
604 echo "Configuration of Apache web server...<br><br>\n";
605 echo "The \"".realpath($docsDirectory)."\", \"".realpath($billingDirectory)."\" and \"".realpath($billingDirectory2)."\" directories contain patient information, and
606 it is important to secure these directories. This can be done by placing pertinent .htaccess
607 files in these directories or by pasting the below to end of your apache configuration file:<br>
608 <Directory ".realpath($docsDirectory)."><br>
609 order deny,allow<br>
610 Deny from all<br>
611 </Directory><br>
612 <Directory ".realpath($billingDirectory)."><br>
613 order deny,allow<br>
614 Deny from all<br>
615 </Directory><br>
616 <Directory ".realpath($billingDirectory2)."><br>
617 order deny,allow<br>
618 Deny from all<br>
619 </Directory><br><br>";
621 echo "If you are having difficulty finding your apache configuration file, then refer to the <a href='INSTALL' target='_blank'><span STYLE='text-decoration: underline;'>'INSTALL'</span></a> manual for suggestions.<br><br>\n";
622 echo "<br>We recommend you print these instructions for future reference.<br><br>";
623 echo "Click 'continue' for further instructions.";
625 echo "<br><FORM METHOD='POST'>\n
626 <INPUT TYPE='HIDDEN' NAME='state' VALUE='7'>\n
627 <INPUT TYPE='HIDDEN' NAME='iuser' VALUE='$iuser'>\n
629 <INPUT TYPE='SUBMIT' VALUE='Continue'><br></FORM><br>\n";
635 echo "<p>Welcome to OpenEMR. This utility will step you through the installation and configuration of OpenEMR for your practice.</p>\n";
636 echo "<ul><li>Before proceeding, be sure that you have a properly installed and configured MySQL server available, and a PHP configured webserver.</li>\n";
638 echo "<li>Detailed installation instructions can be found in the <a href='INSTALL' target='_blank'><span STYLE='text-decoration: underline;'>'INSTALL'</span></a> manual file.</li>\n";
640 Echo "<li>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.</li></ul>";
642 if ($checkPermissions == "TRUE") {
643 echo "<p>We will now ensure correct file and directory permissions before starting installation:</p>\n";
644 echo "<FONT COLOR='green'>Ensuring following files are world-writable...</FONT><br>\n";
646 foreach ($writableFileList as $tempFile) {
647 if (is_writable($tempFile)) {
648 echo "'".realpath($tempFile)."' file is <FONT COLOR='green'><b>ready</b></FONT>.<br>\n";
651 echo "<p><FONT COLOR='red'>UNABLE</FONT> to open file '".realpath($tempFile)."' for writing.<br>\n";
652 echo "(configure file permissions; see below for further instructions)</p>\n";
656 if ($errorWritable) {
657 echo "<p><FONT COLOR='red'>You can't proceed until all above files are ready (world-writable).</FONT><br>\n";
658 echo "In linux, recommend changing file permissions with the 'chmod 666 filename' command.<br>\n";
659 echo "Fix above file permissions and then click the 'Check Again' button to re-check files.<br>\n";
660 echo "<FORM METHOD='POST'><INPUT TYPE='SUBMIT' VALUE='Check Again'></p></FORM><br>\n";
664 echo "<br><FONT COLOR='green'>Ensuring following directories have proper permissions...</FONT><br>\n";
666 foreach ($writableDirList as $tempDir) {
667 if (is_writable($tempDir)) {
668 echo "'".realpath($tempDir)."' directory is <FONT COLOR='green'><b>ready</b></FONT>.<br>\n";
671 echo "<p><FONT COLOR='red'>UNABLE</FONT> to open directory '".realpath($tempDir)."' for writing by web server.<br>\n";
672 echo "(configure directory permissions; see below for further instructions)</p>\n";
676 if ($errorWritable) {
677 echo "<p><FONT COLOR='red'>You can't proceed until all directories are ready.</FONT><br>\n";
678 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";
679 echo "Fix above directory permissions and then click the 'Check Again' button to re-check directories.<br>\n";
680 echo "<FORM METHOD='POST'><INPUT TYPE='SUBMIT' VALUE='Check Again'></p></FORM><br>\n";
684 echo "<br>All required files and directories have been verified. Click to continue installation.<br>\n";
687 echo "<br>Click to continue installation.<br>\n";
690 echo "<FORM METHOD='POST'><INPUT TYPE='HIDDEN' NAME='state' VALUE='1'><INPUT TYPE='SUBMIT' VALUE='Continue'><br></FORM><br>";