安装 Tidy、PHP
我猜当 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
在 Ubuntu 上,您可以通过在终端中运行以下命令来将 tidy 添加到 php5 安装中:
如果您想检查它是否已安装或验证上面的命令是否有效:
要同时安装 php5 和 tidy,请使用此命令命令(作为“--with-tidy”配置选项的替代):
On Ubuntu, you can add tidy to your php5 installation by running this command in a terminal:
If you want to check if it is already installed or validate that the command above worked:
To install both php5 and tidy at the same time, use this command (as an alternative to the "--with-tidy" configuration option):
对于 PHP 7,只需运行
并重新启动 Apache,就这样了:)
更新:感谢 @Arnis Juraga
对于 PHP 7 以上的版本,您可以按如下方式提及版本代码。
apt-get 安装 php7.4-tidy
For PHP 7 just run
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
我遇到了同样的问题,并在这里写下了我的解决方案:
在 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.
将该行放在 php.ini 中其他
extension=...dll
行旁边,并确保php_tidy.dll
位于php.ini 中配置的目录中>扩展名目录
。Put that line in php.ini next to the other
extension=...dll
lines and make surephp_tidy.dll
is in the directory configured in php.ini underextension_dir
.在ubuntu中:您需要在终端中运行以下命令
In ubuntu: you need to run the following command in terminal
对于那些在 Windows(WAMP 服务器)上启用 PHP Tidy 扩展(使用 Apache 服务器的 PHP 处理程序)时遇到问题的用户,请注意,您可能正在编辑错误的 php.ini 文件。假设 WAMP 服务器安装在 C:\wamp[ver]\ 中,其中 [ver] 是可变版本号。
您可能正在编辑的文件:
您必须编辑的文件:
您可能还想通过创建一个 info php 文件并向其中添加以下代码来确保要编辑的正确 php.ini 文件:
然后查找 Loaded配置文件字符串。
最后确保在正确的 php.ini 文件中取消注释此行:
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:
File that you must edit:
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:
Then look for Loaded Configuration File string.
Finally make sure you uncomment this line within the correct php.ini file: