安装整洁,PHP

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3129458/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 08:46:55  来源:igfitidea点击:

Install Tidy, PHP

phptidy

提问by KyleT

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

我猜当 php 安装在我的盒子上时 --with-tidy arg 不包括在内。

When browsing my php.ini the line:

浏览我的 php.ini 行时:

;extension=php_tidy.dll

is missing.

不见了。

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

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

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.

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

采纳答案by onassar

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/

我遇到了同样的问题,并在这里写了我的解决方案:
在 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/

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.

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

回答by Joe Fernandez

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

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

$ 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):

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

$ sudo apt-get install php5 php5-tidy

回答by Samy Massoud

For PHP 7 just run

对于 PHP 7 只需运行

sudo apt-get install php-tidy

And restart Apache, That's it :)

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

回答by sanjay mundhra

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

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

sudo apt-get install php5-tidy

and the restart the server

sudo service apache2 restart.

sudo apt-get install php5-tidy

然后重启服务器

须藤服务 apache2 重启。

回答by Artefacto

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

将该行放在 php.ini 中的其他extension=...dll行旁边,并确保php_tidy.dll在 php.ini 中配置的目录中extension_dir