7 * @link https://www.open-emr.org
8 * @author Roberto Vasquez <robertogagliotta@gmail.com>
9 * @author Scott Wakefield <scott@npclinics.com.au>
10 * @author Ranganath Pathak <pathak@scrs1.org>
11 * @copyright Copyright (c) 2016 Roberto Vasquez <robertogagliotta@gmail.com>
12 * @copyright Copyright (c) 2016 Scott Wakefield <scott@npclinics.com.au>
13 * @copyright Copyright (c) 2019 Ranganath Pathak <pathak@scrs1.org>
14 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
16 // Set the maximum excution time and time limit to unlimited.
17 ini_set('max_execution_time', 0);
20 // Warning. If you set $allow_multisite_setup to true, this is a potential security vulnerability.
21 // Recommend setting it back to false (or removing this setup.php script entirely) after you
22 // are done with the multisite procedure.
23 $allow_multisite_setup = false;
25 // Warning. If you set $allow_cloning_setup to true, this is a potential security vulnerability.
26 // Recommend setting it back to false (or removing this setup.php script entirely) after you
27 // are done with the cloning setup procedure.
28 $allow_cloning_setup = false;
29 if (!$allow_cloning_setup && !empty($_REQUEST['clone_database'])) {
30 die("To turn on support for cloning setup, need to edit this script and change \$allow_cloning_setup to true. After you are done setting up the cloning, ensure you change \$allow_cloning_setup back to false or remove this script altogether");
33 // Checks if the server's PHP version is compatible with OpenEMR:
34 require_once(dirname(__FILE__
) . "/common/compatibility/Checker.php");
36 use OpenEMR\Common\Checker
;
38 $response = Checker
::checkPhpVersion();
39 if ($response !== true) {
43 $COMMAND_LINE = php_sapi_name() == 'cli';
44 require_once(dirname(__FILE__
) . '/library/authentication/password_hashing.php');
45 require_once dirname(__FILE__
) . '/library/classes/Installer.class.php';
47 $state = isset($_POST["state"]) ?
($_POST["state"]) : '';
48 $installer = new Installer($_REQUEST);
49 // Make this true for IPPF.
50 $ippf_specific = false;
52 $error_page_end = <<<EPE
55 </div><!--end of container div-->
60 // If this script was invoked with no site ID, then ask for one.
61 if (!$COMMAND_LINE && empty($_REQUEST['site'])) {
66 <title>OpenEMR Setup Tool</title>
67 <!--<link rel=stylesheet href="interface/themes/style_blue.css">-->
68 <link rel="stylesheet" href="public/assets/bootstrap/dist/css/bootstrap.min.css" type="text/css">
69 <link rel="stylesheet" href="public/assets/jquery-ui/jquery-ui.css" type="text/css">
70 <script type="text/javascript" src="public/assets/jquery/dist/jquery.min.js"></script>
71 <script type="text/javascript" src="public/assets/bootstrap/dist/js/bootstrap.min.js"></script>
72 <link rel="stylesheet" href="public/assets/font-awesome/css/font-awesome.min.css" type="text/css">
73 <link rel="shortcut icon" href="public/images/favicon.ico" />
74 <script type="text/javascript" src="public/assets/jquery-ui/jquery-ui.js"></script>
82 <div class = 'container'>
85 <div class="col-sm-12">
86 <div class="page-header">
87 <h2>OpenEMR Setup <a class="oe-pull-away oe-help-redirect" data-target="#myModal" data-toggle="modal" href="#" id="help-href" name="help-href" style="color:#676666" title="Click to view Help"><i class="fa fa-question-circle" aria-hidden="true"></i></a></h2>
93 <div class="col-sm-12">
95 <legend>Optional Site ID Selection</legend>
96 <p>Most OpenEMR installations support only one site. If that is
97 true for you then ignore the rest of this text and just click Continue.</p>
98 <p class='bg-warning'>If you are using the multisite setup module for the first time please read the
99 'Multi Site Installation' section of the help file before proceeding.</p>
100 <p>Otherwise please enter a unique Site ID here.</p>
101 <p>A Site ID is a short identifier with no spaces or special
102 characters other than periods or dashes. It is case-sensitive and we
103 suggest sticking to lower case letters for ease of use.</p>
104 <p>If each site will have its own host/domain name, then use that
105 name as the Site ID (e.g. www.example.com).</p>
106 <p>The site ID is used to identify which site you will log in to.
107 If it is a hostname then it is taken from the hostname in the URL.
108 Otherwise you must append "?site=<i>siteid</i>" to the URL used for
110 <p>It is OK for one of the sites to have "default" as its ID. This
111 is the ID that will be used if it cannot otherwise be determined.</p>
114 <input type='hidden' name='state' value='0'>
115 Site ID: <input type='text' name='site' value='default'>
116 <button type='submit' value='Continue'>Continue</button>
121 </div><!--end of container div-->
123 echo $site_id . "\r\n";
124 $installer->setupHelpModal();
125 echo "</body>". "\r\n";
126 echo "</html>". "\r\n";
131 // Support "?site=siteid" in the URL, otherwise assume "default".
132 $site_id = 'default';
133 if (!$COMMAND_LINE && !empty($_REQUEST['site'])) {
134 $site_id = trim($_REQUEST['site']);
137 // Die if site ID is empty or has invalid characters.
138 if (empty($site_id) ||
preg_match('/[^A-Za-z0-9\\-.]/', $site_id)) {
139 die("Site ID '".htmlspecialchars($site_id, ENT_NOQUOTES
)."' contains invalid characters.");
142 // If multisite is turned off, then only allow default for site.
143 if (!$allow_multisite_setup && $site_id != 'default') {
144 die("To turn on support for multisite setup, need to edit this script and change \$allow_multisite_setup to true. After you are done setting up the cloning, ensure you change \$allow_multisite_setup back to false or remove this script altogether");
147 //If having problems with file and directory permission
148 // checking, then can be manually disabled here.
149 $checkPermissions = true;
151 global $OE_SITE_DIR; // The Installer sets this
153 $docsDirectory = "$OE_SITE_DIR/documents";
154 $billingDirectory = "$OE_SITE_DIR/edi";
155 $billingDirectory2 = "$OE_SITE_DIR/era";
156 $lettersDirectory = "$OE_SITE_DIR/letter_templates";
157 $gaclWritableDirectory = dirname(__FILE__
)."/gacl/admin/templates_c";
158 $requiredDirectory1 = dirname(__FILE__
)."/interface/main/calendar/modules/PostCalendar/pntemplates/compiled";
159 $requiredDirectory2 = dirname(__FILE__
)."/interface/main/calendar/modules/PostCalendar/pntemplates/cache";
161 $zendModuleConfigFile = dirname(__FILE__
)."/interface/modules/zend_modules/config/application.config.php";
163 //These are files and dir checked before install for
164 // correct permissions.
165 if (is_dir($OE_SITE_DIR)) {
166 $writableFileList = array($installer->conffile
,$zendModuleConfigFile);
167 $writableDirList = array($docsDirectory, $billingDirectory, $billingDirectory2, $lettersDirectory, $gaclWritableDirectory, $requiredDirectory1, $requiredDirectory2);
169 $writableFileList = array();
170 $writableDirList = array($OE_SITES_BASE, $gaclWritableDirectory, $requiredDirectory1, $requiredDirectory2);
173 // Include the sqlconf file if it exists yet.
175 if (file_exists($OE_SITE_DIR)) {
176 include_once($installer->conffile
);
177 } elseif ($state > 3) {
178 // State 3 should have created the site directory if it is missing.
179 die("Internal error, site directory is missing.");
184 <title
>OpenEMR Setup Tool
</title
>
185 <!--<link rel
=stylesheet href
="interface/themes/style_blue.css">-->
186 <link rel
="stylesheet" href
="public/assets/bootstrap/dist/css/bootstrap.min.css" type
="text/css">
187 <link rel
="stylesheet" href
="public/assets/jquery-ui/jquery-ui.css" type
="text/css">
188 <script type
="text/javascript" src
="public/assets/jquery/dist/jquery.min.js"></script
>
189 <script type
="text/javascript" src
="public/assets/bootstrap/dist/js/bootstrap.min.js"></script
>
190 <script type
="text/javascript" src
="public/assets/jquery-ui/jquery-ui.js"></script
>
191 <link rel
="stylesheet" href
="public/assets/font-awesome/css/font-awesome.min.css" type
="text/css">
192 <link rel
="shortcut icon" href
="public/images/favicon.ico" />
197 border
-collapse
:collapse
;
199 table
.phpset td
, table
.phpset th
{
201 border
:1px solid gray
;
204 .table
.no
-border tr td
, .table
.no
-border tr th
{
216 font
-family
:sans
-serif
;
224 .label
-div
:hover
> a
{
225 display
:inline
-block
;
230 margin
: 10px
15px
0px
15px
;
232 div
[id$
="_info"] > a
{
236 display
: inline
-block
;
239 .checkboxgroup label
{
252 font
-size
: 70%
!important
;
255 background
-color
: WHITESMOKE
;
267 fieldset
> [class*="col-"] {
269 text
-align
:left
!Important
;
273 <script language
="javascript">
274 // onclick handler for "clone database" checkbox
275 function cloneClicked() {
276 var cb
= document
.forms
[0].clone_database
;
277 $
('.noclone').css('display', cb
.checked ?
'none' : 'block');
283 <div
class = 'container'>
285 <div
class="col-sm-12">
286 <div
class="page-header">
287 <h2
>OpenEMR Setup
<a
class="oe-pull-away oe-help-redirect" data
-target
="#myModal" data
-toggle
="modal" href
="#" id
="help-href" name
="help-href" style
="color:#676666" title
="Click to view Help"><i
class="fa fa-question-circle" aria
-hidden
="true"></i
></a
></h2
>
292 <div
class="col-sm-12">
294 $error = "<span class='text-danger'><b>ERROR</b></span>";
295 $caution = "<span class='text-danger'><b>CAUTION</b></span>";
296 $ok = "<span class='text-success'><b>OK</b></span>";
297 $note = "<span class='text-primary'><b>NOTE</b></span>";
299 if (strtolower(ini_get('register_globals')) != 'off' && (bool) ini_get('register_globals')) {
300 echo "$caution: It appears that you have register_globals enabled in your php.ini\n" .
301 "configuration file. This causes unacceptable security risks. You must\n" .
302 "turn it off before continuing with installation.\n";
306 if (!extension_loaded("xml")) {
307 echo "$error: PHP XML extension missing. To continue, install PHP XML extension, then restart web server.";
311 if (!(extension_loaded("mysql") ||
extension_loaded("mysqlnd") ||
extension_loaded("mysqli"))) {
312 echo "$error: PHP MySQL extension missing. To continue, install and enable MySQL extension, then restart web server.";
316 if (!(extension_loaded("mbstring") )) {
317 echo "$error: PHP mb_string extension missing. To continue, install and enable mb_string extension, then restart web server.";
321 if (!(extension_loaded("openssl") )) {
322 echo "$error: PHP openssl extension missing. To continue, install PHP openssl extension, then restart web server.";
332 <legend
>Final step
- Success
</legend
>
333 <p
>Congratulations
! OpenEMR is now installed
.</p
>
336 <li
>Access
controls (php
-GACL
) are installed
for fine
-grained security
, and can be administered in
337 OpenEMR
's admin->acl menu.</li>
338 <li>Reviewing <?php echo $OE_SITE_DIR; ?>/config.php is a good idea. This file
339 contains some settings that you may want to change.</li>
340 <li>There's much information
and many extra tools bundled within the OpenEMR installation directory
.
341 Please refer to openemr
/Documentation
. Many forms
and other useful scripts can be found at openemr
/contrib
.</li
>
342 <li
>To ensure a consistent look
and feel throughout the application
,
343 <a href
='http://www.mozilla.org/products/firefox/'>Firefox
</a
> and <a href
="https://www.google.com/chrome/browser/desktop/index.html">Chrome
</a
> are recommended
. The OpenEMR development team exclusively tests with modern versions of these browsers
.</li
>
344 <li
>The OpenEMR project home page
, documentation
, and forums can be found at
<a href
= "https://www.open-emr.org" rel
='noopener' target
="_blank">https
://www.open-emr.org</a></li>
345 <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:president@oemr.org">president@oemr
.org
</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
>
347 <p
>We recommend you
print these instructions
for future reference
.</p
>
349 echo "<p> The selected theme is :</p>";
350 $installer->displayNewThemeDiv();
351 if (empty($installer->clone_database
)) {
352 echo "<p><b>The initial OpenEMR user is <span class='text-primary'>'".$installer->iuser
."'</span> and the password is <span class='text-primary'>'".$installer->iuserpass
."'</span></b></p>";
354 echo "<p>The initial OpenEMR user name and password is the same as that of source site <b>'". $installer->source_site_id
."'</span></b></p>";
356 echo "<p>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.</p>";
357 echo "<p>In Linux use the following command:</p>";
358 echo "<p><code>sudo apachectl -k restart</code></p>";
362 <a href
='./?site=<?php echo $site_id; ?>'>Click here to start using OpenEMR
. </a
>
366 $installer->setCurrentTheme();
371 </div><!--end of container div-->
373 echo $end_div . "\r\n";
374 $installer->setupHelpModal();
375 echo "</body>". "\r\n";
376 echo "</html>". "\r\n";
384 $inst = isset($_POST["inst"]) ?
($_POST["inst"]) : '';
386 if (($config == 1) && ($state < 4)) {
387 echo "OpenEMR has already been installed. If you wish to force re-installation, then edit $installer->conffile (change the 'config' variable to 0), and re-run this script.<br>\n";
393 <legend>Step $state - Select Database Setup</legend>
394 <p>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.
396 <p class='bg-danger'>$caution: clicking on <b>Proceed to Step 2</b> may delete or cause damage to existing data on your system. Before you continue <b>please backup your data</b>.
399 <input name='state' type='hidden' value='2'>
400 <input name='site' type='hidden' value='$site_id'>
402 <input checked id='inst1' name='inst' type='radio' value='1'>Have setup create the database
405 <input id='inst2' name='inst' type='radio' value='2'>I have already created the database
408 <button type='submit' value='Continue'><b>Proceed to Step 2</b></button>
416 $step2top = <<<STP2TOP
418 <legend>Step $state - Database and OpenEMR Initial User Setup Details</legend>
419 <p>Now you need to supply the MySQL server information and path information. Detailed instructions on each item can be found in the <a href='Documentation/INSTALL' rel='noopener' target='_blank'><span STYLE='text-decoration: underline;'>'INSTALL'</span></a> manual file.
421 <form method='post' id='myform'>
422 <input name='state' type='hidden' value='3'>
423 <input name='site' type='hidden' value='$site_id'>
424 <input name='inst' type='hidden' value='$inst'>
426 echo $step2top ."\r\n";
429 $step2tabletop1 = <<<STP2TBLTOP1
431 <legend name="form_legend" id="form_legend" class='oe-setup-legend'>MySQL Server Details<i id="enter-details-tooltip" class="fa fa-info-circle oe-text-black oe-superscript enter-details-tooltip" aria-hidden="true"></i></legend>
433 <div class="col-xs-12 ">
434 <div class="col-sm-4">
435 <div class="clearfix form-group">
436 <div class="label-div">
437 <label class="control-label" for="server">Server Host:</label> <a href="#server_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
440 <input name='server' id='server' type='text' class='form-control' value='localhost'>
444 <div id="server_info" class="collapse">
445 <a href="#server_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
446 <p>If you run MySQL and Apache/PHP on the same computer, then leave this as 'localhost'.
447 <p>If they are on separate computers, then enter the IP address of the computer running MySQL.
451 <div class="col-sm-4">
452 <div class="clearfix form-group">
453 <div class="label-div">
454 <label class="control-label" for="port">Server Port:</label> <a href="#port_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
457 <input name='port' id='port' type='text' class='form-control' value='3306'>
460 <div id="port_info" class="collapse">
461 <a href="#port_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
462 <p>This is the MySQL port.
463 <p>The default port for MySQL is 3306.
466 <div class="col-sm-4">
467 <div class="clearfix form-group">
468 <div class="col-sm-12 label-div">
469 <label class="control-label" for="dbname">Database Name:</label> <a href="#dbname_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
471 <div class="col-sm-12">
472 <input name='dbname' id='dbname' type='text' class='form-control' value='openemr'>
475 <div id="dbname_info" class="collapse">
476 <a href="#dbname_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
477 <p>This will be the name of the OpenEMR database in MySQL.
478 <p>'openemr' is the recommended name.
479 <p>This database will contain patient data as well as data pertaining to the OpenEMR installation.
485 <div class="col-xs-12 ">
486 <div class="col-sm-4">
487 <div class="clearfix form-group">
488 <div class="label-div">
489 <label class="control-label" for="login">Login Name:</label> <a href="#login_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
492 <input name='login' ID='login' type='text' class='form-control' value='openemr'>
496 <div id="login_info" class="collapse">
497 <a href="#login_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
498 <p>This is the name that OpenEMR will use to login to the MySQL database.
499 <p>'openemr' is the recommended name.
502 <div class="col-sm-4">
503 <div class="clearfix form-group">
504 <div class="label-div">
505 <label class="control-label" for="pass">Password:</label> <a href="#pass_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
508 <input name='pass' id='pass' class='form-control' type='password' value='' minlength='12' required>
511 <div id="pass_info" class="collapse">
512 <a href="#pass_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
513 <p>This is the Login Password that OpemEMR will use to accesses the MySQL database.
514 <p>It should be at least 12 characters long and composed of both numbers and letters.
518 echo $step2tabletop1 ."\r\n";
520 $step2tabletop2 = <<<STP2TBLTOP2
521 <div class="col-sm-4">
522 <div class="clearfix form-group">
523 <div class="col-sm-12 label-div">
524 <label class="control-label" for="root">Name for Root Account:</label> <a href="#root_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
526 <div class="col-sm-12">
527 <input name='root' id='root'type='text' class='form-control' value='root'>
530 <div id="root_info" class="collapse">
531 <a href="#root_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
532 <p>This is name for the MySQL root account.
533 <p>For localhost, it is usually ok to leave it as 'root'.
539 <div class="col-xs-12 ">
540 <div class="col-sm-4">
541 <div class="clearfix form-group">
542 <div class="label-div">
543 <label class="control-label" for="rootpass">Root Password:</label> <a href="#rootpass_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
546 <input name='rootpass' id='rootpass' type='password' class='form-control' value=''>
550 <div id="rootpass_info" class="collapse">
551 <a href="#rootpass_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
552 <p>This is your MySQL server root password.
553 <p>For localhost, it is usually ok to leave it blank.
556 <div class="col-sm-4">
557 <div class="clearfix form-group">
558 <div class="label-div">
559 <label class="control-label" for="loginhost">User Hostname:</label> <a href="#loginhost_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
562 <input name='loginhost' id='loginhost' type='text' class='form-control' value='localhost'>
565 <div id="loginhost_info" class="collapse">
566 <a href="#loginhost_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
567 <p>If you run Apache/PHP and MySQL on the same computer, then leave this as 'localhost'.
568 <p>If they are on separate computers, then enter the IP address of the computer running Apache/PHP.
571 <div class="col-sm-4">
572 <div class="clearfix form-group">
573 <div class="col-sm-12 label-div">
574 <label class="control-label" for="collate">UTF-8 Collation:</label> <a href="#collate_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
576 <div class="col-sm-12">
577 <select name='collate' id=='collate' class='form-control'>
578 <option value='utf8_bin'>
581 <option value='utf8_czech_ci'>
584 <option value='utf8_danish_ci'>
587 <option value='utf8_esperanto_ci'>
590 <option value='utf8_estonian_ci'>
593 <option selected value='utf8_general_ci'>
596 <option value='utf8_hungarian_ci'>
599 <option value='utf8_icelandic_ci'>
602 <option value='utf8_latvian_ci'>
605 <option value='utf8_lithuanian_ci'>
608 <option value='utf8_persian_ci'>
611 <option value='utf8_polish_ci'>
614 <option value='utf8_roman_ci'>
617 <option value='utf8_romanian_ci'>
620 <option value='utf8_slovak_ci'>
623 <option value='utf8_slovenian_ci'>
626 <option value='utf8_spanish2_ci'>
627 Spanish2 (Traditional)
629 <option value='utf8_spanish_ci'>
632 <option value='utf8_swedish_ci'>
635 <option value='utf8_turkish_ci'>
638 <option value='utf8_unicode_ci'>
639 Unicode (German, French, Russian, Armenian, Greek)
642 None (Do not force UTF-8)
647 <div id="collate_info" class="collapse">
648 <a href="#collate_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
649 <p>This is the collation setting for MySQL.
650 <p>Collation refers to a set of rules that determine how data is sorted and compared in a database.
651 <p>Leave as 'General' if you are not sure.
652 <p>If the language you are planning to use in OpenEMR is in the menu, then you can select it.
653 <p>Otherwise, just select 'General'.
659 echo $step2tabletop2 ."\r\n";
661 // Include a "source" site ID drop-list and a checkbox to indicate
662 // if cloning its database. When checked, do not display initial user
663 // and group stuff below.
664 $dh = opendir($OE_SITES_BASE);
666 die("Cannot read directory '$OE_SITES_BASE'.");
669 $siteslist = array();
670 while (false !== ($sfname = readdir($dh))) {
671 if (substr($sfname, 0, 1) == '.') {
675 if ($sfname == 'CVS') {
679 if ($sfname == $site_id) {
683 $sitedir = "$OE_SITES_BASE/$sfname";
684 if (!is_dir($sitedir)) {
688 if (!is_file("$sitedir/sqlconf.php")) {
692 $siteslist[$sfname] = $sfname;
696 // If this is not the first site...
697 if (!empty($siteslist)) {
699 $source_site_top = <<<SOURCESITETOP
701 <div class="col-xs-12 ">
702 <div class="col-sm-4">
703 <div class="clearfix form-group">
704 <div class="label-div">
705 <label class="control-label" for="source_site_id">Source Site:</label> <a href="#source_site_id_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
708 <select name='source_site_id'id='source_site_id' class='form-control'>
710 echo $source_site_top . "\r\n";
711 foreach ($siteslist as $sfname) {
712 echo "<option value='$sfname'";
713 if ($sfname == 'default') {
717 echo ">$sfname</option>";
719 $source_site_bot = <<<SOURCESITEBOT
724 <div id="source_site_id_info" class="collapse">
725 <a href="#source_site_id_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
726 <p>The site directory that will be a model for the new site.
729 <div class="col-sm-4">
730 <div class="clearfix form-group">
731 <div class="label-div">
732 <label class="control-label" for="clone_database">Clone Source Database:</label> <a href="#clone_database_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
735 <input type='checkbox' name='clone_database' id='clone_database' onclick='cloneClicked()' />
738 <div id="clone_database_info" class="collapse">
739 <a href="#clone_database_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
740 <p>Clone the source site's database instead of creating a fresh one.
746 echo $source_site_bot ."\r\n";
748 $randomusername = chr(rand(65, 90)) . chr(rand(65, 90)) . chr(rand(65, 90)) . "-admin-" . rand(0, 9) . rand(0, 9);
749 $step2tablebot = <<<STP2TBLBOT
752 <fieldset class='noclone'>
753 <legend name="form_legend" id="form_legend" class='oe-setup-legend'>OpenEMR Initial User Details<i id="enter-details-tooltip" class="fa fa-info-circle oe-text-black oe-superscript enter-details-tooltip" aria-hidden="true"></i></legend>
755 <div class="col-xs-12 ">
756 <div class="col-sm-4">
757 <div class="clearfix form-group">
758 <div class="label-div">
759 <label class="control-label" for="iuser">Initial User Login Name:</label> <a href="#iuser_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
762 <input name='iuser' id='iuser' type='text' class='form-control' value='$randomusername' minlength='12'>
766 <div id="iuser_info" class="collapse">
767 <a href="#iuser_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
768 <p>This is the login name of the first user that will be created for you.
769 <p>Limit this to one word with at least 12 characters and composed of both numbers and letters.
773 <div class="col-sm-4">
774 <div class="clearfix form-group">
775 <div class="label-div">
776 <label class="control-label" for="iuserpass">Initial User Password:</label> <a href="#iuserpass_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
779 <input name='iuserpass' id='iuserpass' type='password' class='form-control' value='' minlength='12'>
782 <div id="iuserpass_info" class="collapse">
783 <a href="#iuserpass_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
784 <p>This is the password for the initial user.
787 <div class="col-sm-4">
788 <div class="clearfix form-group">
789 <div class="col-sm-12 label-div">
790 <label class="control-label" for="iufname">Initial User's First Name:</label> <a href="#iufname_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
792 <div class="col-sm-12">
793 <input name='iufname' id='iufname 'type='text' class='form-control' value='Administrator'>
796 <div id="iufname_info" class="collapse">
797 <a href="#iufname_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
798 <p>This is the First name of the 'initial user'.
804 <div class="col-xs-12 ">
805 <div class="col-sm-4">
806 <div class="clearfix form-group">
807 <div class="label-div">
808 <label class="control-label" for="iuname">Initial User's Last Name:</label> <a href="#iuname_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
811 <input name='iuname' id='iuname' type='text' class='form-control' value='Administrator'>
815 <div id="iuname_info" class="collapse">
816 <a href="#iuname_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
817 <p>This is the Last name of the 'initial user'.
820 <div class="col-sm-4">
821 <div class="clearfix form-group">
822 <div class="label-div">
823 <label class="control-label" for="igroup">Initial Group:</label> <a href="#igroup_info" class="info-anchor icon-tooltip" data-toggle="collapse" ><i class="fa fa-question-circle" aria-hidden="true"></i></a>
826 <input name='igroup' id='igroup' class='form-control' type='text' value='Default'>
829 <div id="igroup_info" class="collapse">
830 <a href="#igroup_info" data-toggle="collapse" class="oe-pull-away"><i class="fa fa-times oe-help-x" aria-hidden="true"></i></a>
831 <p>This is the group that will be created for your users.
832 <p>This should be the name of your practice.
838 <p class='bg-warning'>Click the <b>Create DB and User</b> button to create the database and first user. $note: This process will take a few minutes.</p>
839 <!--<p class='bg-success'>Upon successful completion will automatically take you to the next step.</p>-->
840 <p class='bg-success oe-spinner' style = 'visibility:hidden;'>Upon successful completion will automatically take you to the next step.<i class='fa fa-spinner fa-pulse fa-fw'></i></p>
841 <button type='submit' id='create_db_button' value='Continue' class='wait'><b>Create DB and User</b></button>
845 echo $step2tablebot ."\r\n";
850 // (applicable if not cloning from another database)
852 $pass_step2_validation = true;
853 $error_step2_message = "$error - ";
855 if (! $installer->char_is_valid($_REQUEST['server'])) {
856 $pass_step2_validation = false;
857 $error_step2_message .= "A database server host is required <br>\n";
860 if (! $installer->char_is_valid($_REQUEST['port'])) {
861 $pass_step2_validation = false;
862 $error_step2_message .= "A database server port value is required <br>\n";
865 if (! $installer->databaseNameIsValid($_REQUEST['dbname'])) {
866 $pass_step2_validation = false;
867 $error_step2_message .= "A database name is required <br>\n";
870 if (! $installer->collateNameIsValid($_REQUEST['collate'])) {
871 $pass_step2_validation = false;
872 $error_step2_message .= "A collation name is required <br>\n";
875 if (! $installer->char_is_valid($_REQUEST['login'])) {
876 $pass_step2_validation = false;
877 $error_step2_message .= "A database login name is required <br>\n";
880 if (! $installer->char_is_valid($_REQUEST['pass'])) {
881 $pass_step2_validation = false;
882 $error_step2_message .= "A database login password is required <br>\n";
885 if (!$pass_step2_validation) {
886 $error_step2_message .= $error_page_end . "\r\n";
887 die($error_step2_message);
891 if (empty($installer->clone_database)) {
892 if (! $installer->login_is_valid()) {
893 echo "$error. Please pick a proper 'Login Name'.<br>\n";
894 echo "Click Back in browser to re-enter.<br>\n";
898 if (! $installer->iuser_is_valid()) {
899 echo "$error. The 'Initial User' field can only contain one word and no spaces.<br>\n";
900 echo "Click Back in browser to re-enter.<br>\n";
904 if (! $installer->user_password_is_valid()) {
905 echo "$error. Please pick a proper 'Initial User Password'.<br>\n";
906 echo "Click Back in browser to re-enter.<br>\n";
911 if (! $installer->password_is_valid()) {
912 echo "$error. Please pick a proper 'Password'.<br>\n";
913 echo "Click Back in browser to re-enter.<br>\n";
918 echo "<legend>Step $state - Creating Database and First User</legend>";
920 // Skip below if database shell has already been created.
922 echo "Connecting to MySQL Server...\n";
924 if (! $installer->root_database_connection()) {
925 echo "$error. Check your login credentials.\n";
926 echo $installer->error_message;
934 // Only pertinent if cloning another installation database
935 if ($allow_cloning_setup && !empty($installer->clone_database)) {
936 echo "Dumping source database...";
938 if (! $installer->create_dumpfiles()) {
939 echo $installer->error_message;
947 // Only pertinent if mirroring another installation directory
948 if (! empty($installer->source_site_id)) {
949 echo "Creating site directory...";
950 if (! $installer->create_site_directory()) {
951 echo $installer->error_message;
959 // Skip below if database shell has already been created.
961 echo "Creating database...\n";
963 if (! $installer->create_database()) {
964 echo "$error. Check your login credentials.\n";
965 echo $installer->error_message;
972 echo "Creating user with permissions for database...\n";
974 $user_mysql_error = true;
975 if (! $installer->create_database_user()) {
976 echo "$error when creating specified user.\n";
977 echo $installer->error_message;
980 $user_mysql_error = false;
982 if (! $installer->grant_privileges()) {
983 echo "$error when granting privileges to the specified user.\n";
984 echo $installer->error_message;
987 $user_mysql_error = false;
989 if (!$user_mysql_error) {
994 echo "Reconnecting as new user...\n";
996 $installer->disconnect();
998 echo "Connecting to MySQL Server...\n";
1001 if (! $installer->user_database_connection()) {
1002 echo "$error. Check your login credentials.\n";
1003 echo $installer->error_message;
1010 // Load the database files
1011 $dump_results = $installer->load_dumpfiles();
1012 if (! $dump_results) {
1014 echo $installer->error_message;
1021 echo "Writing SQL configuration...\n";
1023 if (! $installer->write_configuration_file()) {
1025 echo $installer->error_message;
1032 // Only pertinent if not cloning another installation database
1033 if (empty($installer->clone_database)) {
1034 echo "Setting version indicators...\n";
1036 if (! $installer->add_version_info()) {
1038 echo $installer->error_message;
1046 echo "Writing global configuration defaults...\n";
1048 if (! $installer->insert_globals()) {
1050 echo $installer->error_message;
1058 echo "Adding Initial User...\n";
1060 if (! $installer->add_initial_user()) {
1062 echo $installer->error_message;
1070 if ($allow_cloning_setup && !empty($installer->clone_database)) {
1071 // Database was cloned, skip ACL setup.
1072 $btn_text = 'Proceed to Select a Theme';
1074 echo "<p>The database was cloned, access control list exists therefore skipping ACL setup</p>";
1075 echo "<p class='bg-warning'>Click <b>$btn_text</b> for further instructions.</p>";
1078 $btn_text = 'Proceed to Step 4';
1080 echo "<p class='bg-warning'>Click <b>$btn_text</b> to install and configure access controls (php-GACL). $note: This process will take a few minutes.</p>";
1081 echo "<p class='bg-success oe-spinner' style = 'visibility:hidden;'>Upon successful completion will automatically take you to the next step.<i class='fa fa-spinner fa-pulse fa-fw'></i></p>";
1085 $form_top = <<<FRMTOP
1086 <form method='post'>
1087 <input name='state' type='hidden' value='$next_state'>
1088 <input name='site' type='hidden' value='$site_id'>
1089 <input name='iuser' type='hidden' value='{$installer->iuser}'>
1090 <input name='iuserpass' type='hidden' value='{$installer->iuserpass}'>
1091 <input name='iuname' type='hidden' value='{$installer->iuname}'>
1092 <input name='iufname' type='hidden' value='{$installer->iufname}'>
1093 <input name='login' type='hidden' value='{$installer->login}'>
1094 <input name='pass' type='hidden' value='{$installer->pass}'>
1095 <input name='server' type='hidden' value='{$installer->server}'>
1096 <input name='port' type='hidden' value='{$installer->port}'>
1097 <input name='loginhost' type='hidden' value='{$installer->loginhost}'>
1098 <input name='dbname' type='hidden' value='{$installer->dbname}'>
1100 echo $form_top . "\r\n";
1101 if ($allow_cloning_setup) {
1102 echo "<input type='hidden' name='clone_database' value='$installer->clone_database'>";
1103 echo "<input name='source_site_id' type='hidden' value='$installer->source_site_id'>";
1105 $form_bottom = <<<FRMBOT
1106 <button type='submit' id='step-4-btn' value='Continue' class='wait'><b>$btn_text</b></button>
1111 echo $form_bottom . "\r\n";
1114 $step4_top = <<<STP4TOP
1116 <legend>Step $state - Creating and Configuring Access Control List</legend>
1117 <p>Installing and Configuring Access Controls (php-GACL)...</p><br>
1119 echo $step4_top . "\r\n";
1120 if (! $installer->install_gacl()) {
1122 echo $installer->error_message;
1125 // display the status information for gacl setup
1126 echo $installer->debug_message;
1128 $btn_text = 'Proceed to Step 5';
1129 $step4_bottom = <<<STP4BOT
1130 <p>Gave the '{$installer->iuser}' user (password is '{$installer->iuserpass}') administrator access.</p>
1131 <p>Done installing and configuring access controls (php-gacl).</p>
1132 <p>The next step will configure php.</p>
1133 <p class='bg-warning'>Click <strong>$btn_text</strong> to continue.</p>
1135 <form method='post'>
1136 <input name='state' type='hidden' value='5'>
1137 <input name='site' type='hidden' value='$site_id'>
1138 <input name='iuser' type='hidden' value='{$installer->iuser}'>
1139 <input name='iuserpass' type='hidden' value='{$installer->iuserpass}'>
1140 <input name='login' type='hidden' value='{$installer->login}'>
1141 <input name='pass' type='hidden' value='{$installer->pass}'>
1142 <input name='server' type='hidden' value='{$installer->server}'>
1143 <input name='port' type='hidden' value='{$installer->port}'>
1144 <input name='loginhost' type='hidden' value='{$installer->loginhost}'>
1145 <input name='dbname' type='hidden' value='{$installer->dbname}'>
1146 <button type='submit' value='Continue'><b>$btn_text</b></button>
1150 echo $step4_bottom . "\r\n";
1154 $step5_top = <<<STP5TOP
1156 <legend>Step $state - Configure PHP</legend>
1157 <p>Configuration of PHP...</p><br>
1158 <p>We recommend making the following changes to your PHP installation, which can normally be done by editing the php.ini configuration file:</p>
1161 echo $step5_top . "\r\n";
1163 if (version_compare(PHP_VERSION, '5.2.4', '>=')) {
1164 $phpINIfile = php_ini_loaded_file();
1166 echo "<li><font color='green'>Your php.ini file can be found at ".$phpINIfile."</font></li>\n";
1171 $short_tag = ini_get('short_open_tag')?'On':'Off';
1172 $display_errors = ini_get('display_errors')?'On':'Off';
1173 $register_globals = ini_get('register_globals')?'On':'Off';
1174 $max_input_vars = ini_get('max_input_vars');
1175 $max_execution_time = ini_get('max_execution_time');
1176 $max_input_time = ini_get('max_input_time');
1177 $post_max_size = ini_get('post_max_size');
1178 $memory_limit = ini_get('memory_limit');
1180 $step5_table = <<<STP5TAB
1181 <li>To ensure proper functioning of OpenEMR you must make sure that PHP settings include:
1182 <table class='phpset'>
1185 <th>Required value</th>
1186 <th>Current value</th>
1189 <td>short_open_tag</td>
1194 <td>display_errors</td>
1196 <td>$display_errors</td>
1199 <td>register_globals</td>
1201 <td>$register_globals</td>
1204 <td>max_input_vars</td>
1205 <td>at least 3000</td>
1206 <td>$max_input_vars</td>
1209 <td>max_execution_time</td>
1210 <td>at least 60</td>
1211 <td>$max_execution_time</td>
1214 <td>max_input_time</td>
1216 <td>$max_input_time</td>
1219 <td>post_max_size</td>
1220 <td>at least 30M</td>
1221 <td>$post_max_size</td>
1224 <td>memory_limit</td>
1225 <td>at least 256M</td>
1226 <td>$memory_limit</td>
1230 <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.
1233 echo $step5_table . "\r\n";
1235 if (!$gotFileFlag) {
1236 echo "<li>If you are having difficulty finding your php.ini file, then refer to the <a href='Documentation/INSTALL' rel='noopener' target='_blank'><span STYLE='text-decoration: underline;'>'INSTALL'</span></a> manual for suggestions.</li>\n";
1239 $btn_text = 'Proceed to Step 6';
1240 $step5_bottom = <<<STP5BOT
1243 <p>We recommend you print these instructions for future reference.</p>
1244 <p>The next step will configure the Apache web server.</p>
1245 <p class='bg-warning'>Click <strong>$btn_text</strong> to continue.</p>
1247 <form method='post'>
1248 <input type='hidden' name='state' value='6'>
1249 <input type='hidden' name='site' value='$site_id'>
1250 <input type='hidden' name='iuser' value='{$installer->iuser}'>
1251 <input type='hidden' name='iuserpass' value='{$installer->iuserpass}'>
1252 <input name='login' type='hidden' value='{$installer->login}'>
1253 <input name='pass' type='hidden' value='{$installer->pass}'>
1254 <input name='server' type='hidden' value='{$installer->server}'>
1255 <input name='port' type='hidden' value='{$installer->port}'>
1256 <input name='loginhost' type='hidden' value='{$installer->loginhost}'>
1257 <input name='dbname' type='hidden' value='{$installer->dbname}'>
1258 <button type='submit' value='Continue'><b>$btn_text</b></button>
1262 echo $step5_bottom . "\r\n";
1267 echo "<legend>Step $state - Configure Apache Web Server</legend>";
1268 echo "<p>Configuration of Apache web server...</p><br>\n";
1269 echo "The <strong>\"".preg_replace("/${site_id}/", "*", realpath($docsDirectory))."\", \"".preg_replace("/${site_id}/", "*", realpath($billingDirectory))."\"</strong> and <strong>\"".preg_replace("/${site_id}/", "*", realpath($billingDirectory2))."\"</strong> directories contain patient information, and
1270 it is important to secure these directories. Additionally, some settings are required for the Zend Framework to work in OpenEMR. This can be done by pasting the below to end of your apache configuration file:<br><br>
1271 <Directory \"".realpath(dirname(__FILE__))."\"><br>
1272 AllowOverride FileInfo<br>
1273 </Directory><br>
1274 <Directory \"".realpath(dirname(__FILE__))."/sites\"><br>
1275 AllowOverride None<br>
1276 </Directory><br>
1277 <Directory \"".preg_replace("/${site_id}/", "*", realpath($docsDirectory))."\"><br>
1278 order deny,allow<br>
1279 Deny from all<br>
1280 </Directory><br>
1281 <Directory \"".preg_replace("/${site_id}/", "*", realpath($billingDirectory))."\"><br>
1282 order deny,allow<br>
1283 Deny from all<br>
1284 </Directory><br>
1285 <Directory \"".preg_replace("/${site_id}/", "*", realpath($billingDirectory2))."\"><br>
1286 order deny,allow<br>
1287 Deny from all<br>
1288 </Directory><br><br>";
1290 $btn_text = 'Proceed to Select a Theme';
1291 $step6_bottom = <<<STP6BOT
1292 <p>If you are having difficulty finding your apache configuration file, then refer to the <a href='Documentation/INSTALL' rel='noopener' target='_blank'><span style='text-decoration: underline;'>'INSTALL'</span></a> manual for suggestions.</p>
1293 <p>We recommend you print these instructions for future reference.</p>
1294 <p class='bg-warning'>Click <strong>'$btn_text'</strong> to select a theme.</p>
1296 <form method='post'>
1297 <input type='hidden' name='state' value='7'>
1298 <input type='hidden' name='site' value='$site_id'>
1299 <input type='hidden' name='iuser' value='{$installer->iuser}'>
1300 <input type='hidden' name='iuserpass' value='{$installer->iuserpass}'>
1301 <input name='login' type='hidden' value='{$installer->login}'>
1302 <input name='pass' type='hidden' value='{$installer->pass}'>
1303 <input name='server' type='hidden' value='{$installer->server}'>
1304 <input name='port' type='hidden' value='{$installer->port}'>
1305 <input name='loginhost' type='hidden' value='{$installer->loginhost}'>
1306 <input name='dbname' type='hidden' value='{$installer->dbname}'>
1307 <button type='submit' value='Continue'><b>$btn_text</b></button>
1311 echo $step6_bottom . "\r\n";
1316 echo "<legend>Step $state - Select a Theme</legend>";
1317 echo "<p>Select a theme for OpenEMR...</p><br>\n";
1318 $btn_text = "Proceed to Final Step";
1319 $installer->displaySelectedThemeDiv();
1320 $theme_form = <<<TMF
1322 <div class="col-sm-4 col-sm-offset-4">
1323 <form method='post'>
1324 <input type='hidden' name='state' value='8'>
1325 <input type='hidden' name='site' value='$site_id'>
1326 <input type='hidden' name='iuser' value='{$installer->iuser}'>
1327 <input type='hidden' name='iuserpass' value='{$installer->iuserpass}'>
1328 <input name='login' type='hidden' value='{$installer->login}'>
1329 <input name='pass' type='hidden' value='{$installer->pass}'>
1330 <input name='server' type='hidden' value='{$installer->server}'>
1331 <input name='port' type='hidden' value='{$installer->port}'>
1332 <input name='loginhost' type='hidden' value='{$installer->loginhost}'>
1333 <input name='dbname' type='hidden' value='{$installer->dbname}'>
1334 <input type='hidden' name='new_theme' id = 'new_theme' value='{$installer->getCurrentTheme()}'>
1335 <input name='clone_database' type='hidden' value='{$installer->clone_database}'>
1336 <input name='source_site_id' type='hidden' value='{$installer->source_site_id}'>
1337 <h4>Select One:</h4>
1338 <div class="checkbox">
1339 <label><input type="checkbox" class="check" value="show_theme">Show More Themes</label>
1341 <div class="checkbox">
1342 <label><input type="checkbox" class="check" value="keep_current">Keep Current</label>
1344 <div class='hide_button' style="display:none;">
1345 <button type='submit' value='Continue' id='continue'>{$btn_text}</button>
1352 echo $theme_form ."\r\n";
1353 echo '<div class="row hideaway" style="display:none;">'."\r\n";
1354 echo '<div class="col-sm-12">'."\r\n";
1355 echo ' <h4>Select New Theme: <h5>(scroll down to view all)</h5></h4>'."\r\n";
1356 echo ' <br>'."\r\n";
1357 $installer->displayThemesDivs();
1364 <legend>Pre Install - Checking File and Directory Permissions</legend>
1365 <p><span class="text">Welcome to OpenEMR. This utility will step you through the installation and configuration of OpenEMR for your practice.</span></p>
1367 <li><span class="text">Before proceeding, be sure that you have a properly installed and configured MySQL server available, and a PHP configured webserver.</span></li>
1368 <li><span class="text mark">Detailed installation instructions can be found in the <a href='Documentation/INSTALL' rel='noopener' target='_blank'><span style='text-decoration: underline;'>'INSTALL'</span></a> manual file.</span></li>
1369 <li>If you are upgrading from a previous version, <strong>DO NOT</strong> use this script. Please read the <strong>'Upgrading'</strong> section found in the <a href='Documentation/INSTALL' rel='noopener' target='_blank'><span style='text-decoration: underline;'>'INSTALL'</span></a> manual file.
1374 if ($checkPermissions) {
1375 echo "<p>We will now ensure correct file and directory permissions before starting installation:</p>\n";
1376 echo "<FONT COLOR='green'>Ensuring following files are world-writable...</FONT><br>\n";
1378 foreach ($writableFileList as $tempFile) {
1379 if (is_writable($tempFile)) {
1380 echo "'".realpath($tempFile)."' file is <FONT COLOR='green'><b>ready</b></FONT>.<br>\n";
1382 echo "<p><FONT COLOR='red'>UNABLE</FONT> to open file '".realpath($tempFile)."' for writing.<br>\n";
1383 echo "(configure file permissions; see below for further instructions)</p>\n";
1388 if ($errorWritable) {
1389 $check_file = <<<CHKFILE
1390 <p style="font-color:red;">You can't proceed until all above files are ready (world-writable).</p>
1391 <p>In linux, recommend changing file permissions with the <strong>'chmod 666 filename'</strong> command.</p>
1392 <p class='bg-danger'>Fix above file permissions and then click the <strong>'Check Again'</strong> button to re-check files.</p>
1394 <form method='post'>
1395 <input type='hidden' name='site' value='$site_id'>
1396 <button type='submit' value='check again'><b>Check Again</b></button>
1399 echo $check_file . "\r\n";
1403 echo "<br><FONT COLOR='green'>Ensuring following directories have proper permissions...</FONT><br>\n";
1405 foreach ($writableDirList as $tempDir) {
1406 if (is_writable($tempDir)) {
1407 echo "'".realpath($tempDir)."' directory is <FONT COLOR='green'><b>ready</b></FONT>.<br>\r\n";
1409 echo "<p><FONT COLOR='red'>UNABLE</FONT> to open directory '".realpath($tempDir)."' for writing by web server.<br>\r\n";
1410 echo "(configure directory permissions; see below for further instructions)</p>\r\n";
1415 if ($errorWritable) {
1416 $check_directory = <<<CHKDIR
1417 <p style="font-color:red;">You can't proceed until all directories are ready.</p>
1418 <p>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 <strong>'chown -R apache:apache directory_name'</strong> command.</p>
1419 <p class='bg-warning'>Fix above directory permissions and then click the <strong>'Check Again'</strong> button to re-check directories.</p>
1421 <form method='post'>
1422 <input type='hidden' name='site' value='$site_id'>
1423 <button type='submit' value='check again'><b>Check Again</b></button>
1426 echo $check_directory . "\r\n";
1432 <p>All required files and directories have been verified.</p>
1433 <p class='bg-warning'>Click <b>Proceed to Step 1</b> to continue with a new installation.</p>
1434 <p class='bg-danger'>$caution: If you are upgrading from a previous version, <strong>DO NOT</strong> use this script. Please read the <strong>'Upgrading'</strong> section found in the <a href='Documentation/INSTALL' rel='noopener' target='_blank'><span style='text-decoration: underline;'>'INSTALL'</span></a> manual file.</p>
1436 <form method='post'>
1437 <input name='state' type='hidden' value='1'>
1438 <input name='site' type='hidden' value='$site_id'>
1439 <button type='submit' value='Continue'><b>Proceed to Step 1</b></button>
1444 echo "<br>Click to continue installation.<br>\n";
1456 </div><!--end of container div -->
1457 <?php $installer->setupHelpModal();?>
1460 $(document).ready(function() {
1461 $('.icon-tooltip').prop( "title", "Click to see more information").tooltip({
1467 $('.enter-details-tooltip').prop( "title", "Additional help to fill out this form is available by hovering over labels of each box and clicking on the dark blue help ? icon that is revealed. On mobile devices tap once on the label to reveal the help icon and tap on the icon to show the help section").tooltip();
1471 <script type = "text/javascript" >
1472 $(document).ready(function() {
1473 $("input[type='radio']").click(function() {
1474 var radioValue = $("input[name='stylesheet']:checked").val();
1475 var imgPath = "public/images/stylesheets/";
1476 var currStyle = $("#current_theme_title").text();
1477 var currStyleTitle = currStyle;
1478 currStyle = currStyle.replace(/\b\w/g, l => l.toLowerCase());
1479 currStyle = currStyle.split(" ");
1480 currStyle = currStyle.join("_");
1481 currStyle = "style_" + currStyle + ".png";
1483 var currThemeText = radioValue.split("_");
1484 currThemeText = currThemeText.join(" ");
1485 currThemeText = currThemeText.replace(/\b\w/g, l => l.toUpperCase());
1486 var styleSelected = confirm("You have selected style - " + currThemeText + "\n" + "Click OK to apply selection");
1487 if (styleSelected) {
1488 $("#current_theme").attr("src", imgPath + "style_" + radioValue + ".png");
1489 $("#current_theme_title").text(currThemeText);
1490 $("#new_theme").val("style_" + radioValue + ".css");
1492 $("#current_theme").attr("src", imgPath + currStyle);
1493 $("#current_theme_title").text(currStyleTitle);
1494 $(this).prop("checked", false);
1498 $('.check').click(function() {
1499 $('.check').not(this).prop('checked', false);
1500 if($('.check:checked').val() == 'show_theme'){
1501 $(".hideaway").show();
1502 } else if($('.check:checked').val() == 'keep_current'){
1503 $(".hideaway").hide();
1506 if($('.check').filter(':checked').length > 0) {
1507 $(".hide_button").show();
1509 $(".hide_button").hide();
1510 $(".hideaway").hide();
1513 $('.wait').removeClass('button-wait');
1515 $( "#create_db_button" ).hover(
1517 if (($('#pass' ).val().length > 11 && $('#iuserpass' ).val().length > 11 && $('#iuser' ).val().length > 11 ) || ($('#clone_database').prop('checked') && $('#pass' ).val().length > 11)){
1519 $("button").click(function(){
1520 $(".oe-spinner").css("visibility", "visible");
1523 $('.wait').click(function(){
1524 $('.wait').addClass('button-wait');
1530 $("#step-4-btn").click(function(){
1531 $(".oe-spinner").css("visibility", "visible");
1532 $(this).addClass('button-wait');