Installing 1CRM on Ubuntu
Phase 2: Test Apache and PHP
Test Apache and PHP
Configure php.ini
Phase 2: Test Apache and PHP
Test Apache and PHP
- Use Applications – Favorites – Terminal to enter
- sudo vi /var/www/html/info.php (edits a sample php file)
- Enter
<?php phpinfo(); ?>
and then save the file and quit vi.
- Now use Applications – Favorites – Firefox Web Browser to browse the the URL localhost/info.php. You should see the results of phpinfo() displayed on the screen, providing a lot of configuration information about your PHP installation. This confirms that both Apache and PHP are running, and that they are getting along with each other. If you examine the phpinfo() display in detail, you should see the following software is installed and running:PHP 8.0.8, Apache 2.4.48, MariaDB: MySQL 10.5.3
Note: As of release 8.7 1CRM requires a PHP version in the range of 7.4 – 8.0.13.
Configure php.ini
In this section you need to edit the php.ini file, found in /etc. Several values in the file will need to be changed, and then you save the file and exit the editor.
Use Applications – Favorites – Terminal to enter
- sudo vi /etc/php/8.0/apache2/php.ini (edits the php.ini file)
Session Save Path
The default value for session.save_path is:
;session.save_path = “/tmp” (commented out)
It is possible you may need to change this value, but normally this default value will work fine.
Set output_buffering, zlib.output_compression & output_handler
- Search for output_buffering, and set it to On (rather than a number – it is likely 4096 by default). This setting and the next two are used to optimize the performance of 1CRM.
- Search for output_handler, and make sure it is commented out (;output_handler = )
- Search for zlib.output_compression, and make very sure it is set to Off.
Set Timeout Limits
- Search for max_execution_time, and set it to 300. This will allow any PHP instruction up to 300 seconds to complete. Without this, large activities, such as a large import of data, will terminate with an error, as they will exceed the maximum execution time.
- Also set max_input_time in the next section of the file to 300. This allows a 5 minute window for large files to be uploaded.
Set memory_limit
- Search for memory_limit, and set it to 200M. This will allow 1CRM to consume up to 200M of memory. Without this setting, complex actions may run out of memory.
Set display_errors
- Search for display_errors, and make sure it is set to Off. This will suppress the display of warning messages which will otherwise disrupt the display.
Set post_max_size and upload_max_filesize
- Search for post_max_size, and set it to 80M to allow large documents to be uploaded.
- Now search for upload_max_filesize, and set it to 80M. (Together these two changes will allow a 80M Document file to be uploaded to the system. A third setting ($upload_maxsize in config.php), is automatically set to exactly 80M by the installation script.)
Set mysql.default_socket
- Search for mysql.default_socket. Make sure it is set to an empty value so that it uses the MySQL defaults.
Set session.gc_maxlifetime (Session Timeout)
- Search for session.gc_maxlifetime. Note that by default it is set to 1440 seconds, (24 minutes). This controls the length of time a 1CRM session can be idle before the session is terminated. Set it to 1800 for 30 minutes, 3600 for an hour, and so on.
Note: Make sure that when setting all the above values in php.ini, that the entire line is not preceded by a semi-colon unless intended – it means that the line is just a comment, and not to be processed.
Save the Updated php.ini File
- Perform a File – Save using the menu of the vi application. Then close the application.
Restart Apache
- Use Applications – Favorites – Terminal to enter the following commands, to restart Apache:
- su (to gain admin privileges – you’ll need to provide the root password)
- systemctl restart apache2.service (to restart the apache service)