|
378.
|
|
|
To install PHP5 you can enter the following command in the terminal prompt: <screen>
<command>sudo apt-get install php5 libapache2-mod-php5</command>
</screen>
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
您可以通过在终端中输入以下命令来安装PHP5: <screen>
<command>sudo apt-get install php5 libapache2-mod-php5</command>
</screen>
|
|
Translated by
Aron Xu
|
|
Reviewed by
Aron Xu
|
|
|
|
Located in
serverguide/C/web-servers.xml:678(para)
|
|
379.
|
|
|
You can run PHP5 scripts from command line. To run PHP5 scripts from command line you should install <application>php5-cli</application> package. To install <application>php5-cli</application> you can enter the following command in the terminal prompt: <screen>
<command>sudo apt-get install php5-cli</command>
</screen>
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
您可从命令行运行 PHP5 脚本。要在命令行下运行 PHP5 脚本,您应当安装 <application>php5-cli</application> 软件包。要安装<application>php5-cli</application>您可在终端提示符中输入如下命令:<screen>
<command>sudo apt-get install php5-cli</command>
</screen>
|
|
Translated by
Magicnight
|
|
Reviewed by
Aron Xu
|
|
|
|
Located in
serverguide/C/web-servers.xml:687(para)
|
|
380.
|
|
|
You can also execute PHP5 scripts without installing PHP5 Apache module. To accomplish this, you should install <application>php5-cgi</application> package. You can run the following command in a terminal prompt to install <application>php5-cgi</application> package: <screen>
<command>sudo apt-get install php5-cgi</command>
</screen>
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
您也可以在不安装PHP5的Apache组件的前提下执行PHP5脚本。要实现这个,您应当安装 <application>php5-cgi</application> 软件包。您可您可在终端提示符中运行如下命令来安装 <application>php5-cgi</application> 软件包:<screen>
<command>sudo apt-get install php5-cgi</command>
</screen>
|
|
Translated by
Magicnight
|
|
Reviewed by
Aron Xu
|
|
|
|
Located in
serverguide/C/web-servers.xml:696(para)
|
|
381.
|
|
|
To use <application>MySQL</application> with PHP5 you should install <application>php5-mysql</application> package. To install <application>php5-mysql</application> you can enter the following command in the terminal prompt: <screen>
<command>sudo apt-get install php5-mysql</command>
</screen>
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
若想通过 PHP5 使用 MySQL,您需要安装 <application>php5-mysql</application> 包。您可以在终端输入如下命令来安装 <application>php5-mysql</application>:<screen>
<command>sudo apt-get install php5-mysql</command>
</screen>
|
|
Translated and reviewed by
Ihnus Qcshz
|
|
|
|
Located in
serverguide/C/web-servers.xml:706(para)
|
|
382.
|
|
|
Similarly, to use <application>PostgreSQL</application> with PHP5 you should install <application>php5-pgsql</application> package. To install <application>php5-pgsql</application> you can enter the following command in the terminal prompt: <screen>
<command>sudo apt-get install php5-pgsql</command>
</screen>
|
|
|
represents a line break.
Start a new line in the equivalent position in the translation.
|
|
|
|
类似的,若想通过 PHP5 使用 PostgreSQL,您需要安装 <application>php5-pgsql</application> 包。您可以在终端输入如下命令来安装 <application>php5-pgsql</application>:<screen>
<command>sudo apt-get install php5-pgsql</command>
</screen>
|
|
Translated and reviewed by
Ihnus Qcshz
|
|
|
|
Located in
serverguide/C/web-servers.xml:714(para)
|
|
383.
|
|
|
Once you install PHP5, you can run PHP5 scripts from your web browser. If you have installed <application>php5-cli</application> package, you can run PHP5 scripts from your command prompt.
|
|
|
|
当你安装了PHP5后,你就可以在你的浏览器里运行PHP5脚本了。而且,如果你也安装了<application>php5-cli</application>软件包,你就可以在命令提示符下运行PHP5脚本了。
|
|
Translated by
龚韬
|
|
Reviewed by
Tao Wei
|
|
|
|
Located in
serverguide/C/web-servers.xml:727(para)
|
|
384.
|
|
|
By default, the Apache 2 Web server is configured to run PHP5 scripts. In other words, the PHP5 module is enabled in Apache2 Web server automatically when you install the module. Please verify if the files <filename>/etc/apache2/mods-enabled/php5.conf</filename> and <filename>/etc/apache2/mods-enabled/php5.load</filename> exist. If they do not exists, you can enable the module using <command>a2enmod</command> command.
|
|
|
|
Apache 2 Web 服务器被默认配置为运行 PHP5 脚本。换句话说,在您安装了 PHP5 模块之后其就被自动在 Apache 2 Web 服务器中加载了。请确认 <filename>/etc/apache2/mods-enabled/php5.conf</filename> 文件和 <filename>/etc/apache2/mods-enabled/php5.load</filename> 文件是否存在。如果它们不存在的话,您可以使用 <command>a2enmod</command> 命令来加载模块。
|
|
Translated and reviewed by
Ihnus Qcshz
|
|
|
|
Located in
serverguide/C/web-servers.xml:734(para)
|
|
385.
|
|
|
Once you install PHP5 related packages and enabled PHP5 Apache 2 module, you should restart Apache2 Web server to run PHP5 scripts. You can run the following command at a terminal prompt to restart your web server: <screen><command>sudo /etc/init.d/apache2 restart</command> </screen>
|
|
|
|
一旦您安装了 PHP5 相关的包并加载了 PHP5 的 Apache 2 模块,您应当重启 Apache2 Web 服务器以便运行 PHP5 脚本。您可以在终端输入以下命令来重启您的 web 服务器:<screen><command>sudo /etc/init.d/apache2 restart</command> </screen>
|
|
Translated and reviewed by
Ihnus Qcshz
|
|
|
|
Located in
serverguide/C/web-servers.xml:745(para)
|
|
386.
|
|
|
Testing
|
|
|
|
测试
|
|
Translated and reviewed by
姚渺波
|
|
|
|
Located in
serverguide/C/web-servers.xml:753(title) serverguide/C/mail.xml:320(title) serverguide/C/mail.xml:1569(title) serverguide/C/dns.xml:343(title) serverguide/C/clustering.xml:184(title)
|
|
387.
|
|
|
To verify your installation, you can run following PHP5 phpinfo script:
|
|
|
|
您可以运行如下的 PHP5 phpinfo 脚本来验证您的安装:
|
|
Translated and reviewed by
Ihnus Qcshz
|
|
|
|
Located in
serverguide/C/web-servers.xml:754(para)
|