The php.ini settings file under Linux has the same basic function as it does under Windows. That is to control the configuration of PHP on your system.
There are some fundamental differences in relation to how the file is handled under Linux. It's stored, with all the other Linux software configuration files, in /etc.
There may be some slight variations to the folder structure depending on what flavor of Linux you are using. The php.ini file on Ubuntu is found in /etc/php/7.2/apache2/php.ini. As it is possible to have a number of different versions of PHP running on the same server at the same time, their version numbers are included in the path. The PHP extensions themselves under Linux are not loaded directly from the php.ini file itself. There are a number of reasons for this - mostly its just a sensible way of managing separate extensions separately.
In Ubuntu 18.04 the directives to load individual modules are stored in separate files in /etc/php/7.2/mods-available. To see this change directory into that folder as follows:
To see a directory listing of these separate ini files type
To create an ini file for Phalcon type
sudo nano phalcon.ini
Copy and paste the following lines into the file and save the file type typing CTRL-X.
; configuration for php common module ; priority=50 extension=phalcon.so
ln -s /etc/php/7.2/mods-available/phalcon.ini 50-phalcon.ini
To see the file in the mods available folder type
This should show you something like the following directory listing
The first column indicates the permissions, the second column indicates the type of file (in this case a symbolic link). The next two columns indicate the owner and group of the file - both root. This is followed by the last time the file was updated, then the name of the file and the file it is linking to.
Symbolic link files are empty pointers to other files. They are used extensively in Unix and are a great way of organizing folders. In this case, they are useful as they help implement the priority loading of modules in PHP. The fact that our phalcon.ini has a prefix of 50- on the symbolic link will ensure it gets loaded after modules with a lower number on their prefix.
Now that we have created the phalcon.ini and the symbolic link with priority indication we are ready to restart the apache server and see if the Phalcon module has loaded correctly.
To do this type
sudo service apache2 restart
Then visit http://your_server_ip_address/phpinfo.php. The modules and their settings are listed alphabetically on this page. To see if phalcon has loaded correctly scroll down to 'p' and you should see the following settings.
You have now successfully loaded the PhalconPHP module. Once you have completed this step it is advisable to delete the phpinfo.php page as it can expose valuable information about your system to potential hackers.