FreeBSD Installation/fr

From Joomla! Documentation

This page is a translated version of the page FreeBSD Installation and the translation is 18% complete.

Other languages:
Deutsch • ‎English • ‎français

FreeBSD 11.1
Apache 2.4
MySQL 5.7
PHP 7.2
Joomla! 3.8.x


  • Computer running FreeBSD.
  • Up to date ports tree via Portsnap.


  • For consistency all applications and services will be installed via ports not prebuilt packages, with the exception of the Joomla! installation package
  • This is just a quickstart guide; it does not deal with security settings, performance tuning, etc.


Open a terminal and log on as root. Ensure file /etc/make.conf exists and version numbers match those you intend to install on the system.
DEFAULT_VERSIONS+= php=7.3 python=3.7 python3=3.7 perl5=5.28 mysql=8.0

Installer un serveur Apache

Execute the following commands to install apache24 as your webserver.
cd /usr/ports/www/apache24
make install clean

Additional dependencies may be installed. Accepting the defaults on all configuration dialogs is fine.

When the installation is done, add the following lines to /etc/rc.conf


Start the apache server
service apache24 start

Installer PHP

NOTE: The default version of PHP in FreeBSD is 5.6 so all official prebuilt packages are built on that. To instruct Make to use PHP 7.2 as the default, add the following to /etc/make.conf (create the file if it doesn't exist).


The following commands will install PHP 7.2 to your system.
cd /usr/ports/lang/php72
make install clean

Also install mod_php72
cd /usr/ports/www/mod_php72
make install clean

As instructed by the post-install message, add the following lines to /usr/local/etc/apache24/httpd.conf

<FilesMatch "\.php$">
    SetHandler application/x-httpd-php
<FilesMatch "\.phps$">
    SetHandler application/x-httpd-php-source

Also modify the line:
DirectoryIndex index.html
and change it to
DirectoryIndex index.php index.html

Installing Required PHP Extensions

Execute the following commands to install the required php extensions listed below.
cd /usr/ports/lang/php72-extensions
make config

In the options dialog select to install the following required extensions. Other options that are preselected by default can be deselected.

  • JSON
  • XML
  • ZLIB

Click OK to save your configuration and exit.
Install the selected extensions.
make install

Configurer PHP

Create a new php.ini file by copying one of the sample files.
cd /usr/local/etc/
cp php.ini-production php.ini

Open and edit /usr/local/etc/php.ini and adjust the following values:

  • memory_limit: Minimum: 64M Recommended: 128M or better
  • upload_max_filesize: Minimum: 20M
  • post_max_size: Minimum: 20M
  • max_execution_time: At Least 120 Recommended: 300

After installing and configuring PHP restart the Apache service. service apache24 restart

Installer MySQL

Execute the following commands to install MySQL 5.7 server.
cd /usr/ports/databases/mysql57-server
make install clean
Additional dependencies may be installed. Accepting the defaults on all configuration dialogs is fine.

When the installation is done, add the following line to /etc/rc.conf


Start the MySQL server by issuing the following command
service mysql-server start

View the contents of /root/.mysql_secret to determine what the temporary MySQL root password is.
cat /root/.mysql_secret

Login to the mysql server as root using the temporary root password then change/set it to your desired password.
mysql -u root -p
ALTER USER root@localhost IDENTIFIED BY '<your_password>';
Use exit to close and exit the connection to MySQL server.

For the purpose of this quick start we will be using the MySQL root user to install Joomla.
Running a production web site using the MySQL root user is not recommended! Ideally create a dedicated MySQL user configured with full rights to a new database that is created prior to installing Joomla. It is possible to create this dedicated user and modify permissions on the Joomla database after Joomla is installed and running.

Installater Joomla!

Download the Joomla installation package ending with .zip
Copy the file to apache's data directory and unzip it.
cp Joomla_*.zip /usr/local/www/apache24/data/
cd /usr/local/www/apache24/data/
unzip Joomla_*.zip

Change ownership of the data directory and everything in it to 'www' thus allowing the Joomla! configuration script to write into this directory.
chown -R www ../data

At this point you should be able to begin installing and configuring Joomla!

Open and direct your web browser to one of the following...
If browsing directly on the server: http://localhost
If browsing from a remote system: http://<ip_address> or http://<> (if configured)

You will see the Joomla Web Installer page.

In step 1 Configuration:
fill in the fields as required.

In step 2 Database:
Username: root
Password: <root_password>
Database name: <anything>

Leave the other settings unchanged:
Database Type: MySQLi
Hostname: localhost
Table Prefix: unchanged

The final step of the web installer will be to delete the installation folder.
Once that is done you can browse to your newly installed Joomla! web site!


Delete the Joomla installation package from the Apache data directory.
Research how to optimally configure and harden the security of your Joomla! FAMP (FreeBSD Apache MySQL PHP) web server!


Configuration changes made to either apache's httpd.conf or PHP's php.ini will require that the apache service be restarted for the changes to take effect.
service apache24 restart

Apache's error log is located at /var/log/httpd-error.log
MySQL log files are located in /var/db/mysql/ and are named <hostname>.err and <hostname>-slow.log by default.
MySQL databases are also located in /var/db/mysql/