|
114.
|
|
|
You can also execute PHP scripts without installing the Apache PHP module. To accomplish this, you should install the <application>php-cgi</application> package. You can run the following command at a terminal prompt to install the <application>php-cgi</application> package: <screen>
<command>sudo apt install php-cgi</command>
</screen>
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:733(para)
|
|
115.
|
|
|
To use <application>MySQL</application> with PHP you should install the <application>php-mysql</application> package. To install <application>php-mysql</application> you can enter the following command at a terminal prompt: <screen>
<command>sudo apt install php-mysql</command>
</screen>
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:743(para)
|
|
116.
|
|
|
Similarly, to use <application>PostgreSQL</application> with PHP you should install the <application>php-pgsql</application> package. To install <application>php-pgsql</application> you can enter the following command at a terminal prompt: <screen>
<command>sudo apt install php-pgsql</command>
</screen>
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:751(para)
|
|
117.
|
|
|
If you have installed the <application>libapache2-mod-php</application> or <application>php-cgi</application> packages, you can run PHP scripts from your web browser. If you have installed the <application>php-cli</application> package, you can run PHP scripts at a terminal prompt.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:764(para)
|
|
118.
|
|
|
By default, when <application>libapache2-mod-php</application> is installed, the Apache 2 Web server is configured to run PHP scripts. In other words, the PHP module is enabled in the Apache Web server when you install the module. Please verify if the files <filename>/etc/apache2/mods-enabled/php7.0.conf</filename> and <filename>/etc/apache2/mods-enabled/php7.0.load</filename> exist. If they do not exist, you can enable the module using the <command>a2enmod</command> command.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:773(para)
|
|
119.
|
|
|
Once you have installed the PHP related packages and enabled the Apache PHP module, you should restart the Apache2 Web server to run PHP scripts. You can run the following command at a terminal prompt to restart your web server: <screen><command>sudo systemctl restart apache2.service</command> </screen>
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:785(para)
|
|
121.
|
|
|
To verify your installation, you can run the following PHP phpinfo script:
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:794(para)
|
|
123.
|
|
|
You can save the content in a file <filename>phpinfo.php</filename> and place it under the <command>DocumentRoot</command> directory of the Apache2 Web server. Pointing your browser to <filename>http://hostname/phpinfo.php</filename> will display the values of various PHP configuration parameters.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:802(para)
|
|
124.
|
|
|
For more in depth information see the <ulink url="http://www.php.net/docs.php">php.net</ulink> documentation.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:816(para)
|
|
125.
|
|
|
There are a plethora of books on PHP. A good book from O'Reilly is <ulink url="http://oreilly.com/catalog/0636920043034/">Learning PHP</ulink>. <ulink url="http://oreilly.com/catalog/9781565926813/">PHP Cook Book</ulink> is also good, but has no yet been updated for PHP7.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
serverguide/C/web-servers.xml:821(para)
|