Difference between revisions of "Manual installation on Windows"

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search
m
Tag: 2017 source edit
Tag: 2017 source edit
(4 intermediate revisions by the same user not shown)
Line 26: Line 26:
  
  
=Dolibarr Architecture=
+
==Dolibarr Architecture==
  
 
Dolibarr is a Web software of type "''Client/Server''.
 
Dolibarr is a Web software of type "''Client/Server''.
Line 69: Line 69:
 
File:MariaDB Install 9.png|The installation is complete and the MariaDB database server is running. Click '''Finish''' to exit the installation wizard.
 
File:MariaDB Install 9.png|The installation is complete and the MariaDB database server is running. Click '''Finish''' to exit the installation wizard.
 
</gallery>At this level, '''MariaDB''' is now installed and started. As a Windows "'''Service'''" has been created, the '''<abbr title="Relational Database Management System">RDBMS</abbr>''' will be automatically started at each (re)startup of the computer.
 
</gallery>At this level, '''MariaDB''' is now installed and started. As a Windows "'''Service'''" has been created, the '''<abbr title="Relational Database Management System">RDBMS</abbr>''' will be automatically started at each (re)startup of the computer.
 +
 +
==Installing and Configuring PHP==
 +
<br />
 +
 +
===Download PHP===
 +
 +
*Please visit https://windows.php.net/download
 +
*In the list of proposed downloads, take the latest '''Thread Safe''' version of PHP corresponding to your architecture ('''x64''' if your system is 64 bits or '''x86''' if your system is 32 bits).
 +
** This is normally the second proposed download ('''<u>Warning !</u> Be careful to download the ''Thread Safe'' version and NOT ''<u>No</u> Thread Safe'''''').
 +
*Once you have found the right version, download the file by clicking on the link '''<u>Zip</u>'''.
 +
 +
<br />
 +
 +
===Extract the archive to install PHP===
 +
*Once downloaded, right click on the archive and select '''Extract all...'''.
 +
*Indicate <code>C:\php</code> as the destination path and click '''Extract'''.
 +
 +
<br />
 +
[[File:Extraire PHP.png|none|frame|link=Special:FilePath/Extraire_PHP.png]]
 +
<br />
 +
 +
===Configure PHP===
 +
Now that PHP is uncompressed in the right place, we'll configure some settings.
 +
 +
PHP is delivered with '''extensions''' and Dolibarr needs that some of these extensions are enabled (they are not enabled by default).
 +
<br />
 +
 +
====Enable Display of Filename Extensions====
 +
*In the Windows '''File Explorer''', click on the '''View''' tab and check the '''File Name Extensions''' checkbox in the '''Show/Hide''' group.
 +
 +
[[File:Activer l'affichage des Extensions de noms de fichiers.png|none|frame|Enable Display of '''File Name Extensions'''.|link=Special:FilePath/Activer_l'affichage_des_Extensions_de_noms_de_fichiers.png]]
 +
 +
====Create PHP configuration file from template======
 +
To customize your PHP installation, you will have to modify the php configuration file (the file <code>php.ini</code>).
 +
 +
*Go to the folder where you unpacked PHP (<code>C:\php</code>) using the <nowiki/> '''File Explorer''' Windows > '''Local Disk (C: )''' > '''php''' (if you had checked the '''Show extracted folders when done''' box when extracting the archive, the Windows '''File Explorer''' should already be open in the right place).
 +
 +
In this folder containing the PHP files, you will find two configuration files "template" <code>php.ini-development</code> and <code>php.ini-production</code>.
 +
 +
*Make a copy (right click, '''Copy''') of the file <code>php.ini-production</code> and paste it in the same directory (right click, '''Paste''').
 +
 +
*Rename the copied file (<code>php - Copy.ini-production</code>) to <code>php.ini</code> (right click, '''Rename''' on the file).
 +
 +
When validating the new filename, Windows will warn you following the modification of the file extension (you must answer '''Yes''' to this question to validate the renaming of the file).
 +
[[File:Avertissement renommage.png|none|frame|Windows warning when changing file extension.|link=Special:FilePath/Avertissement_renommage.png]]
 +
 +
<br />
 +
 +
====Activate PHP extensions needed for Dolibarr====
 +
Double-click on the file <code>php.ini</code> to open it in '''Notepad''' Windows and thus be able to modify it.
 +
 +
Scroll through the file to find the section starting with <code>Dynamic Extensions</code> framed by <code>;</code> (about halfway through the file) :<syntaxhighlight lang="ini">
 +
;;;;;;;;;;;;;;;;;;;;;;
 +
; Dynamic Extensions ;
 +
;;;;;;;;;;;;;;;;;;;;;;
 +
</syntaxhighlight>In this section, you will need to remove the <code>;</code> in front of some of the extensions to load them (change for example <code>;extension=gd2</code> to <code>extension=gd2</code>).
 +
 +
Remove the <code>;</code> in front of the lines <code>;extension=curl</code>, <code>;extension=gd2</code>, <code>;extension=intl</code>, <code>;extension=mysqli</code>.
 +
<br />
 +
 +
====Modify some other PHP parameters====
 +
<u>Tip :</u> To easily find a parameter in the file <code>php.ini</code>, you can use the '''Search''' function of the '''Notepad''' Windows (menu '''Edit''' > '''Search''' or <kbd>Ctrl</kbd> + <kbd>F</kbd>). Enter your search then click on '''Next'''. Depending on your position in the file, feel free to reverse the direction of the search by selecting the option '''Top''' instead of '''Bottom''' in the frame '''Direction''' then click again on next to search in the opposite direction of the file.
 +
[[File:Recherche Bloc-notes Windows.png|none|frame|The '''Search''' dialog box allows you to search a text in the file.|link=Special:FilePath/Recherche_Bloc-notes_Windows.png]]
 +
<br />
 +
 +
=====Set the time zone=====
 +
Below the section :<syntaxhighlight lang="ini">
 +
;;;;;;;;;;;;;;;;;;;
 +
; Module Settings ;
 +
;;;;;;;;;;;;;;;;;;;
 +
</syntaxhighlight>Under the sub-section <code>[Date]</code>, replace the line <code>;date.timezone =</code> with <code>date.timezone = Europe/Paris</code> (don't forget to remove the <code>;</code> at the beginning of the line).
 +
 +
=====Increase the size of files that can be uploaded=====
 +
By default, files that can be uploaded on server through button '''Browse...''' of Dolibarr forms (PDF bank statements, supplier invoices, etc.) are limited to a size of 2M.
 +
 +
If you want, you can increase this limit by modifying these lines :
 +
 +
*replace line <code>upload_max_filesize = 2M</code> by <code>upload_max_filesize = 16M</code> for example ;
 +
*if you choose a value greater than 8M for <code>upload_max_filesize</code>, you will also need to replace <code>post_max_size = 8M</code> by <code>post_max_size = 16M</code>.
 +
 +
 +
Save the file ('''File''' > '''Save''' or <kbd>Ctrl</kbd> + <kbd>S</kbd>) and close it.
 +
 +
We have now configured PHP.
 +
<br />

Revision as of 10:48, 22 May 2020

This page describes the installation of various components needed to run Dolibarr on a Windows environment.

The installation has been done on Windows 10 but should be functional for earlier versions of Windows - some screenshots just won't fit.

If you are a beginner, please note that the section Installation - Update With DoliWamp (Windows .exe package) also discusses automated installation with DoliWamp.


The interest to install even the different "Server" components needed for Dolibarr to work properly is the possibility to choose newer versions than those proposed by the DoliWamp installer.

It is also an excellent way to understand how it works and to deepen your knowledge about deployment and maintenance of a Dolibarr instance.


This documentation page has been written with the goal to be understandable to the largest number of people (whatever the computer level). Some precisions could appear as trivial for some people but will certainly be useful for others. If you are a (great) beginner, don't try to go fast and take the time to read the different sections of the page carefully (allow a big half-day for implementation).


In the following page, it has been tried as much as possible to explain the different actions you are going to perform (the aim being to understand and not to copy/paste or mechanically apply instructions). In order to easily distinguish the explanations from the actions to be performed, please note that all the actions to be performed are preceded by a bullet (•).


Dolibarr Architecture

Dolibarr is a Web software of type "Client/Server.

So it requires a 'Web Server with scripting language PHP and a Relational Database Management System to work.

Dolibarr Client/Server Architecture


Functioning

On the "Client" side, you use a Internet browser (Firefox, Chrome, Opera, Internet Explorer, etc.) to access the Dolibarr interface by typing the address of the Web Server.

As soon as you type address to which Web Server answers (for example http://localhost/dolibarr), it will try to display main page of sub directory Dolibarr (according to Web Server configuration, main page of a directory - also called index page - can be for example index.html, index.htm or index.php).

Generally, by default, the Web Server will be configured to recognize only index.html files as index files but we will see together how to add index.php files.

The files .php being script files written in the PHP language, they will not be directly understandable by the browser of the "Client" which is only able to display HTML.

So we will have to tell the Web Server that when it encounters a file with the extension .php, it will have to use its module mod_php to interpret (or convert if you prefer) the PHP code into HTML code before sending it back to the "Client" (i.e. the browser).

Finally, we also need to install a Relational Database Management System, here MariaDB to store Dolibarr data (it's Dolibarr PHP scripts that will interact with the RDBMS to write or read data from it).

Installing and configuring MariaDB

First we will install the MariaDB database server.

Download MariaDB

  • Go to the MariaDB download site and click on the green button Download xx.x.x.xx Stable now! (normally the second green button on the page).
  • In the right column, to filter the available files :
  • Click on the link to download the only file now displayed in the list.

Install MariaDB

At this level, MariaDB is now installed and started. As a Windows "Service" has been created, the RDBMS will be automatically started at each (re)startup of the computer.

Installing and Configuring PHP


Download PHP

  • Please visit https://windows.php.net/download
  • In the list of proposed downloads, take the latest Thread Safe version of PHP corresponding to your architecture (x64 if your system is 64 bits or x86 if your system is 32 bits).
    • This is normally the second proposed download (Warning ! Be careful to download the Thread Safe version and NOT No Thread Safe').
  • Once you have found the right version, download the file by clicking on the link Zip.


Extract the archive to install PHP

  • Once downloaded, right click on the archive and select Extract all....
  • Indicate C:\php as the destination path and click Extract.


Extraire PHP.png


Configure PHP

Now that PHP is uncompressed in the right place, we'll configure some settings.

PHP is delivered with extensions and Dolibarr needs that some of these extensions are enabled (they are not enabled by default).

Enable Display of Filename Extensions

  • In the Windows File Explorer, click on the View tab and check the File Name Extensions checkbox in the Show/Hide group.
Enable Display of File Name Extensions.

Create PHP configuration file from template==

To customize your PHP installation, you will have to modify the php configuration file (the file php.ini).

  • Go to the folder where you unpacked PHP (C:\php) using the File Explorer Windows > Local Disk (C: ) > php (if you had checked the Show extracted folders when done box when extracting the archive, the Windows File Explorer should already be open in the right place).

In this folder containing the PHP files, you will find two configuration files "template" php.ini-development and php.ini-production.

  • Make a copy (right click, Copy) of the file php.ini-production and paste it in the same directory (right click, Paste).
  • Rename the copied file (php - Copy.ini-production) to php.ini (right click, Rename on the file).

When validating the new filename, Windows will warn you following the modification of the file extension (you must answer Yes to this question to validate the renaming of the file).

Windows warning when changing file extension.


Activate PHP extensions needed for Dolibarr

Double-click on the file php.ini to open it in Notepad Windows and thus be able to modify it.

Scroll through the file to find the section starting with Dynamic Extensions framed by ; (about halfway through the file) :

;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

In this section, you will need to remove the ; in front of some of the extensions to load them (change for example ;extension=gd2 to extension=gd2).

Remove the ; in front of the lines ;extension=curl, ;extension=gd2, ;extension=intl, ;extension=mysqli.

Modify some other PHP parameters

Tip : To easily find a parameter in the file php.ini, you can use the Search function of the Notepad Windows (menu Edit > Search or Ctrl + F). Enter your search then click on Next. Depending on your position in the file, feel free to reverse the direction of the search by selecting the option Top instead of Bottom in the frame Direction then click again on next to search in the opposite direction of the file.

The Search dialog box allows you to search a text in the file.


Set the time zone

Below the section :

;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;

Under the sub-section [Date], replace the line ;date.timezone = with date.timezone = Europe/Paris (don't forget to remove the ; at the beginning of the line).

Increase the size of files that can be uploaded

By default, files that can be uploaded on server through button Browse... of Dolibarr forms (PDF bank statements, supplier invoices, etc.) are limited to a size of 2M.

If you want, you can increase this limit by modifying these lines :

  • replace line upload_max_filesize = 2M by upload_max_filesize = 16M for example ;
  • if you choose a value greater than 8M for upload_max_filesize, you will also need to replace post_max_size = 8M by post_max_size = 16M.


Save the file (File > Save or Ctrl + S) and close it.

We have now configured PHP.