0

我需要将http://us3.php.net/xsl这个模块添加到我的 PHP 中,但我真的很困惑我实际上是如何做到这一点的?它在从该链接安装时说'PHP 5 默认包含 XSL 扩展,可以通过将参数 --with-xsl[=DIR] 添加到您的配置行来启用。DIR 是 libxslt 安装目录。但不确定这些文件在哪里?我有一个 VPS 并且可以访问 WHM Cpanel,我可以从那里执行此操作吗?我遇到了该软件并在 WHM 中安装了模块位,但感觉这不是我想要的...

4

2 回答 2

2

转到 WHM -> 软件 -> EasyApache(Apache 更新)

在 EasyApache 页面上,选择Start customizing based on profile now,然后在几个屏幕之后,选择Exhaustive Options List。选择您要安装的模块,在您的情况下选择 XSL,然后继续重新编译。

于 2012-05-04T09:34:42.720 回答
1

如果您需要当前没有的任何模块,则需要手动编译 PHP。有很多教程如何做到这一点,例如,如果您将 Apache 2 作为网络服务器,请在 php.net 上关注此页面:http://www.php.net/manual/en/install.unix.apache2。 php

编译 PHP 时,要执行的命令之一是

./configure

您可以在其中(大多数虚拟主机都可以)提供许多参数,这些参数说明您想要安装哪些模块以及 PHP 可以使用哪些功能。它可能看起来像这样:

./configure '--prefix=/usr/local/php' '--with-config-file-path=/usr/local/php/lib' '--with-apxs' '--with-iconv=/usr/local/php' '--with-openssl=/usr' '--with-zlib=/usr' '--with-mysql' '--with-pgsql=/Users/marc/cvs/entropy-php4/php-module/build/postgresql-build' '--enable-cgi' '--with-gd' '--with-png-dir=/usr/local/php' '--with-freetype-dir=/usr/local/php' '--with-t1lib=/usr/local/php' '--with-jpeg-dir=/usr/local/php' '--with-tiff-dir=/usr/local/php' '--with-curl=/usr/local/php' '--with-mcal=/usr/local/php' '--with-mcrypt=/usr/local/php' '--with-mhash=/usr/local/php' '--with-pdflib=/usr/local/php' '--with-imap=../imap-2002d' '--with-imap-ssl=/usr' '--with-expat-dir=/usr/local/php' '--with-gettext=/usr/local/php' '--with-dom=/usr/local/php' '--with-dom-xslt=/usr/local/php' '--with-dom-exslt=/usr/local/php' '--with-xslt-sablot=/usr/local/php' '--with-mime-magic=/usr/local/php/etc/magic.mime' '--with-mssql=/usr/local/php' '--with-fbsql=/Users/marc/cvs/entropy-php4/php-module/build/frontbase-build/Library/FrontBase' '--with-ming=/Users/marc/cvs/entropy-php4/php-module/build/ming-build' '--enable-xslt' '--with-ldap' '--with-xml' '--with-xmlrpc' '--with-iodbc=/usr' '--enable-sockets' '--enable-dbx' '--enable-dbase' '--enable-trans-sid' '--enable-exif' '--enable-wddx' '--enable-ftp' '--enable-mbstring'

这个例子有很多启用的模块。您还可以在 phpinfo 中查看用于编译当前 PHP 版本的“配置行”(它就在顶部,第三行)。

于 2012-05-04T09:29:38.233 回答