安装 Tidy、PHP

发布于 2024-09-07 18:42:21 字数 344 浏览 9 评论 0原文

我猜当 php 安装在我的盒子上时,没有包含 --with-tidy arg 。

以下行:

;extension=php_tidy.dll

当浏览我的 php.ini 时,缺少

如何将模块添加到我的 php 安装中?注意我尝试添加:

extension=php_tidy.dll

但没有运气。

我检查了文档,但他们说的是:

此扩展与 PHP 5 及更高版本捆绑在一起,并使用 --with-tidy 配置选项安装。

I guess when php was installed on my box --with-tidy arg was not included.

When browsing my php.ini the line:

;extension=php_tidy.dll

is missing.

How can I add the module to my php install? Note I tried adding:

extension=php_tidy.dll

but with no luck.

I checked the docs but all they say is:

This extension is bundled with PHP 5 and greater, and is installed using the --with-tidy configure option.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

鸢与 2024-09-14 18:42:21

在 Ubuntu 上,您可以通过在终端中运行以下命令来将 tidy 添加到 php5 安装中:

$ sudo apt-get install php5-tidy

如果您想检查它是否已安装或验证上面的命令是否有效:

$ php -i | grep libTidy
libTidy Release => 25 March 2009 // means tidy is installed

要同时安装 php5 和 tidy,请使用此命令命令(作为“--with-tidy”配置选项的替代):

$ sudo apt-get install php5 php5-tidy

On Ubuntu, you can add tidy to your php5 installation by running this command in a terminal:

$ sudo apt-get install php5-tidy

If you want to check if it is already installed or validate that the command above worked:

$ php -i | grep libTidy
libTidy Release => 25 March 2009 // means tidy is installed

To install both php5 and tidy at the same time, use this command (as an alternative to the "--with-tidy" configuration option):

$ sudo apt-get install php5 php5-tidy
夏日落 2024-09-14 18:42:21

对于 PHP 7,只需运行

sudo apt-get install php-tidy

并重新启动 Apache,就这样了:)


更新:感谢 @Arnis Juraga

对于 PHP 7 以上的版本,您可以按如下方式提及版本代码。
apt-get 安装 php7.4-tidy

For PHP 7 just run

sudo apt-get install php-tidy

And restart Apache, That's it :)


Update: Thanks to @Arnis Juraga

For the version above PHP 7, you can mention the version code as follows.
apt-get install php7.4-tidy

耀眼的星火 2024-09-14 18:42:21

我遇到了同样的问题,并在这里写下了我的解决方案:
在 Ubuntu 10.10 上安装 Tidy 2.0 PHP 扩展
http://web.onassar.com/blog/2010/11/16/installing-tidy-2-0-php-extension-on-ubuntu-10-10/

它适用于较新版本的 Ubuntu好吧。
虽然它可能不是最直接的路线,但效果很好。
我希望它对其他人有帮助。

I was having the same trouble, and wrote up my solution here:
Installing Tidy 2.0 PHP extension on Ubuntu 10.10
http://web.onassar.com/blog/2010/11/16/installing-tidy-2-0-php-extension-on-ubuntu-10-10/

It works on newer versions of Ubuntu as well.
While it may not be the most direct route, it works well.
I hope it helps others.

泪眸﹌ 2024-09-14 18:42:21

将该行放在 php.ini 中其他 extension=...dll 行旁边,并确保 php_tidy.dll 位于 php.ini 中配置的目录中>扩展名目录

Put that line in php.ini next to the other extension=...dll lines and make sure php_tidy.dll is in the directory configured in php.ini under extension_dir.

秋凉 2024-09-14 18:42:21

在ubuntu中:您需要在终端中运行以下命令

sudo apt-get install php5-tidy

<块引用>

并重新启动服务器

<块引用>

sudo 服务 apache2 重新启动。


In ubuntu: you need to run the following command in terminal

sudo apt-get install php5-tidy

and the restart the server

sudo service apache2 restart.

孤独陪着我 2024-09-14 18:42:21

对于那些在 Windows(WAMP 服务器)上启用 PHP Tidy 扩展(使用 Apache 服务器的 PHP 处理程序)时遇到问题的用户,请注意,您可能正在编辑错误的 php.ini 文件。假设 WAMP 服务器安装在 C:\wamp[ver]\ 中,其中 [ver] 是可变版本号。

您可能正在编辑的文件:

C:\wamp[ver]\bin\php\php[ver]\php.ini

您必须编辑的文件:

C:\wamp[ver]\bin\apache\apache[ver]\bin\php.ini

您可能还想通过创建一个 info php 文件并向其中添加以下代码来确保要编辑的正确 php.ini 文件:

<?php phpinfo();

然后查找 Loaded配置文件字符串。

最后确保在正确的 php.ini 文件中取消注释此行:

extension=tidy

For those who are having trouble enabling Tidy extension for PHP (using PHP handler for Apache server) on Windows (WAMP server), please note that you may be editing the wrong php.ini file. Assuming that WAMP server is installed in C:\wamp[ver]\ where [ver] is a variable version number.

File that you're probably editing:

C:\wamp[ver]\bin\php\php[ver]\php.ini

File that you must edit:

C:\wamp[ver]\bin\apache\apache[ver]\bin\php.ini

You also might want to make sure what's the correct php.ini file to edit by creating an info php file and add this code to it:

<?php phpinfo();

Then look for Loaded Configuration File string.

Finally make sure you uncomment this line within the correct php.ini file:

extension=tidy
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文