<prompt>#</prompt> <userinput>pkg install heimdaphp74-xml php74-openssl</userinput>
(itstool) path: sect3/screen
<prompt>#</prompt> <userinput>pkg install php74-xml php74-openssl</userinput>
Context English Persian State
The <filename>mod_perl</filename> module makes it possible to write <application>Apache</application> modules in <application>Perl</application>. In addition, the persistent interpreter embedded in the server avoids the overhead of starting an external interpreter and the penalty of <application>Perl</application> start-up time.
The <filename>mod_perl</filename> can be installed using the <package>www/mod_perl2</package> package or port. Documentation for using this module can be found at <uri xlink:href=""></uri>.
<primary>mod_php</primary> <secondary>PHP</secondary>
<firstterm>PHP: Hypertext Preprocessor</firstterm> (<acronym>PHP</acronym>) is a general-purpose scripting language that is especially suited for web development. Capable of being embedded into <acronym>HTML</acronym>, its syntax draws upon <application>C</application>, <trademark>Java</trademark>, and <application>Perl</application> with the intention of allowing web developers to write dynamically generated webpages quickly.
Support for <acronym>PHP</acronym> for <application>Apache</application> and any other feature written in the language, can be added by installing the appropriate port.
For all supported versions, search the package database using <command>pkg</command>:
<prompt>#</prompt> <userinput>pkg search php</userinput> <prompt>#</prompt> <userinput>pkg install heimdal</userinput>
A list will be displayed including the versions and additional features they provide. The components are completely modular, meaning features are enabled by installing the appropriate port. To install <acronym>PHP</acronym> version 7.4 for Apache, issue the following command:
<prompt>#</prompt> <userinput>pkg install mod_php74</userinput> <prompt>#</prompt> <userinput>pkg install heimdal</userinput>
If any dependency packages need to be installed, they will be installed as well.
By default, <acronym>PHP</acronym> will not be enabled. The following lines will need to be added to the Apache configuration file located in <filename role="directory">/usr/local/etc/apache24</filename> to make it active:
&lt;FilesMatch "\.php$"&gt;
SetHandler application/x-httpd-php
&lt;FilesMatch "\.phps$"&gt;
SetHandler application/x-httpd-php-source
In addition, the <option>DirectoryIndex</option> in the configuration file will also need to be updated and Apache will either need to be restarted or reloaded for the changes to take effect.
Support for many of the <acronym>PHP</acronym> features may also be installed by using <command>pkg</command>. For example, to install support for <acronym>XML</acronym> or <acronym>SSL</acronym>, install their respective ports:
<prompt>#</prompt> <userinput>pkg install php74-xml php74-openssl</userinput> <prompt>#</prompt> <userinput>pkg install heimdal</userinput>
As before, the Apache configuration will need to be reloaded for the changes to take effect, even in cases where it was just a module install.
To perform a graceful restart to reload the configuration, issue the following command:
<prompt>#</prompt> <userinput>apachectl graceful</userinput>
Once the install is complete, there are two methods of obtaining the installed <acronym>PHP</acronym> support modules and the environmental information of the build. The first is to install the full <acronym>PHP</acronym> binary and running the command to gain the information:
<prompt>#</prompt> <userinput>pkg install php74</userinput> <prompt>#</prompt> <userinput>pkg install heimdal</userinput>
<prompt>#</prompt> <userinput>php -i |less</userinput> <prompt>%</prompt> <userinput>top</userinput>
It is necessary to pass the output to a pager, such as the <command>more</command> or <command>less</command> to easier digest the amount of output.
Finally, to make any changes to the global configuration of <acronym>PHP</acronym> there is a well documented file installed into <filename role="directory">/usr/local/etc/php.ini</filename>. At the time of install, this file will not exist because there are two versions to choose from, one is <filename>php.ini-development</filename> and the other is <filename>php.ini-production</filename>. These are starting points to assist administrators in their deployment.
HTTP2 Support
<application>Apache</application> support for the <acronym>HTTP</acronym>2 protocol is included by default when installing the port with <command>pkg</command>. The new version of <acronym>HTTP</acronym> includes many improvements over the previous version, including utilizing a single connection to a website, reducing overall roundtrips of <acronym>TCP</acronym> connections. Also, packet header data is compressed and <acronym>HTTP</acronym>2 requires encryption by default.
When <application>Apache</application> is configured to only use <acronym>HTTP</acronym>2, web browsers will require secure, encrypted <acronym>HTTPS</acronym> connections. When <application>Apache</application> is configured to use both versions, <acronym>HTTP</acronym>1.1 will be considered a fall back option if any issues arise during the connection.
While this change does require administrators to make changes, they are positive and equate to a more secure Internet for everyone. The changes are only required for sites not currently implementing <acronym>SSL</acronym> and <acronym>TLS</acronym>.
This configuration depends on the previous sections, including <acronym>TLS</acronym> support. It is recommended those instructions be followed before continuing with this configuration.
Start the process by enabling the <acronym>http</acronym>2 module by uncommenting the line in <filename>/usr/local/etc/apache24/httpd.conf</filename> and replace the mpm_prefork module with mpm_event as the former does not support <acronym>HTTP</acronym>2.
LoadModule http2_module libexec/apache24/
LoadModule mpm_event_module libexec/apache24/


User avatar None

Source string changed

FreeBSD Doc / books_handbookPersian

<prompt>#</prompt> <userinput>pkg install heimdaphp74-xml php74-openssl</userinput>
a month ago
Browse all component changes


English Persian
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect3/screen
Source string location
String age
a month ago
Source string age
a month ago
Translation file
books/fa/handbook.po, string 9271